* [PATCH v2 00/13] selftests: Fix build warnings and errors
@ 2025-12-05 17:09 Guenter Roeck
2025-12-05 17:09 ` [PATCH v2 01/13] clone3: clone3_cap_checkpoint_restore: Fix build warnings Guenter Roeck
` (13 more replies)
0 siblings, 14 replies; 21+ messages in thread
From: Guenter Roeck @ 2025-12-05 17:09 UTC (permalink / raw)
To: Shuah Khan
Cc: Jakub Kicinski, Christian Brauner, Thomas Gleixner, Ingo Molnar,
Eric Dumazet, Kees Cook, linux-kernel, linux-kselftest,
wine-devel, netdev, bpf, Guenter Roeck
This series fixes build warnings and errors observed when trying to build
selftests.
v2: Emphasize that the patch series fixes build warnings and errors
which are seen even if -Werror is not provided.
Fix usage of cc-option.
For "ignoring return value" warnings, use perror() to display an error
message if the affected function returns an error.
----------------------------------------------------------------
Guenter Roeck (13):
clone3: clone3_cap_checkpoint_restore: Fix build warnings
selftests: ntsync: Fix build warnings
selftests/filesystems: fclog: Fix build warnings and errors
selftests/filesystems: file_stressor: Fix build warning
selftests/filesystems: anon_inode_test: Fix build warning
selftest: af_unix: Support compilers without flex-array-member-not-at-end support
selftest/futex: Comment out test_futex_mpol
selftests: net: netlink-dumps: Avoid uninitialized variable warning
selftests/seccomp: Fix build warning
selftests: net: Fix build warnings
selftests/fs/mount-notify: Fix build warning
selftests/fs/mount-notify-ns: Fix build warning
selftests: net: tfo: Fix build warning
tools/testing/selftests/clone3/clone3_cap_checkpoint_restore.c | 4 ----
tools/testing/selftests/drivers/ntsync/ntsync.c | 4 ++--
tools/testing/selftests/filesystems/anon_inode_test.c | 1 +
tools/testing/selftests/filesystems/fclog.c | 1 +
tools/testing/selftests/filesystems/file_stressor.c | 2 --
.../testing/selftests/filesystems/mount-notify/mount-notify_test.c | 3 ++-
.../selftests/filesystems/mount-notify/mount-notify_test_ns.c | 3 ++-
tools/testing/selftests/futex/functional/futex_numa_mpol.c | 2 ++
tools/testing/selftests/net/af_unix/Makefile | 7 ++++++-
tools/testing/selftests/net/lib/ksft.h | 6 ++++--
tools/testing/selftests/net/netlink-dumps.c | 2 +-
tools/testing/selftests/net/tfo.c | 3 ++-
tools/testing/selftests/seccomp/seccomp_bpf.c | 3 ++-
13 files changed, 25 insertions(+), 16 deletions(-)
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH v2 01/13] clone3: clone3_cap_checkpoint_restore: Fix build warnings
2025-12-05 17:09 [PATCH v2 00/13] selftests: Fix build warnings and errors Guenter Roeck
@ 2025-12-05 17:09 ` Guenter Roeck
2025-12-05 17:09 ` [PATCH v2 02/13] selftests: ntsync: " Guenter Roeck
` (12 subsequent siblings)
13 siblings, 0 replies; 21+ messages in thread
From: Guenter Roeck @ 2025-12-05 17:09 UTC (permalink / raw)
To: Shuah Khan
Cc: Jakub Kicinski, Christian Brauner, Thomas Gleixner, Ingo Molnar,
Eric Dumazet, Kees Cook, linux-kernel, linux-kselftest,
wine-devel, netdev, bpf, Guenter Roeck, Adrian Reber
Fix:
clone3_cap_checkpoint_restore.c:56:7: warning: unused variable 'ret'
56 | int ret;
| ^~~
clone3_cap_checkpoint_restore.c:57:8: warning: unused variable 'tmp'
57 | char tmp = 0;
| ^~~
clone3_cap_checkpoint_restore.c:138:6: warning: unused variable 'ret'
138 | int ret = 0;
by removing the unused variables.
Fixes: 1d27a0be16d6 ("selftests: add clone3() CAP_CHECKPOINT_RESTORE test")
Cc: Adrian Reber <areber@redhat.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
v2: Update subject and description to reflect that the patch fixes build
warnings
.../testing/selftests/clone3/clone3_cap_checkpoint_restore.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/tools/testing/selftests/clone3/clone3_cap_checkpoint_restore.c b/tools/testing/selftests/clone3/clone3_cap_checkpoint_restore.c
index 3c196fa86c99..976e92c259fc 100644
--- a/tools/testing/selftests/clone3/clone3_cap_checkpoint_restore.c
+++ b/tools/testing/selftests/clone3/clone3_cap_checkpoint_restore.c
@@ -53,9 +53,6 @@ static int call_clone3_set_tid(struct __test_metadata *_metadata,
}
if (pid == 0) {
- int ret;
- char tmp = 0;
-
TH_LOG("I am the child, my PID is %d (expected %d)", getpid(), set_tid[0]);
if (set_tid[0] != getpid())
@@ -135,7 +132,6 @@ TEST(clone3_cap_checkpoint_restore)
{
pid_t pid;
int status;
- int ret = 0;
pid_t set_tid[1];
test_clone3_supported();
--
2.45.2
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v2 02/13] selftests: ntsync: Fix build warnings
2025-12-05 17:09 [PATCH v2 00/13] selftests: Fix build warnings and errors Guenter Roeck
2025-12-05 17:09 ` [PATCH v2 01/13] clone3: clone3_cap_checkpoint_restore: Fix build warnings Guenter Roeck
@ 2025-12-05 17:09 ` Guenter Roeck
2025-12-08 19:27 ` Elizabeth Figura
2025-12-05 17:09 ` [PATCH v2 03/13] selftests/filesystems: fclog: Fix build warnings and errors Guenter Roeck
` (11 subsequent siblings)
13 siblings, 1 reply; 21+ messages in thread
From: Guenter Roeck @ 2025-12-05 17:09 UTC (permalink / raw)
To: Shuah Khan
Cc: Jakub Kicinski, Christian Brauner, Thomas Gleixner, Ingo Molnar,
Eric Dumazet, Kees Cook, linux-kernel, linux-kselftest,
wine-devel, netdev, bpf, Guenter Roeck, Elizabeth Figura
Fix
ntsync.c:1286:20: warning: call to undeclared function 'gettid';
ISO C99 and later do not support implicit function declarations
1286 | wait_args.owner = gettid();
| ^
ntsync.c:1280:8: warning: unused variable 'index'
1280 | __u32 index, count, i;
| ^~~~~
ntsync.c:1281:6: warning: unused variable 'ret'
1281 | int ret;
by adding the missing include file and removing the unused variables.
Fixes: a22860e57b54 ("selftests: ntsync: Add a stress test for contended waits.")
Cc: Elizabeth Figura <zfigura@codeweavers.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
v2: Update subject and description to reflect that the patch fixes build
warnings
tools/testing/selftests/drivers/ntsync/ntsync.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/drivers/ntsync/ntsync.c b/tools/testing/selftests/drivers/ntsync/ntsync.c
index 3aad311574c4..d3df94047e4d 100644
--- a/tools/testing/selftests/drivers/ntsync/ntsync.c
+++ b/tools/testing/selftests/drivers/ntsync/ntsync.c
@@ -11,6 +11,7 @@
#include <fcntl.h>
#include <time.h>
#include <pthread.h>
+#include <unistd.h>
#include <linux/ntsync.h>
#include "../../kselftest_harness.h"
@@ -1277,8 +1278,7 @@ static int stress_device, stress_start_event, stress_mutex;
static void *stress_thread(void *arg)
{
struct ntsync_wait_args wait_args = {0};
- __u32 index, count, i;
- int ret;
+ __u32 count, i;
wait_args.timeout = UINT64_MAX;
wait_args.count = 1;
--
2.45.2
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v2 03/13] selftests/filesystems: fclog: Fix build warnings and errors
2025-12-05 17:09 [PATCH v2 00/13] selftests: Fix build warnings and errors Guenter Roeck
2025-12-05 17:09 ` [PATCH v2 01/13] clone3: clone3_cap_checkpoint_restore: Fix build warnings Guenter Roeck
2025-12-05 17:09 ` [PATCH v2 02/13] selftests: ntsync: " Guenter Roeck
@ 2025-12-05 17:09 ` Guenter Roeck
2025-12-05 17:09 ` [PATCH v2 04/13] selftests/filesystems: file_stressor: Fix build warning Guenter Roeck
` (10 subsequent siblings)
13 siblings, 0 replies; 21+ messages in thread
From: Guenter Roeck @ 2025-12-05 17:09 UTC (permalink / raw)
To: Shuah Khan
Cc: Jakub Kicinski, Christian Brauner, Thomas Gleixner, Ingo Molnar,
Eric Dumazet, Kees Cook, linux-kernel, linux-kselftest,
wine-devel, netdev, bpf, Guenter Roeck, Aleksa Sarai
Fix
fclog.c:37:21: warning: call to undeclared function 'open'
fclog.c:37:47: error: use of undeclared identifier 'O_RDONLY'; did you mean 'MS_RDONLY'?
fclog.c:37:56: error: use of undeclared identifier 'O_CLOEXEC'
by including fcntl.h.
Fixes: df579e471111b ("selftests/filesystems: add basic fscontext log tests")
Cc: Aleksa Sarai <cyphar@cyphar.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
v2: Update subject and description to reflect that the patch also fixes
build warnings.
tools/testing/selftests/filesystems/fclog.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/testing/selftests/filesystems/fclog.c b/tools/testing/selftests/filesystems/fclog.c
index 912a8b755c3b..d7cc3aaa8672 100644
--- a/tools/testing/selftests/filesystems/fclog.c
+++ b/tools/testing/selftests/filesystems/fclog.c
@@ -6,6 +6,7 @@
#include <assert.h>
#include <errno.h>
+#include <fcntl.h>
#include <sched.h>
#include <stdio.h>
#include <stdlib.h>
--
2.45.2
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v2 04/13] selftests/filesystems: file_stressor: Fix build warning
2025-12-05 17:09 [PATCH v2 00/13] selftests: Fix build warnings and errors Guenter Roeck
` (2 preceding siblings ...)
2025-12-05 17:09 ` [PATCH v2 03/13] selftests/filesystems: fclog: Fix build warnings and errors Guenter Roeck
@ 2025-12-05 17:09 ` Guenter Roeck
2025-12-05 17:09 ` [PATCH v2 05/13] selftests/filesystems: anon_inode_test: " Guenter Roeck
` (9 subsequent siblings)
13 siblings, 0 replies; 21+ messages in thread
From: Guenter Roeck @ 2025-12-05 17:09 UTC (permalink / raw)
To: Shuah Khan
Cc: Jakub Kicinski, Christian Brauner, Thomas Gleixner, Ingo Molnar,
Eric Dumazet, Kees Cook, linux-kernel, linux-kselftest,
wine-devel, netdev, bpf, Guenter Roeck
Fix
file_stressor.c:112:9: warning: unused variable 'pid_self'
by dropping the unused variable.
Fixes: aab154a442f9b ("selftests: add file SLAB_TYPESAFE_BY_RCU recycling stressor")
Cc: Christian Brauner <brauner@kernel.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
v2: Update subject and description to reflect that the patch fixes a build
warning.
tools/testing/selftests/filesystems/file_stressor.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/tools/testing/selftests/filesystems/file_stressor.c b/tools/testing/selftests/filesystems/file_stressor.c
index 01dd89f8e52f..4f314270298d 100644
--- a/tools/testing/selftests/filesystems/file_stressor.c
+++ b/tools/testing/selftests/filesystems/file_stressor.c
@@ -109,8 +109,6 @@ FIXTURE_TEARDOWN(file_stressor)
TEST_F_TIMEOUT(file_stressor, slab_typesafe_by_rcu, 900 * 2)
{
for (int i = 0; i < self->nr_procs; i++) {
- pid_t pid_self;
-
self->pids_openers[i] = fork();
ASSERT_GE(self->pids_openers[i], 0);
--
2.45.2
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v2 05/13] selftests/filesystems: anon_inode_test: Fix build warning
2025-12-05 17:09 [PATCH v2 00/13] selftests: Fix build warnings and errors Guenter Roeck
` (3 preceding siblings ...)
2025-12-05 17:09 ` [PATCH v2 04/13] selftests/filesystems: file_stressor: Fix build warning Guenter Roeck
@ 2025-12-05 17:09 ` Guenter Roeck
2025-12-05 17:10 ` [PATCH v2 06/13] selftest: af_unix: Support compilers without flex-array-member-not-at-end support Guenter Roeck
` (8 subsequent siblings)
13 siblings, 0 replies; 21+ messages in thread
From: Guenter Roeck @ 2025-12-05 17:09 UTC (permalink / raw)
To: Shuah Khan
Cc: Jakub Kicinski, Christian Brauner, Thomas Gleixner, Ingo Molnar,
Eric Dumazet, Kees Cook, linux-kernel, linux-kselftest,
wine-devel, netdev, bpf, Guenter Roeck
Fix
anon_inode_test.c:45:12: warning: call to undeclared function 'execveat'
by adding the missing include file.
Fixes: f8ca403ae77cb ("selftests/filesystems: add exec() test for anonymous inodes")
Cc: Christian Brauner <brauner@kernel.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
v2: Update subject and description to reflect that the patch fixes a build
warning.
This patch does not fix:
anon_inode_test.c: In function ‘anon_inode_no_exec’:
anon_inode_test.c:46:19: warning: argument 3 null where non-null expected
because I have no idea how to do avoid that warning.
tools/testing/selftests/filesystems/anon_inode_test.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/testing/selftests/filesystems/anon_inode_test.c b/tools/testing/selftests/filesystems/anon_inode_test.c
index 73e0a4d4fb2f..5ddcfd2927f9 100644
--- a/tools/testing/selftests/filesystems/anon_inode_test.c
+++ b/tools/testing/selftests/filesystems/anon_inode_test.c
@@ -4,6 +4,7 @@
#include <fcntl.h>
#include <stdio.h>
+#include <unistd.h>
#include <sys/stat.h>
#include "../kselftest_harness.h"
--
2.45.2
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v2 06/13] selftest: af_unix: Support compilers without flex-array-member-not-at-end support
2025-12-05 17:09 [PATCH v2 00/13] selftests: Fix build warnings and errors Guenter Roeck
` (4 preceding siblings ...)
2025-12-05 17:09 ` [PATCH v2 05/13] selftests/filesystems: anon_inode_test: " Guenter Roeck
@ 2025-12-05 17:10 ` Guenter Roeck
2025-12-05 17:10 ` [PATCH v2 07/13] selftest/futex: Comment out test_futex_mpol Guenter Roeck
` (7 subsequent siblings)
13 siblings, 0 replies; 21+ messages in thread
From: Guenter Roeck @ 2025-12-05 17:10 UTC (permalink / raw)
To: Shuah Khan
Cc: Jakub Kicinski, Christian Brauner, Thomas Gleixner, Ingo Molnar,
Eric Dumazet, Kees Cook, linux-kernel, linux-kselftest,
wine-devel, netdev, bpf, Guenter Roeck, Kuniyuki Iwashima
Fix:
gcc: error: unrecognized command-line option ‘-Wflex-array-member-not-at-end’
by making the compiler option dependent on its support.
Fixes: 1838731f1072c ("selftest: af_unix: Add -Wall and -Wflex-array-member-not-at-end to CFLAGS.")
Cc: Kuniyuki Iwashima <kuniyu@google.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
v2: Just using cc-option is insufficient since it is not defined,
and if it is not defined it just disables the option entirely.
Include Makefile.compiler and declare the function locally
to solve the problem.
tools/testing/selftests/net/af_unix/Makefile | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/net/af_unix/Makefile b/tools/testing/selftests/net/af_unix/Makefile
index 3cd677b72072..4c0375e28bbe 100644
--- a/tools/testing/selftests/net/af_unix/Makefile
+++ b/tools/testing/selftests/net/af_unix/Makefile
@@ -1,4 +1,9 @@
-CFLAGS += $(KHDR_INCLUDES) -Wall -Wflex-array-member-not-at-end
+top_srcdir := ../../../../..
+include $(top_srcdir)/scripts/Makefile.compiler
+
+cc-option = $(call __cc-option, $(CC),,$(1),$(2))
+
+CFLAGS += $(KHDR_INCLUDES) -Wall $(call cc-option,-Wflex-array-member-not-at-end)
TEST_GEN_PROGS := \
diag_uid \
--
2.45.2
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v2 07/13] selftest/futex: Comment out test_futex_mpol
2025-12-05 17:09 [PATCH v2 00/13] selftests: Fix build warnings and errors Guenter Roeck
` (5 preceding siblings ...)
2025-12-05 17:10 ` [PATCH v2 06/13] selftest: af_unix: Support compilers without flex-array-member-not-at-end support Guenter Roeck
@ 2025-12-05 17:10 ` Guenter Roeck
2025-12-05 17:10 ` [PATCH v2 08/13] selftests: net: netlink-dumps: Avoid uninitialized variable warning Guenter Roeck
` (6 subsequent siblings)
13 siblings, 0 replies; 21+ messages in thread
From: Guenter Roeck @ 2025-12-05 17:10 UTC (permalink / raw)
To: Shuah Khan
Cc: Jakub Kicinski, Christian Brauner, Thomas Gleixner, Ingo Molnar,
Eric Dumazet, Kees Cook, linux-kernel, linux-kselftest,
wine-devel, netdev, bpf, Guenter Roeck, André Almeida
test_futex_mpol() is not called, resulting in the following build warning.
futex_numa_mpol.c:134:13: warning: ‘test_futex_mpol’ defined but not used
Disable the function but keep it in case it was supposed to be used.
Fixes: d35ca2f64272 ("selftests/futex: Refactor futex_numa_mpol with kselftest_harness.h")
Cc: André Almeida <andrealmeid@igalia.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
v2: Update subject and description to reflect that the patch fixes a build
warning.
tools/testing/selftests/futex/functional/futex_numa_mpol.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/testing/selftests/futex/functional/futex_numa_mpol.c b/tools/testing/selftests/futex/functional/futex_numa_mpol.c
index d037a3f10ee8..8e3d17d66684 100644
--- a/tools/testing/selftests/futex/functional/futex_numa_mpol.c
+++ b/tools/testing/selftests/futex/functional/futex_numa_mpol.c
@@ -131,10 +131,12 @@ static void test_futex(void *futex_ptr, int err_value)
__test_futex(futex_ptr, err_value, FUTEX2_SIZE_U32 | FUTEX_PRIVATE_FLAG | FUTEX2_NUMA);
}
+#ifdef NOTUSED
static void test_futex_mpol(void *futex_ptr, int err_value)
{
__test_futex(futex_ptr, err_value, FUTEX2_SIZE_U32 | FUTEX_PRIVATE_FLAG | FUTEX2_NUMA | FUTEX2_MPOL);
}
+#endif
TEST(futex_numa_mpol)
{
--
2.45.2
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v2 08/13] selftests: net: netlink-dumps: Avoid uninitialized variable warning
2025-12-05 17:09 [PATCH v2 00/13] selftests: Fix build warnings and errors Guenter Roeck
` (6 preceding siblings ...)
2025-12-05 17:10 ` [PATCH v2 07/13] selftest/futex: Comment out test_futex_mpol Guenter Roeck
@ 2025-12-05 17:10 ` Guenter Roeck
2025-12-10 9:13 ` Jakub Kicinski
2025-12-05 17:10 ` [PATCH v2 09/13] selftests/seccomp: Fix build warning Guenter Roeck
` (5 subsequent siblings)
13 siblings, 1 reply; 21+ messages in thread
From: Guenter Roeck @ 2025-12-05 17:10 UTC (permalink / raw)
To: Shuah Khan
Cc: Jakub Kicinski, Christian Brauner, Thomas Gleixner, Ingo Molnar,
Eric Dumazet, Kees Cook, linux-kernel, linux-kselftest,
wine-devel, netdev, bpf, Guenter Roeck
The following warning is seen when building netlink-dumps.
netlink-dumps.c: In function ‘dump_extack’:
../kselftest_harness.h:788:35: warning: ‘ret’ may be used uninitialized
Problem is that the loop which initializes 'ret' may exit early without
initializing the variable if recv() returns an error. Always initialize
'ret' to solve the problem.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
v2: Update subject and description to reflect that the patch fixes a build
warning.
tools/testing/selftests/net/netlink-dumps.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/net/netlink-dumps.c b/tools/testing/selftests/net/netlink-dumps.c
index 679b6c77ace7..67bf3fc2d66b 100644
--- a/tools/testing/selftests/net/netlink-dumps.c
+++ b/tools/testing/selftests/net/netlink-dumps.c
@@ -112,7 +112,7 @@ static const struct {
TEST(dump_extack)
{
int netlink_sock;
- int i, cnt, ret;
+ int i, cnt, ret = FOUND_ERR;
char buf[8192];
int one = 1;
ssize_t n;
--
2.45.2
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v2 09/13] selftests/seccomp: Fix build warning
2025-12-05 17:09 [PATCH v2 00/13] selftests: Fix build warnings and errors Guenter Roeck
` (7 preceding siblings ...)
2025-12-05 17:10 ` [PATCH v2 08/13] selftests: net: netlink-dumps: Avoid uninitialized variable warning Guenter Roeck
@ 2025-12-05 17:10 ` Guenter Roeck
2025-12-05 22:21 ` Kees Cook
2025-12-05 17:10 ` [PATCH v2 10/13] selftests: net: Fix build warnings Guenter Roeck
` (4 subsequent siblings)
13 siblings, 1 reply; 21+ messages in thread
From: Guenter Roeck @ 2025-12-05 17:10 UTC (permalink / raw)
To: Shuah Khan
Cc: Jakub Kicinski, Christian Brauner, Thomas Gleixner, Ingo Molnar,
Eric Dumazet, Kees Cook, linux-kernel, linux-kselftest,
wine-devel, netdev, bpf, Guenter Roeck, Jiri Olsa, Peter Zijlstra
Fix:
seccomp_bpf.c: In function ‘UPROBE_setup’:
seccomp_bpf.c:5175:74: warning: pointer type mismatch in conditional expression
by type casting the argument to get_uprobe_offset().
Fixes: 9ffc7a635c35a ("selftests/seccomp: validate uprobe syscall passes through seccomp")
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
v2: Update subject and description to reflect that the patch fixes a build
warning.
tools/testing/selftests/seccomp/seccomp_bpf.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/seccomp/seccomp_bpf.c b/tools/testing/selftests/seccomp/seccomp_bpf.c
index 874f17763536..2584f4f5c062 100644
--- a/tools/testing/selftests/seccomp/seccomp_bpf.c
+++ b/tools/testing/selftests/seccomp/seccomp_bpf.c
@@ -5172,7 +5172,8 @@ FIXTURE_SETUP(UPROBE)
ASSERT_GE(bit, 0);
}
- offset = get_uprobe_offset(variant->uretprobe ? probed_uretprobe : probed_uprobe);
+ offset = get_uprobe_offset(variant->uretprobe ?
+ (void *)probed_uretprobe : (void *)probed_uprobe);
ASSERT_GE(offset, 0);
if (variant->uretprobe)
--
2.45.2
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v2 10/13] selftests: net: Fix build warnings
2025-12-05 17:09 [PATCH v2 00/13] selftests: Fix build warnings and errors Guenter Roeck
` (8 preceding siblings ...)
2025-12-05 17:10 ` [PATCH v2 09/13] selftests/seccomp: Fix build warning Guenter Roeck
@ 2025-12-05 17:10 ` Guenter Roeck
2025-12-05 17:10 ` [PATCH v2 11/13] selftests/fs/mount-notify: Fix build warning Guenter Roeck
` (3 subsequent siblings)
13 siblings, 0 replies; 21+ messages in thread
From: Guenter Roeck @ 2025-12-05 17:10 UTC (permalink / raw)
To: Shuah Khan
Cc: Jakub Kicinski, Christian Brauner, Thomas Gleixner, Ingo Molnar,
Eric Dumazet, Kees Cook, linux-kernel, linux-kselftest,
wine-devel, netdev, bpf, Guenter Roeck, Joe Damato
Fix
ksft.h: In function ‘ksft_ready’:
ksft.h:27:9: warning: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’
ksft.h: In function ‘ksft_wait’:
ksft.h:51:9: warning: ignoring return value of ‘read’ declared with attribute ‘warn_unused_result’
by checking the return value of the affected functions and displaying
an error message if an error is seen.
Fixes: 2b6d490b82668 ("selftests: drv-net: Factor out ksft C helpers")
Cc: Joe Damato <jdamato@fastly.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
v2: Update subject and description to reflect that the patch fixes build
warnings.
Use perror() to display an error message if one of the functions
returns an error.
tools/testing/selftests/net/lib/ksft.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/net/lib/ksft.h b/tools/testing/selftests/net/lib/ksft.h
index 17dc34a612c6..03912902a6d3 100644
--- a/tools/testing/selftests/net/lib/ksft.h
+++ b/tools/testing/selftests/net/lib/ksft.h
@@ -24,7 +24,8 @@ static inline void ksft_ready(void)
fd = STDOUT_FILENO;
}
- write(fd, msg, sizeof(msg));
+ if (write(fd, msg, sizeof(msg)) < 0)
+ perror("write()");
if (fd != STDOUT_FILENO)
close(fd);
}
@@ -48,7 +49,8 @@ static inline void ksft_wait(void)
fd = STDIN_FILENO;
}
- read(fd, &byte, sizeof(byte));
+ if (read(fd, &byte, sizeof(byte)) < 0)
+ perror("read()");
if (fd != STDIN_FILENO)
close(fd);
}
--
2.45.2
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v2 11/13] selftests/fs/mount-notify: Fix build warning
2025-12-05 17:09 [PATCH v2 00/13] selftests: Fix build warnings and errors Guenter Roeck
` (9 preceding siblings ...)
2025-12-05 17:10 ` [PATCH v2 10/13] selftests: net: Fix build warnings Guenter Roeck
@ 2025-12-05 17:10 ` Guenter Roeck
2025-12-05 17:10 ` [PATCH v2 12/13] selftests/fs/mount-notify-ns: " Guenter Roeck
` (2 subsequent siblings)
13 siblings, 0 replies; 21+ messages in thread
From: Guenter Roeck @ 2025-12-05 17:10 UTC (permalink / raw)
To: Shuah Khan
Cc: Jakub Kicinski, Christian Brauner, Thomas Gleixner, Ingo Molnar,
Eric Dumazet, Kees Cook, linux-kernel, linux-kselftest,
wine-devel, netdev, bpf, Guenter Roeck, Miklos Szeredi
Fix
mount-notify_test.c: In function ‘fanotify_rmdir’:
mount-notify_test.c:467:17: warning:
ignoring return value of ‘chdir’ declared with attribute ‘warn_unused_result’
by checking the return value of chdir() and displaying an error message
if an error is reported.
Fixes: e1c24b52adb22 ("selftests: add tests for mount notification")
Cc: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
v2: Update subject and description to reflect that the patch fixes a build
warning.
Use perror() to display an error message if chdir() returns an error.
.../selftests/filesystems/mount-notify/mount-notify_test.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/filesystems/mount-notify/mount-notify_test.c b/tools/testing/selftests/filesystems/mount-notify/mount-notify_test.c
index e4b7c2b457ee..5c929275e689 100644
--- a/tools/testing/selftests/filesystems/mount-notify/mount-notify_test.c
+++ b/tools/testing/selftests/filesystems/mount-notify/mount-notify_test.c
@@ -464,7 +464,8 @@ TEST_F(fanotify, rmdir)
ASSERT_GE(ret, 0);
if (ret == 0) {
- chdir("/");
+ if (chdir("/"))
+ perror("chdir()");
unshare(CLONE_NEWNS);
mount("", "/", NULL, MS_REC|MS_PRIVATE, NULL);
umount2("/a", MNT_DETACH);
--
2.45.2
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v2 12/13] selftests/fs/mount-notify-ns: Fix build warning
2025-12-05 17:09 [PATCH v2 00/13] selftests: Fix build warnings and errors Guenter Roeck
` (10 preceding siblings ...)
2025-12-05 17:10 ` [PATCH v2 11/13] selftests/fs/mount-notify: Fix build warning Guenter Roeck
@ 2025-12-05 17:10 ` Guenter Roeck
2025-12-05 17:31 ` Amir Goldstein
2025-12-05 17:10 ` [PATCH v2 13/13] selftests: net: tfo: " Guenter Roeck
2025-12-10 9:20 ` [PATCH v2 00/13] selftests: Fix build warnings and errors patchwork-bot+netdevbpf
13 siblings, 1 reply; 21+ messages in thread
From: Guenter Roeck @ 2025-12-05 17:10 UTC (permalink / raw)
To: Shuah Khan
Cc: Jakub Kicinski, Christian Brauner, Thomas Gleixner, Ingo Molnar,
Eric Dumazet, Kees Cook, linux-kernel, linux-kselftest,
wine-devel, netdev, bpf, Guenter Roeck, Amir Goldstein
Fix
mount-notify_test_ns.c: In function ‘fanotify_rmdir’:
mount-notify_test_ns.c:494:17: warning:
ignoring return value of ‘chdir’ declared with attribute ‘warn_unused_result’
by checking the return value of chdir() and displaying an error message
if it returns an error.
Fixes: 781091f3f5945 ("selftests/fs/mount-notify: add a test variant running inside userns")
Cc: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
v2: Update subject and description to reflect that the patch fixes a build
warning.
Use perror() to display an error message if chdir() returns an error.
.../selftests/filesystems/mount-notify/mount-notify_test_ns.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/filesystems/mount-notify/mount-notify_test_ns.c b/tools/testing/selftests/filesystems/mount-notify/mount-notify_test_ns.c
index 9f57ca46e3af..90bec6faf64e 100644
--- a/tools/testing/selftests/filesystems/mount-notify/mount-notify_test_ns.c
+++ b/tools/testing/selftests/filesystems/mount-notify/mount-notify_test_ns.c
@@ -491,7 +491,8 @@ TEST_F(fanotify, rmdir)
ASSERT_GE(ret, 0);
if (ret == 0) {
- chdir("/");
+ if (chdir("/"))
+ perror("chdir()");
unshare(CLONE_NEWNS);
mount("", "/", NULL, MS_REC|MS_PRIVATE, NULL);
umount2("/a", MNT_DETACH);
--
2.45.2
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v2 13/13] selftests: net: tfo: Fix build warning
2025-12-05 17:09 [PATCH v2 00/13] selftests: Fix build warnings and errors Guenter Roeck
` (11 preceding siblings ...)
2025-12-05 17:10 ` [PATCH v2 12/13] selftests/fs/mount-notify-ns: " Guenter Roeck
@ 2025-12-05 17:10 ` Guenter Roeck
2025-12-10 9:20 ` [PATCH v2 00/13] selftests: Fix build warnings and errors patchwork-bot+netdevbpf
13 siblings, 0 replies; 21+ messages in thread
From: Guenter Roeck @ 2025-12-05 17:10 UTC (permalink / raw)
To: Shuah Khan
Cc: Jakub Kicinski, Christian Brauner, Thomas Gleixner, Ingo Molnar,
Eric Dumazet, Kees Cook, linux-kernel, linux-kselftest,
wine-devel, netdev, bpf, Guenter Roeck, David Wei
Fix
tfo.c: In function ‘run_server’:
tfo.c:84:9: warning: ignoring return value of ‘read’ declared with attribute ‘warn_unused_result’
by evaluating the return value from read() and displaying an error message
if it reports an error.
Fixes: c65b5bb2329e3 ("selftests: net: add passive TFO test binary")
Cc: David Wei <dw@davidwei.uk>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
v2: Update subject and description to reflect that the patch fixes a build
warning.
Use perror() to display an error message if read() returns an error.
tools/testing/selftests/net/tfo.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/net/tfo.c b/tools/testing/selftests/net/tfo.c
index eb3cac5e583c..8d82140f0f76 100644
--- a/tools/testing/selftests/net/tfo.c
+++ b/tools/testing/selftests/net/tfo.c
@@ -81,7 +81,8 @@ static void run_server(void)
if (getsockopt(connfd, SOL_SOCKET, SO_INCOMING_NAPI_ID, &opt, &len) < 0)
error(1, errno, "getsockopt(SO_INCOMING_NAPI_ID)");
- read(connfd, buf, 64);
+ if (read(connfd, buf, 64) < 0)
+ perror("read()");
fprintf(outfile, "%d\n", opt);
fclose(outfile);
--
2.45.2
^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [PATCH v2 12/13] selftests/fs/mount-notify-ns: Fix build warning
2025-12-05 17:10 ` [PATCH v2 12/13] selftests/fs/mount-notify-ns: " Guenter Roeck
@ 2025-12-05 17:31 ` Amir Goldstein
2025-12-05 18:26 ` Guenter Roeck
0 siblings, 1 reply; 21+ messages in thread
From: Amir Goldstein @ 2025-12-05 17:31 UTC (permalink / raw)
To: Guenter Roeck
Cc: Shuah Khan, Jakub Kicinski, Christian Brauner, Thomas Gleixner,
Ingo Molnar, Eric Dumazet, Kees Cook, linux-kernel,
linux-kselftest, wine-devel, netdev, bpf
On Fri, Dec 5, 2025 at 6:12 PM Guenter Roeck <linux@roeck-us.net> wrote:
>
> Fix
>
> mount-notify_test_ns.c: In function ‘fanotify_rmdir’:
> mount-notify_test_ns.c:494:17: warning:
> ignoring return value of ‘chdir’ declared with attribute ‘warn_unused_result’
>
> by checking the return value of chdir() and displaying an error message
> if it returns an error.
>
> Fixes: 781091f3f5945 ("selftests/fs/mount-notify: add a test variant running inside userns")
> Cc: Amir Goldstein <amir73il@gmail.com>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
> v2: Update subject and description to reflect that the patch fixes a build
> warning.
> Use perror() to display an error message if chdir() returns an error.
>
> .../selftests/filesystems/mount-notify/mount-notify_test_ns.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/filesystems/mount-notify/mount-notify_test_ns.c b/tools/testing/selftests/filesystems/mount-notify/mount-notify_test_ns.c
> index 9f57ca46e3af..90bec6faf64e 100644
> --- a/tools/testing/selftests/filesystems/mount-notify/mount-notify_test_ns.c
> +++ b/tools/testing/selftests/filesystems/mount-notify/mount-notify_test_ns.c
> @@ -491,7 +491,8 @@ TEST_F(fanotify, rmdir)
> ASSERT_GE(ret, 0);
>
> if (ret == 0) {
> - chdir("/");
> + if (chdir("/"))
> + perror("chdir()");
ASSERT_EQ(0, chdir("/"));
and there is another one like this in mount-notify_test.c
Thanks,
Amir.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 12/13] selftests/fs/mount-notify-ns: Fix build warning
2025-12-05 17:31 ` Amir Goldstein
@ 2025-12-05 18:26 ` Guenter Roeck
0 siblings, 0 replies; 21+ messages in thread
From: Guenter Roeck @ 2025-12-05 18:26 UTC (permalink / raw)
To: Amir Goldstein
Cc: Shuah Khan, Jakub Kicinski, Christian Brauner, Thomas Gleixner,
Ingo Molnar, Eric Dumazet, Kees Cook, linux-kernel,
linux-kselftest, wine-devel, netdev, bpf
On 12/5/25 09:31, Amir Goldstein wrote:
> On Fri, Dec 5, 2025 at 6:12 PM Guenter Roeck <linux@roeck-us.net> wrote:
>>
>> Fix
>>
>> mount-notify_test_ns.c: In function ‘fanotify_rmdir’:
>> mount-notify_test_ns.c:494:17: warning:
>> ignoring return value of ‘chdir’ declared with attribute ‘warn_unused_result’
>>
>> by checking the return value of chdir() and displaying an error message
>> if it returns an error.
>>
>> Fixes: 781091f3f5945 ("selftests/fs/mount-notify: add a test variant running inside userns")
>> Cc: Amir Goldstein <amir73il@gmail.com>
>> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
>> ---
>> v2: Update subject and description to reflect that the patch fixes a build
>> warning.
>> Use perror() to display an error message if chdir() returns an error.
>>
>> .../selftests/filesystems/mount-notify/mount-notify_test_ns.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/tools/testing/selftests/filesystems/mount-notify/mount-notify_test_ns.c b/tools/testing/selftests/filesystems/mount-notify/mount-notify_test_ns.c
>> index 9f57ca46e3af..90bec6faf64e 100644
>> --- a/tools/testing/selftests/filesystems/mount-notify/mount-notify_test_ns.c
>> +++ b/tools/testing/selftests/filesystems/mount-notify/mount-notify_test_ns.c
>> @@ -491,7 +491,8 @@ TEST_F(fanotify, rmdir)
>> ASSERT_GE(ret, 0);
>>
>> if (ret == 0) {
>> - chdir("/");
>> + if (chdir("/"))
>> + perror("chdir()");
>
> ASSERT_EQ(0, chdir("/"));
>
> and there is another one like this in mount-notify_test.c
>
Done.
Thanks,
Guenter
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 09/13] selftests/seccomp: Fix build warning
2025-12-05 17:10 ` [PATCH v2 09/13] selftests/seccomp: Fix build warning Guenter Roeck
@ 2025-12-05 22:21 ` Kees Cook
0 siblings, 0 replies; 21+ messages in thread
From: Kees Cook @ 2025-12-05 22:21 UTC (permalink / raw)
To: Guenter Roeck
Cc: Shuah Khan, Jakub Kicinski, Christian Brauner, Thomas Gleixner,
Ingo Molnar, Eric Dumazet, linux-kernel, linux-kselftest,
wine-devel, netdev, bpf, Jiri Olsa, Peter Zijlstra
On Fri, Dec 05, 2025 at 09:10:03AM -0800, Guenter Roeck wrote:
> Fix:
>
> seccomp_bpf.c: In function ‘UPROBE_setup’:
> seccomp_bpf.c:5175:74: warning: pointer type mismatch in conditional expression
>
> by type casting the argument to get_uprobe_offset().
>
> Fixes: 9ffc7a635c35a ("selftests/seccomp: validate uprobe syscall passes through seccomp")
> Cc: Jiri Olsa <jolsa@kernel.org>
> Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Kees Cook <kees@kernel.org>
--
Kees Cook
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 02/13] selftests: ntsync: Fix build warnings
2025-12-05 17:09 ` [PATCH v2 02/13] selftests: ntsync: " Guenter Roeck
@ 2025-12-08 19:27 ` Elizabeth Figura
0 siblings, 0 replies; 21+ messages in thread
From: Elizabeth Figura @ 2025-12-08 19:27 UTC (permalink / raw)
To: Shuah Khan, Guenter Roeck
Cc: Jakub Kicinski, Christian Brauner, Thomas Gleixner, Ingo Molnar,
Eric Dumazet, Kees Cook, linux-kernel, linux-kselftest,
wine-devel, netdev, bpf, Guenter Roeck
On Friday, 5 December 2025 11:09:56 CST Guenter Roeck wrote:
> Fix
>
> ntsync.c:1286:20: warning: call to undeclared function 'gettid';
> ISO C99 and later do not support implicit function declarations
> 1286 | wait_args.owner = gettid();
> | ^
> ntsync.c:1280:8: warning: unused variable 'index'
> 1280 | __u32 index, count, i;
> | ^~~~~
> ntsync.c:1281:6: warning: unused variable 'ret'
> 1281 | int ret;
>
> by adding the missing include file and removing the unused variables.
>
> Fixes: a22860e57b54 ("selftests: ntsync: Add a stress test for contended waits.")
> Cc: Elizabeth Figura <zfigura@codeweavers.com>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
> v2: Update subject and description to reflect that the patch fixes build
> warnings
>
> tools/testing/selftests/drivers/ntsync/ntsync.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/testing/selftests/drivers/ntsync/ntsync.c b/tools/testing/selftests/drivers/ntsync/ntsync.c
> index 3aad311574c4..d3df94047e4d 100644
> --- a/tools/testing/selftests/drivers/ntsync/ntsync.c
> +++ b/tools/testing/selftests/drivers/ntsync/ntsync.c
> @@ -11,6 +11,7 @@
> #include <fcntl.h>
> #include <time.h>
> #include <pthread.h>
> +#include <unistd.h>
> #include <linux/ntsync.h>
> #include "../../kselftest_harness.h"
>
> @@ -1277,8 +1278,7 @@ static int stress_device, stress_start_event, stress_mutex;
> static void *stress_thread(void *arg)
> {
> struct ntsync_wait_args wait_args = {0};
> - __u32 index, count, i;
> - int ret;
> + __u32 count, i;
>
> wait_args.timeout = UINT64_MAX;
> wait_args.count = 1;
>
LGTM.
Reviewed-by: Elizabeth Figura <zfigura@codeweavers.com>
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 08/13] selftests: net: netlink-dumps: Avoid uninitialized variable warning
2025-12-05 17:10 ` [PATCH v2 08/13] selftests: net: netlink-dumps: Avoid uninitialized variable warning Guenter Roeck
@ 2025-12-10 9:13 ` Jakub Kicinski
2025-12-10 19:09 ` Guenter Roeck
0 siblings, 1 reply; 21+ messages in thread
From: Jakub Kicinski @ 2025-12-10 9:13 UTC (permalink / raw)
To: Guenter Roeck
Cc: Shuah Khan, Christian Brauner, Thomas Gleixner, Ingo Molnar,
Eric Dumazet, Kees Cook, linux-kernel, linux-kselftest,
wine-devel, netdev, bpf
On Fri, 5 Dec 2025 09:10:02 -0800 Guenter Roeck wrote:
> The following warning is seen when building netlink-dumps.
>
> netlink-dumps.c: In function ‘dump_extack’:
> ../kselftest_harness.h:788:35: warning: ‘ret’ may be used uninitialized
>
> Problem is that the loop which initializes 'ret' may exit early without
> initializing the variable if recv() returns an error. Always initialize
> 'ret' to solve the problem.
Are you sure you're working off the latest tree? I think this should
already be fixed by 13cb6ac5b50
I applied the other 3 networking changes.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 00/13] selftests: Fix build warnings and errors
2025-12-05 17:09 [PATCH v2 00/13] selftests: Fix build warnings and errors Guenter Roeck
` (12 preceding siblings ...)
2025-12-05 17:10 ` [PATCH v2 13/13] selftests: net: tfo: " Guenter Roeck
@ 2025-12-10 9:20 ` patchwork-bot+netdevbpf
13 siblings, 0 replies; 21+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-12-10 9:20 UTC (permalink / raw)
To: Guenter Roeck
Cc: shuah, kuba, brauner, tglx, mingo, edumazet, kees, linux-kernel,
linux-kselftest, wine-devel, netdev, bpf
Hello:
This series was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Fri, 5 Dec 2025 09:09:54 -0800 you wrote:
> This series fixes build warnings and errors observed when trying to build
> selftests.
>
> v2: Emphasize that the patch series fixes build warnings and errors
> which are seen even if -Werror is not provided.
> Fix usage of cc-option.
> For "ignoring return value" warnings, use perror() to display an error
> message if the affected function returns an error.
>
> [...]
Here is the summary with links:
- [v2,01/13] clone3: clone3_cap_checkpoint_restore: Fix build warnings
(no matching commit)
- [v2,02/13] selftests: ntsync: Fix build warnings
(no matching commit)
- [v2,03/13] selftests/filesystems: fclog: Fix build warnings and errors
(no matching commit)
- [v2,04/13] selftests/filesystems: file_stressor: Fix build warning
(no matching commit)
- [v2,05/13] selftests/filesystems: anon_inode_test: Fix build warning
(no matching commit)
- [v2,06/13] selftest: af_unix: Support compilers without flex-array-member-not-at-end support
https://git.kernel.org/netdev/net/c/06f7cae92fe3
- [v2,07/13] selftest/futex: Comment out test_futex_mpol
(no matching commit)
- [v2,08/13] selftests: net: netlink-dumps: Avoid uninitialized variable warning
(no matching commit)
- [v2,09/13] selftests/seccomp: Fix build warning
(no matching commit)
- [v2,10/13] selftests: net: Fix build warnings
https://git.kernel.org/netdev/net/c/59546e874403
- [v2,11/13] selftests/fs/mount-notify: Fix build warning
(no matching commit)
- [v2,12/13] selftests/fs/mount-notify-ns: Fix build warning
(no matching commit)
- [v2,13/13] selftests: net: tfo: Fix build warning
https://git.kernel.org/netdev/net/c/91dc09a609d9
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] 21+ messages in thread
* Re: [PATCH v2 08/13] selftests: net: netlink-dumps: Avoid uninitialized variable warning
2025-12-10 9:13 ` Jakub Kicinski
@ 2025-12-10 19:09 ` Guenter Roeck
0 siblings, 0 replies; 21+ messages in thread
From: Guenter Roeck @ 2025-12-10 19:09 UTC (permalink / raw)
To: Jakub Kicinski
Cc: Shuah Khan, Christian Brauner, Thomas Gleixner, Ingo Molnar,
Eric Dumazet, Kees Cook, linux-kernel, linux-kselftest,
wine-devel, netdev, bpf
On 12/10/25 01:13, Jakub Kicinski wrote:
> On Fri, 5 Dec 2025 09:10:02 -0800 Guenter Roeck wrote:
>> The following warning is seen when building netlink-dumps.
>>
>> netlink-dumps.c: In function ‘dump_extack’:
>> ../kselftest_harness.h:788:35: warning: ‘ret’ may be used uninitialized
>>
>> Problem is that the loop which initializes 'ret' may exit early without
>> initializing the variable if recv() returns an error. Always initialize
>> 'ret' to solve the problem.
>
> Are you sure you're working off the latest tree? I think this should
> already be fixed by 13cb6ac5b50
>
Sorry for missing the fix. I was working off v6.18, which was the tip of
the tree when I wrote the patch.
> I applied the other 3 networking changes.
Thanks a lot!
Guenter
^ permalink raw reply [flat|nested] 21+ messages in thread
end of thread, other threads:[~2025-12-10 19:09 UTC | newest]
Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-05 17:09 [PATCH v2 00/13] selftests: Fix build warnings and errors Guenter Roeck
2025-12-05 17:09 ` [PATCH v2 01/13] clone3: clone3_cap_checkpoint_restore: Fix build warnings Guenter Roeck
2025-12-05 17:09 ` [PATCH v2 02/13] selftests: ntsync: " Guenter Roeck
2025-12-08 19:27 ` Elizabeth Figura
2025-12-05 17:09 ` [PATCH v2 03/13] selftests/filesystems: fclog: Fix build warnings and errors Guenter Roeck
2025-12-05 17:09 ` [PATCH v2 04/13] selftests/filesystems: file_stressor: Fix build warning Guenter Roeck
2025-12-05 17:09 ` [PATCH v2 05/13] selftests/filesystems: anon_inode_test: " Guenter Roeck
2025-12-05 17:10 ` [PATCH v2 06/13] selftest: af_unix: Support compilers without flex-array-member-not-at-end support Guenter Roeck
2025-12-05 17:10 ` [PATCH v2 07/13] selftest/futex: Comment out test_futex_mpol Guenter Roeck
2025-12-05 17:10 ` [PATCH v2 08/13] selftests: net: netlink-dumps: Avoid uninitialized variable warning Guenter Roeck
2025-12-10 9:13 ` Jakub Kicinski
2025-12-10 19:09 ` Guenter Roeck
2025-12-05 17:10 ` [PATCH v2 09/13] selftests/seccomp: Fix build warning Guenter Roeck
2025-12-05 22:21 ` Kees Cook
2025-12-05 17:10 ` [PATCH v2 10/13] selftests: net: Fix build warnings Guenter Roeck
2025-12-05 17:10 ` [PATCH v2 11/13] selftests/fs/mount-notify: Fix build warning Guenter Roeck
2025-12-05 17:10 ` [PATCH v2 12/13] selftests/fs/mount-notify-ns: " Guenter Roeck
2025-12-05 17:31 ` Amir Goldstein
2025-12-05 18:26 ` Guenter Roeck
2025-12-05 17:10 ` [PATCH v2 13/13] selftests: net: tfo: " Guenter Roeck
2025-12-10 9:20 ` [PATCH v2 00/13] selftests: Fix build warnings and errors 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;
as well as URLs for NNTP newsgroup(s).