Re: [PATCH] net: sfc: avoid format string warning
From: Arnd Bergmann
Date: Wed Mar 25 2026 - 10:10:05 EST
On Wed, Mar 25, 2026, at 01:22, Edward Cree wrote:
> On 20/03/2026 20:48, Arnd Bergmann wrote:
>
> 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.)
I sent a new version now, tried your suggestion but ended up with
yet another variation where I preformat the string in the two
cases (per driver) that actually use a nontrivial format. This
ended up simpler both four the source and compiled form.
>> 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,
Done.
Arnd