From: Baolin Wang Date: Wed, 24 Jun 2020 06:49:58 +0000 (+0800) Subject: nvme: use USEC_PER_SEC instead of magic numbers X-Git-Tag: v5.15~3211^2~36^2~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f5af577d553103115579b5e404070dfab4d00332;p=platform%2Fkernel%2Flinux-starfive.git nvme: use USEC_PER_SEC instead of magic numbers Use USEC_PER_SEC instead of magic numbers to make code more readable. Reviewed-by: Sagi Grimberg Signed-off-by: Baolin Wang Signed-off-by: Christoph Hellwig --- diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index c1de056..9689804 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -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);