[PATCH] nvme-auth: Avoid C=1 warning in nvme_auth_derive_tls_psk()
John Garry
john.g.garry at oracle.com
Fri Jun 26 00:53:56 PDT 2026
On 25/06/2026 18:59, Eric Biggers wrote:
> The following works fine with gcc and clang, but sparse warns about
> label_len not being an actual constant expression:
>
> const size_t label_len = sizeof(label) - 1;
> ...
> static_assert(label_len <= 255);
>
> Avoid this by giving label an explicit length and using sizeof(label)
> instead of label_len.
>
> Reported-by: John Garry<john.g.garry at oracle.com>
> Closes:https://urldefense.com/v3/__https://lore.kernel.org/linux-nvme/965a37dd-
> f698-46b6-9623-1099a13f7e60 at oracle.com__;!!ACWV5N9M2RV99hQ!
> J8XE1bwk2YdSyC1OFLwKfqW-6sr8q1CbdbAt7eLiiK3apCc8fUART-
> Ty_XUdFhzZih5QzMnkLbrQTNUK3TBi$
> Fixes: d126cbaa7d9a ("nvme-auth: common: use crypto library in nvme_auth_derive_tls_psk()")
> Signed-off-by: Eric Biggers<ebiggers at kernel.org>
cheers
Reviewed-by: John Garry <john.g.garry at oracle.com>
More information about the Linux-nvme
mailing list