* [PATCH] selftests: net: csum: Fix printk format in recv_get_packet_csum_status()
@ 2026-01-13 17:44 Christophe Leroy (CS GROUP)
2026-01-14 1:39 ` Jakub Kicinski
0 siblings, 1 reply; 2+ messages in thread
From: Christophe Leroy (CS GROUP) @ 2026-01-13 17:44 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Simon Horman, Shuah Khan, Willem de Bruijn
Cc: Christophe Leroy (CS GROUP), netdev, linux-kselftest,
linux-kernel
CC csum
csum.c: In function 'recv_get_packet_csum_status':
csum.c:710:50: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
710 | error(1, 0, "cmsg: len=%lu expected=%lu",
| ~~^
| |
| long unsigned int
| %u
711 | cm->cmsg_len, CMSG_LEN(sizeof(struct tpacket_auxdata)));
| ~~~~~~~~~~~~
| |
| size_t {aka unsigned int}
csum.c:710:63: warning: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'unsigned int' [-Wformat=]
710 | error(1, 0, "cmsg: len=%lu expected=%lu",
| ~~^
| |
| long unsigned int
| %u
Correct format from %lu to %u for both.
Fixes: 91a7de85600d ("selftests/net: add csum offload test")
Signed-off-by: Christophe Leroy (CS GROUP) <chleroy@kernel.org>
---
tools/testing/selftests/net/lib/csum.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/net/lib/csum.c b/tools/testing/selftests/net/lib/csum.c
index 27437590eeb53..9bcd7394b3043 100644
--- a/tools/testing/selftests/net/lib/csum.c
+++ b/tools/testing/selftests/net/lib/csum.c
@@ -707,7 +707,7 @@ static uint32_t recv_get_packet_csum_status(struct msghdr *msg)
cm->cmsg_level, cm->cmsg_type);
if (cm->cmsg_len != CMSG_LEN(sizeof(struct tpacket_auxdata)))
- error(1, 0, "cmsg: len=%lu expected=%lu",
+ error(1, 0, "cmsg: len=%u expected=%u",
cm->cmsg_len, CMSG_LEN(sizeof(struct tpacket_auxdata)));
aux = (void *)CMSG_DATA(cm);
--
2.49.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] selftests: net: csum: Fix printk format in recv_get_packet_csum_status()
2026-01-13 17:44 [PATCH] selftests: net: csum: Fix printk format in recv_get_packet_csum_status() Christophe Leroy (CS GROUP)
@ 2026-01-14 1:39 ` Jakub Kicinski
0 siblings, 0 replies; 2+ messages in thread
From: Jakub Kicinski @ 2026-01-14 1:39 UTC (permalink / raw)
To: Christophe Leroy (CS GROUP)
Cc: David S. Miller, Eric Dumazet, Paolo Abeni, Simon Horman,
Shuah Khan, Willem de Bruijn, netdev, linux-kselftest,
linux-kernel
On Tue, 13 Jan 2026 18:44:19 +0100 Christophe Leroy (CS GROUP) wrote:
> csum.c:710:50: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
> Correct format from %lu to %u for both.
I mean.. you're going to make the warning appear on every platform
which has a ulong size_t. I think you're looking for %zu?
> Fixes: 91a7de85600d ("selftests/net: add csum offload test")
No Fixes tags on trivial code cleanups please.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-01-14 1:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-13 17:44 [PATCH] selftests: net: csum: Fix printk format in recv_get_packet_csum_status() Christophe Leroy (CS GROUP)
2026-01-14 1:39 ` Jakub Kicinski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox