Commit f5af577d authored by Baolin Wang's avatar Baolin Wang Committed by Christoph Hellwig

nvme: use USEC_PER_SEC instead of magic numbers

Use USEC_PER_SEC instead of magic numbers to make code more readable.
Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
Signed-off-by: default avatarBaolin Wang <baolin.wang@linux.alibaba.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent b8a12e93
...@@ -2947,7 +2947,7 @@ int nvme_init_identify(struct nvme_ctrl *ctrl) ...@@ -2947,7 +2947,7 @@ int nvme_init_identify(struct nvme_ctrl *ctrl)
if (id->rtd3e) { if (id->rtd3e) {
/* us -> s */ /* us -> s */
u32 transition_time = le32_to_cpu(id->rtd3e) / 1000000; u32 transition_time = le32_to_cpu(id->rtd3e) / USEC_PER_SEC;
ctrl->shutdown_timeout = clamp_t(unsigned int, transition_time, ctrl->shutdown_timeout = clamp_t(unsigned int, transition_time,
shutdown_timeout, 60); shutdown_timeout, 60);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment