From: Justin Stitt Date: Thu, 7 Jul 2022 18:20:52 +0000 (-0700) Subject: net: rxrpc: fix clang -Wformat warning X-Git-Tag: v6.6.17~6916^2~171 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5b47d2364652979dc43df14f7af19346a001b770;p=platform%2Fkernel%2Flinux-rpi.git 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 Reviewed-by: Nathan Chancellor Acked-by: David Howells Link: https://lore.kernel.org/r/20220707182052.769989-1-justinstitt@google.com Signed-off-by: Jakub Kicinski --- diff --git a/net/rxrpc/rxkad.c b/net/rxrpc/rxkad.c index 08aab5c..258917a 100644 --- a/net/rxrpc/rxkad.c +++ b/net/rxrpc/rxkad.c @@ -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; }