From: Maurizio Lombardi <mlombard@redhat.com>
To: kbusch@kernel.org
Cc: dwagner@suse.de, mkhalfella@purestorage.com, hare@kernel.org,
hch@lst.de, mlombard@arkamax.eu, linux-nvme@lists.infradead.org,
error27@gmail.com
Subject: [PATCH V2] nvme-core: fix unsigned comparison warning in nvme_wait_freeze_timeout
Date: Thu, 21 May 2026 17:37:16 +0200 [thread overview]
Message-ID: <20260521153716.548351-1-mlombard@redhat.com> (raw)
The timeout variable in nvme_wait_freeze_timeout() is an unsigned type.
Checking if it is <= 0 triggers a compiler warning because an unsigned
variable can never be negative.
Fix this warning by changing the type to long.
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Closes: https://lore.kernel.org/r/202605211257.STzj2Ujv-lkp@intel.com/
Fixes: 23b6d2cbf75f ("nvme: remove redundant timeout argument from nvme_wait_freeze_timeout")
Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
---
v2: keep the <= comparison, change the type from unsigned to signed long
drivers/nvme/host/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 72c50d5e938d..554649ffe430 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -5246,7 +5246,7 @@ EXPORT_SYMBOL_GPL(nvme_unfreeze);
int nvme_wait_freeze_timeout(struct nvme_ctrl *ctrl)
{
- unsigned long timeout = ctrl->io_timeout;
+ long timeout = ctrl->io_timeout;
struct nvme_ns *ns;
int srcu_idx;
--
2.54.0
next reply other threads:[~2026-05-21 15:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-21 15:37 Maurizio Lombardi [this message]
2026-05-27 13:43 ` [PATCH V2] nvme-core: fix unsigned comparison warning in nvme_wait_freeze_timeout Maurizio Lombardi
2026-05-27 14:17 ` Keith Busch
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=20260521153716.548351-1-mlombard@redhat.com \
--to=mlombard@redhat.com \
--cc=dwagner@suse.de \
--cc=error27@gmail.com \
--cc=hare@kernel.org \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=mkhalfella@purestorage.com \
--cc=mlombard@arkamax.eu \
/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