]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
nvme-core: fix unsigned comparison warning in nvme_wait_freeze_timeout
authorMaurizio Lombardi <mlombard@redhat.com>
Thu, 21 May 2026 15:37:16 +0000 (17:37 +0200)
committerKeith Busch <kbusch@kernel.org>
Wed, 27 May 2026 14:14:48 +0000 (07:14 -0700)
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>
Signed-off-by: Keith Busch <kbusch@kernel.org>
drivers/nvme/host/core.c

index 10f154529334cec9be00469858d0a35105f2d752..fb14a208febeeb024d81abfac9e06bf0df7b6cfc 100644 (file)
@@ -5256,7 +5256,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;