[PATCH] selftests: mptcp: pm_nl_ctl: print sizeof() with %zu

From
Sasha Levin <sashal@kernel.org>
Date
2026-11-03 15:55:08
Also in
linux-kselftest, lkml, mptcp
On 32-bit architectures size_t is an unsigned int, and printing
sizeof(struct nlmsgerr) with %ld warns:

  pm_nl_ctl.c:73:71: warning: format '%ld' expects argument of type 'long int', but argument 5 has type 'unsigned int' [-Wformat=]

Use %zu.

Signed-off-by: Sasha Levin <sashal@kernel.org>
---
Found with a 32-bit build of the selftests with a 64-bit time_t (gcc 16
and clang 21 with -m32 -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64);
KernelCI's 32-bit arm builds show the same warnings. The changed files
build without format warnings there now, and the x86_64 builds don't
change. The other selftests get the same kind of fix in separate
patches.

 tools/testing/selftests/net/mptcp/pm_nl_ctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/net/mptcp/pm_nl_ctl.c b/tools/testing/selftests/net/mptcp/pm_nl_ctl.c
index 78180da1efcc5..36a6d39b31bbf 100644
--- a/tools/testing/selftests/net/mptcp/pm_nl_ctl.c
+++ b/tools/testing/selftests/net/mptcp/pm_nl_ctl.c
@@ -70,7 +70,7 @@ static int nl_error(struct nlmsghdr *nh)
 	uint32_t off;
 
 	if (len < sizeof(struct nlmsgerr)) {
-		error(1, 0, "netlink error message truncated %d min %ld", len,
+		error(1, 0, "netlink error message truncated %d min %zu", len,
 		      sizeof(struct nlmsgerr));
 		return -1;
 	}
-- 
2.53.0
Thread (4 messages) 4 messages, 4 authors, last reply 14d ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help