Thread (3 messages) 3 messages, 3 authors, 2026-03-26

Re: [PATCH] [v2] net: sfc: avoid format string warning

From: Edward Cree <ecree.xilinx@gmail.com>
Date: 2026-03-26 02:00:27
Also in: lkml, llvm

On 25/03/2026 13:45, Arnd Bergmann wrote:
From: Arnd Bergmann <arnd@arndb.de>

Three sfc drivers contain the same *_fill_test() function that takes
a format string argument that gets passed down to snprintf(), producing
a warning with clang-22:

drivers/net/ethernet/sfc/falcon/ethtool.c:227:60: error: diagnostic behavior may be improved by adding
      the 'format(printf, 7, 8)' attribute to the declaration of 'ef4_fill_test' [-Werror,-Wmissing-format-attribute]
  210 |                 snprintf(test_str, sizeof(test_str), test_format, test_id);
      |                                                                          ^
drivers/net/ethernet/sfc/falcon/ethtool.c:210:13: note: 'ef4_fill_test' declared here

Rework these to take a varargs based test_format that allows better
type checking and a non-varargs unit name that gets pre-filled by
the caller, so that the compiler can validate all format strings.

Fixes: 3273c2e8c66a ("[netdrvr] sfc: sfc: Add self-test support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Edward Cree <ecree.xilinx@gmail.com>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help