eth: bnxt: fix string truncation warning in FW version
authorJakub Kicinski <kuba@kernel.org>
Fri, 17 Jan 2025 18:37:26 +0000 (10:37 -0800)
committerJakub Kicinski <kuba@kernel.org>
Sun, 19 Jan 2025 01:32:45 +0000 (17:32 -0800)
commit17656eb5cfe5b7287dc7f1b21ad02acc25ecdb15
tree14e0f55808491a365ae9d51a5ba7ddab6c80813f
parent5b4fd35343d72f4d4f964de2a9fe36143cc18f39
eth: bnxt: fix string truncation warning in FW version

W=1 builds with gcc 14.2.1 report:

drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c:4193:32: error: ā€˜%s’ directive output may be truncated writing up to 31 bytes into a region of size 27 [-Werror=format-truncation=]
 4193 |                          "/pkg %s", buf);

It's upset that we let buf be full length but then we use 5
characters for "/pkg ".

The builds is also clear with clang version 19.1.5 now.

Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Link: https://patch.msgid.link/20250117183726.1481524-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c