[PATCH] nvme: quieten sparse warning in valid LBA size check
Keith Busch
kbusch at kernel.org
Mon Jun 8 14:30:10 PDT 2026
On Thu, Jun 04, 2026 at 02:58:40PM +0000, John Garry wrote:
> Currently building with C=1 generates the following warning:
>
> CC drivers/nvme/host/core.o
> CHECK drivers/nvme/host/core.c
> drivers/nvme/host/core.c:2426:13: warning: unsigned value that used to be signed checked against zero?
> drivers/nvme/host/core.c:2426:13: signed value source
>
> This issue was introduced when using check_shl_overflow() to check for
> invalid LBA size. Sparse is having trouble dealing with __bitwise __le64
> conversion when passing to check_shl_overflow().
>
> Resolve the issue by moving the check_shl_overflow() call to a separate
> function, where types are not converted.
Thanks, applied to nvme-7.2.
More information about the Linux-nvme
mailing list