Commit d57f3db1 authored by Daniel Verkamp's avatar Daniel Verkamp
Browse files

nvme: clarify nvme_ctrlr_set_state debug prints



For infinite timeout states, instead of printing UINT64_MAX as a
decimal number, interpret it as "no timeout" instead.

Change-Id: I579f5857f96286734940ab5f493261e60354c4fe
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent 459cd695
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -485,13 +485,14 @@ static void
nvme_ctrlr_set_state(struct spdk_nvme_ctrlr *ctrlr, enum nvme_ctrlr_state state,
		     uint64_t timeout_in_ms)
{
	SPDK_TRACELOG(SPDK_TRACE_NVME, "setting state to %s (timeout %" PRIu64 " ms)\n",
		      nvme_ctrlr_state_string(ctrlr->state), timeout_in_ms);

	ctrlr->state = state;
	if (timeout_in_ms == NVME_TIMEOUT_INFINITE) {
		SPDK_TRACELOG(SPDK_TRACE_NVME, "setting state to %s (no timeout)\n",
			      nvme_ctrlr_state_string(ctrlr->state));
		ctrlr->state_timeout_tsc = NVME_TIMEOUT_INFINITE;
	} else {
		SPDK_TRACELOG(SPDK_TRACE_NVME, "setting state to %s (timeout %" PRIu64 " ms)\n",
			      nvme_ctrlr_state_string(ctrlr->state), timeout_in_ms);
		ctrlr->state_timeout_tsc = spdk_get_ticks() + (timeout_in_ms * spdk_get_ticks_hz()) / 1000;
	}
}