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

Maurizio Lombardi mlombard at arkamax.eu
Thu May 21 07:06:43 PDT 2026


On Thu May 21, 2026 at 4:00 PM CEST, Keith Busch wrote:
> 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.

No problem, let me submit a V2

Maurizio



More information about the Linux-nvme mailing list