]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
selftests/landlock: Fix format warning for __u64 in net_test
authorMickaël Salaün <mic@digikod.net>
Thu, 2 Apr 2026 19:26:06 +0000 (21:26 +0200)
committerMickaël Salaün <mic@digikod.net>
Tue, 7 Apr 2026 16:51:03 +0000 (18:51 +0200)
On architectures where __u64 is unsigned long (e.g. powerpc64), using
%llx to format a __u64 triggers a -Wformat warning because %llx expects
unsigned long long.  Cast the argument to unsigned long long.

Cc: Günther Noack <gnoack@google.com>
Cc: stable@vger.kernel.org
Fixes: a549d055a22e ("selftests/landlock: Add network tests")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/r/202604020206.62zgOTeP-lkp@intel.com/
Reviewed-by: Günther Noack <gnoack3000@gmail.com>
Link: https://lore.kernel.org/r/20260402192608.1458252-6-mic@digikod.net
Signed-off-by: Mickaël Salaün <mic@digikod.net>
tools/testing/selftests/landlock/net_test.c

index b34b139b3f89c5f4d9827ddeafca301952dbe85c..4c528154ea92bbf2e9e2d39def0e39c2a13ae844 100644 (file)
@@ -1356,7 +1356,7 @@ TEST_F(mini, network_access_rights)
                                            &net_port, 0))
                {
                        TH_LOG("Failed to add rule with access 0x%llx: %s",
-                              access, strerror(errno));
+                              (unsigned long long)access, strerror(errno));
                }
        }
        EXPECT_EQ(0, close(ruleset_fd));