diff options
author | Ahmad Fatoum <ahmad@a3f.at> | 2019-08-22 07:51:10 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2019-08-30 09:26:06 +0200 |
commit | 6b585df505e86f601250566a0931f12fe2c34979 (patch) | |
tree | f4e7af0de15f25df4ddf9d162f1acaecb1fd2fd4 /drivers | |
parent | cb2f9447fef731a4e640e5032b47d1131adcb8ed (diff) | |
download | barebox-6b585df505e86f601250566a0931f12fe2c34979.tar.gz barebox-6b585df505e86f601250566a0931f12fe2c34979.tar.xz |
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 <ahmad@a3f.at>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/nvme/host/core.c | 4 |
1 files changed, 2 insertions, 2 deletions
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; |