projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b8a12e9
)
nvme: use USEC_PER_SEC instead of magic numbers
author
Baolin Wang
<baolin.wang@linux.alibaba.com>
Wed, 24 Jun 2020 06:49:58 +0000
(14:49 +0800)
committer
Christoph Hellwig
<hch@lst.de>
Wed, 8 Jul 2020 14:16:19 +0000
(16:16 +0200)
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>
drivers/nvme/host/core.c
patch
|
blob
|
history
diff --git
a/drivers/nvme/host/core.c
b/drivers/nvme/host/core.c
index c1de05646a02e807670765f16fd8d4363224d6d7..96898040a6d571e2725c2e760533599f89197f33 100644
(file)
--- 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);