]> git.baikalelectronics.ru Git - kernel.git/commit
net: rxrpc: fix clang -Wformat warning
authorJustin Stitt <justinstitt@google.com>
Thu, 7 Jul 2022 18:20:52 +0000 (11:20 -0700)
committerJakub Kicinski <kuba@kernel.org>
Sat, 9 Jul 2022 03:15:11 +0000 (20:15 -0700)
commit9b737860ba54ae24393723e98d5d680b9de38f0f
treeca8afd9d3969ee765dbe7e473f0e77db9bff6dd2
parent6bafc57d4d9f228cba5cc9918bbac74438d5134f
net: rxrpc: fix clang -Wformat warning

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: https://github.com/ClangBuiltLinux/linux/issues/378
Signed-off-by: Justin Stitt <justinstitt@google.com>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Acked-by: David Howells <dhowells@redhat.com>
Link: https://lore.kernel.org/r/20220707182052.769989-1-justinstitt@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/rxrpc/rxkad.c