mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <ahmad@a3f.at>
To: barebox@lists.infradead.org
Cc: afa@pengutronix.de
Subject: [PATCH 07/11] nvme: use 64 bit types for timeouts even on 32 bit systems
Date: Thu, 22 Aug 2019 07:51:10 +0200	[thread overview]
Message-ID: <20190822055114.931-8-ahmad@a3f.at> (raw)
In-Reply-To: <20190822055114.931-1-ahmad@a3f.at>

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>
---
 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@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2019-08-22  5:51 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-22  5:51 [PATCH 00/11] treewide: fix some ARCH=arm clang warnings Ahmad Fatoum
2019-08-22  5:51 ` [PATCH 01/11] linux/kbuild.h: sync with upstream Ahmad Fatoum
2019-08-26 10:35   ` Sascha Hauer
2019-09-09  9:57     ` Ahmad Fatoum
2019-08-22  5:51 ` [PATCH 02/11] ratp: fix use of %hu for printing int Ahmad Fatoum
2019-08-22  5:51 ` [PATCH 03/11] complete: remove unused variable Ahmad Fatoum
2019-08-22  6:08   ` Michael Olbrich
2019-08-22  6:22     ` Ahmad Fatoum
2019-08-22  6:32   ` [PATCH 1/2] fixup! " Ahmad Fatoum
2019-08-22  6:32     ` [PATCH 2/2] ata: fix mismatched header guards Ahmad Fatoum
2019-08-22  5:51 ` [PATCH 04/11] i2c-mux-pca954x: remove use of uninitialized variable Ahmad Fatoum
2019-08-22  5:51 ` [PATCH 05/11] net: phy: mv88e6xxx: remove duplicate member in struct initializer Ahmad Fatoum
2019-08-22  5:51 ` [PATCH 06/11] smc911x: fix inverted poll-for-ready Ahmad Fatoum
2019-08-22  5:51 ` Ahmad Fatoum [this message]
2019-08-22  5:51 ` [PATCH 08/11] usb: gadget: fsl_udc: remove always-true null pointer checks Ahmad Fatoum
2019-08-22  5:51 ` [PATCH 09/11] commands: mmc_extcsd: describe missing bit Ahmad Fatoum
2019-08-22  5:51 ` [PATCH 10/11] gui: png_lode: fix freeing of uninitialized pointer Ahmad Fatoum
2019-08-22  5:51 ` [PATCH 11/11] fs: fat: fix use of wrong enumeration type Ahmad Fatoum
2019-08-22  6:38 ` [PATCH] ARM: don't use -no-thumb-interwork if unavailable Ahmad Fatoum
2019-08-23  7:20 ` [PATCH 00/11] treewide: fix some ARCH=arm clang warnings Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190822055114.931-8-ahmad@a3f.at \
    --to=ahmad@a3f.at \
    --cc=afa@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox