Re: [PATCH] net: sfc: avoid format string warning
From: Edward Cree <ecree.xilinx@gmail.com>
Date: 2026-03-25 00:22:36
Also in:
lkml, llvm
From: Edward Cree <ecree.xilinx@gmail.com>
Date: 2026-03-25 00:22:36
Also in:
lkml, llvm
On 20/03/2026 20:48, Arnd Bergmann wrote:
Right, I took a bit of a shortcut there. How about changing it so the other format string is just a name that gets joined with the number?
That would work, but all those -1s are a bit unsightly. Like I said, I'd rather have two different efx_fill_test() functions, one which takes a unit_id and one which doesn't. (Also you need to change the kdoc description of unit_name.)
There are not a lot of good options here, and splitting the line seems better than an overlong line to me. I don't really have a strong opinion on where the __printf attribute should go either, but I do see that after the return type is probably the least common, so I'll change that. How about having the specifiers on one line and the type in front of the name? that seems faily common. static __printf(7, 8) void ef4_fill_test(unsigned int test_index, u8 *strings, u64 *data,
I'd rather just have static void __printf(7, 8) ef4_fill_test(unsigned int test_index, Admittedly that puts the ( further over so fewer params fit on each line, but I definitely feel the function name should always appear on the first line of the definition. -ed