* [PATCH net-next v2] selftests: net: csum: Fix printk format in recv_get_packet_csum_status()
@ 2026-01-16 9:48 Christophe Leroy (CS GROUP)
2026-01-16 10:13 ` Maxime Chevallier
2026-01-19 18:20 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Christophe Leroy (CS GROUP) @ 2026-01-16 9:48 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Simon Horman, Shuah Khan
Cc: Christophe Leroy (CS GROUP), netdev, linux-kselftest,
linux-kernel
Following warning is encountered when building selftests on powerpc/32.
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
cm->cmsg_len has type __kernel_size_t and CMSG() macro has the type
returned by sizeof() which is size_t.
size_t is 'unsigned int' on some platforms and 'unsigned long' on
other ones so use %zu instead of %lu.
This fixes commit 91a7de85600d ("selftests/net: add csum offload test").
Signed-off-by: Christophe Leroy (CS GROUP) <chleroy@kernel.org>
---
v2: Removed use %zu instead of %u and removed Fixes tag
---
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..e28884ce3ab39 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=%zu expected=%zu",
cm->cmsg_len, CMSG_LEN(sizeof(struct tpacket_auxdata)));
aux = (void *)CMSG_DATA(cm);
--
2.49.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH net-next v2] selftests: net: csum: Fix printk format in recv_get_packet_csum_status()
2026-01-16 9:48 [PATCH net-next v2] selftests: net: csum: Fix printk format in recv_get_packet_csum_status() Christophe Leroy (CS GROUP)
@ 2026-01-16 10:13 ` Maxime Chevallier
2026-01-19 18:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Maxime Chevallier @ 2026-01-16 10:13 UTC (permalink / raw)
To: Christophe Leroy (CS GROUP), David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Shuah Khan
Cc: netdev, linux-kselftest, linux-kernel
Hi Christophe
On 16/01/2026 10:48, Christophe Leroy (CS GROUP) wrote:
> Following warning is encountered when building selftests on powerpc/32.
>
> 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
>
> cm->cmsg_len has type __kernel_size_t and CMSG() macro has the type
> returned by sizeof() which is size_t.
>
> size_t is 'unsigned int' on some platforms and 'unsigned long' on
> other ones so use %zu instead of %lu.
>
> This fixes commit 91a7de85600d ("selftests/net: add csum offload test").
>
> Signed-off-by: Christophe Leroy (CS GROUP) <chleroy@kernel.org>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Maxime
> ---
> v2: Removed use %zu instead of %u and removed Fixes tag
> ---
> 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..e28884ce3ab39 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=%zu expected=%zu",
> cm->cmsg_len, CMSG_LEN(sizeof(struct tpacket_auxdata)));
>
> aux = (void *)CMSG_DATA(cm);
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH net-next v2] selftests: net: csum: Fix printk format in recv_get_packet_csum_status()
2026-01-16 9:48 [PATCH net-next v2] selftests: net: csum: Fix printk format in recv_get_packet_csum_status() Christophe Leroy (CS GROUP)
2026-01-16 10:13 ` Maxime Chevallier
@ 2026-01-19 18:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-01-19 18:20 UTC (permalink / raw)
To: Christophe Leroy
Cc: davem, edumazet, kuba, pabeni, horms, shuah, netdev,
linux-kselftest, linux-kernel
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Fri, 16 Jan 2026 10:48:55 +0100 you wrote:
> Following warning is encountered when building selftests on powerpc/32.
>
> 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
>
> [...]
Here is the summary with links:
- [net-next,v2] selftests: net: csum: Fix printk format in recv_get_packet_csum_status()
https://git.kernel.org/netdev/net-next/c/d321d505edb6
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-01-19 18:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-16 9:48 [PATCH net-next v2] selftests: net: csum: Fix printk format in recv_get_packet_csum_status() Christophe Leroy (CS GROUP)
2026-01-16 10:13 ` Maxime Chevallier
2026-01-19 18:20 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox