From 6b585df505e86f601250566a0931f12fe2c34979 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Thu, 22 Aug 2019 07:51:10 +0200 Subject: nvme: use 64 bit types for timeouts even on 32 bit systems 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 Signed-off-by: Sascha Hauer --- drivers/nvme/host/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index e0984708b4..d2c2b6f306 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; -- cgit v1.2.3