[PATCH] nvme-core: fix unsigned comparison warning in nvme_wait_freeze_timeout

Keith Busch kbusch at kernel.org
Thu May 21 07:00:54 PDT 2026


On Thu, May 21, 2026 at 02:29:40PM +0200, Maurizio Lombardi wrote:
> 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 condition to !timeout.
> 
> blk_mq_freeze_queue_wait_timeout() is a wrapper for
> wait_event_timeout() and the latter returns 0 or a positive value.

It looks like it returns a signed value, but the conditions for which it
may be < 0 currently don't apply since we're using the uninterruptable
state. So looks fine, but I might feel more comfortable if we just used
a signed type to match the API's return type.



More information about the Linux-nvme mailing list