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: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Daniel Verkamp 2017-01-31 13:58:12 -07:00
parent 459cd69571
commit d57f3db1b5

View File

@ -485,13 +485,14 @@ static void
nvme_ctrlr_set_state(struct spdk_nvme_ctrlr *ctrlr, enum nvme_ctrlr_state state, nvme_ctrlr_set_state(struct spdk_nvme_ctrlr *ctrlr, enum nvme_ctrlr_state state,
uint64_t timeout_in_ms) 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; ctrlr->state = state;
if (timeout_in_ms == NVME_TIMEOUT_INFINITE) { 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; ctrlr->state_timeout_tsc = NVME_TIMEOUT_INFINITE;
} else { } 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; ctrlr->state_timeout_tsc = spdk_get_ticks() + (timeout_in_ms * spdk_get_ticks_hz()) / 1000;
} }
} }