Skip to content

Commit

Permalink
nvme: use USEC_PER_SEC instead of magic numbers
Browse files Browse the repository at this point in the history
Use USEC_PER_SEC instead of magic numbers to make code more readable.

Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
  • Loading branch information
Baolin Wang authored and Christoph Hellwig committed Jul 8, 2020
1 parent b8a12e9 commit f5af577
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/nvme/host/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2947,7 +2947,7 @@ int nvme_init_identify(struct nvme_ctrl *ctrl)

if (id->rtd3e) {
/* 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,
shutdown_timeout, 60);
Expand Down

0 comments on commit f5af577

Please sign in to comment.