Files
Eric Biggers ba6e9472b4 nvme-auth: Avoid C=1 warning in nvme_auth_derive_tls_psk()
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 <[email protected]>
Closes: https://lore.kernel.org/linux-nvme/[email protected]
Fixes: d126cbaa7d ("nvme-auth: common: use crypto library in nvme_auth_derive_tls_psk()")
Signed-off-by: Eric Biggers <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Reviewed-by: John Garry <[email protected]>
Signed-off-by: Keith Busch <[email protected]>
2026-07-06 11:28:31 -07:00
..