Commit 5b47d236 authored by Justin Stitt's avatar Justin Stitt Committed by Jakub Kicinski

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/378Signed-off-by: default avatarJustin Stitt <justinstitt@google.com>
Reviewed-by: default avatarNathan Chancellor <nathan@kernel.org>
Acked-by: default avatarDavid Howells <dhowells@redhat.com>
Link: https://lore.kernel.org/r/20220707182052.769989-1-justinstitt@google.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 16bd188e
...@@ -431,7 +431,7 @@ static int rxkad_secure_packet(struct rxrpc_call *call, ...@@ -431,7 +431,7 @@ static int rxkad_secure_packet(struct rxrpc_call *call,
break; break;
} }
_leave(" = %d [set %hx]", ret, y); _leave(" = %d [set %x]", ret, y);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment