Re: [PATCH] staging: greybus: Replace format specifiers
From: Alex Elder
Date: Sat Oct 24 2026 - 10:17:42 EST
On 10/23/26 12:24 PM, Yalagada Pavan Kumar wrote:
On Thu, Oct 22, 2026 at 09:30:26AM -0400, Julia Lawall wrote:
The files compiled sucessfully with the normal build settings. I also
On Thu, 22 Oct 2026, Alex Elder wrote:
On 10/21/26 11:34 AM,pavankumaryalagada@xxxxxxxxx wrote:I was suprised the compiler doesn't complain about this. It seems to
From: Yalagada Pavan Kumar<pavankumaryalagada@xxxxxxxxx>I have reviewed every one of these and they look good. Quite a few
Unsigned variables are printed using %d.
Replace them with %u to match their types.
Signed-off-by: Yalagada Pavan Kumar<pavankumaryalagada@xxxxxxxxx>
of them--because the size of the value being formatted is less than
32 bits--would print correctly no matter what their value. But I
think it at least does no harm to convert the format specifier to
unsigned in all of these cases.
complain a lot about type-related format specifiers. Yalagada maybe it
could be worth adding something clearly invalid in one of the argument
lists to see if the code is actually getting compiled, or if you need to
set some config option to make that happen.
enabled -Wformat-signedness to check for format mismatchse, as this check
is not enabled by default. It revealed a few more issues, which i'll look
into as well.
I think you might find that "sparse" complains. Run your build
with "C=1" to run (by default) sparse, and see if it says something.
-Alex
Pavan
julia