Skip to content

Commit

Permalink
net: rxrpc: fix clang -Wformat warning
Browse files Browse the repository at this point in the history
jira LE-1907
Rebuild_History Non-Buildable kernel-rt-5.14.0-284.30.1.rt14.315.el9_2
commit-author Justin Stitt <[email protected]>
commit 5b47d23

When building with Clang we encounter this warning:
| net/rxrpc/rxkad.c:434:33: error: format specifies type 'unsigned short'
| but the argument has type 'u32' (aka 'unsigned int') [-Werror,-Wformat]
| _leave(" = %d [set %hx]", ret, y);

y is a u32 but the format specifier is `%hx`. Going from unsigned int to
short int results in a loss of data. This is surely not intended
behavior. If it is intended, the warning should be suppressed through
other means.

This patch should get us closer to the goal of enabling the -Wformat
flag for Clang builds.

Link: ClangBuiltLinux/linux#378
	Signed-off-by: Justin Stitt <[email protected]>
	Reviewed-by: Nathan Chancellor <[email protected]>
	Acked-by: David Howells <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
	Signed-off-by: Jakub Kicinski <[email protected]>
(cherry picked from commit 5b47d23)
	Signed-off-by: Jonathan Maple <[email protected]>
  • Loading branch information
PlaidCat committed Sep 13, 2024
1 parent 06275ae commit 73ad1c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/rxrpc/rxkad.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ static int rxkad_secure_packet(struct rxrpc_call *call,
break;
}

_leave(" = %d [set %hx]", ret, y);
_leave(" = %d [set %x]", ret, y);
return ret;
}

Expand Down

0 comments on commit 73ad1c1

Please sign in to comment.