[PATCH 07/11] nvme: use 64 bit types for timeouts even on 32 bit systems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The SHUTDOWN_TIMEOUT value of 5e9 would already exceed the range of
unsigned long on a 32-bit system. Fix this by using uint64_t for
all time-holding variables.

Signed-off-by: Ahmad Fatoum <ahmad@xxxxxx>
---
 drivers/nvme/host/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index e0984708b4d2..d2c2b6f30630 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -94,7 +94,7 @@ EXPORT_SYMBOL_GPL(nvme_set_queue_count);
 static int nvme_wait_ready(struct nvme_ctrl *ctrl, u64 cap, bool enabled)
 {
 	uint64_t start = get_time_ns();
-	unsigned long timeout =
+	uint64_t timeout =
 		((NVME_CAP_TIMEOUT(cap) + 1) * HZ / 2);
 	u32 csts, bit = enabled ? NVME_CSTS_RDY : 0;
 	int ret;
@@ -496,7 +496,7 @@ EXPORT_SYMBOL_GPL(nvme_enable_ctrl);
 int nvme_shutdown_ctrl(struct nvme_ctrl *ctrl)
 {
 	uint64_t start = get_time_ns();
-	unsigned long timeout = SHUTDOWN_TIMEOUT;
+	uint64_t timeout = SHUTDOWN_TIMEOUT;
 	u32 csts;
 	int ret;
 
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux