[PATCH 1/1] selftests: Clear -Wimplicit-function-declaration warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Seen while compiling tests,

```
$ make -C tools/testing/selftests/ TARGET=bpf 2>&1 | grep implicit

pidfd_fdinfo_test.c:230:13: warning: implicit declaration of function ‘mount’ [-Wimplicit-function-declaration]
pidfd_fdinfo_test.c:236:15: warning: implicit declaration of function ‘umount2’; did you mean ‘SYS_umount2’? [-Wimplicit-function-declaration]
pid_max.c:42:15: warning: implicit declaration of function ‘mount’ [-Wimplicit-function-declaration]
pid_max.c:48:9: warning: implicit declaration of function ‘umount2’; did you mean ‘SYS_umount2’? [-Wimplicit-function-declaration]
```

Adding sys/mount in the header clears out the warnings

```
$ make -C tools/testing/selftests/ TARGET=bpf 2>&1 | grep implicit; echo $?
1
```

Reported-by: kernel test robot <lkp@xxxxxxxxx>
Closes: https://lore.kernel.org/oe-kbuild-all/202412222015.lMBH62zB-lkp@xxxxxxxxx/
Cc: Christian Brauner <brauner@xxxxxxxxxx>
Cs: Shuah Khan <shuah@xxxxxxxxxx>
Signed-off-by: Ariel Otilibili <ariel.otilibili-anieli@xxxxxxxxxx>
---
 tools/testing/selftests/pid_namespace/pid_max.c   | 1 +
 tools/testing/selftests/pidfd/pidfd_fdinfo_test.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/tools/testing/selftests/pid_namespace/pid_max.c b/tools/testing/selftests/pid_namespace/pid_max.c
index 51c414faabb0..96f274f0582b 100644
--- a/tools/testing/selftests/pid_namespace/pid_max.c
+++ b/tools/testing/selftests/pid_namespace/pid_max.c
@@ -10,6 +10,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <syscall.h>
+#include <sys/mount.h>
 #include <sys/wait.h>
 
 #include "../kselftest_harness.h"
diff --git a/tools/testing/selftests/pidfd/pidfd_fdinfo_test.c b/tools/testing/selftests/pidfd/pidfd_fdinfo_test.c
index f062a986e382..f718aac75068 100644
--- a/tools/testing/selftests/pidfd/pidfd_fdinfo_test.c
+++ b/tools/testing/selftests/pidfd/pidfd_fdinfo_test.c
@@ -13,6 +13,7 @@
 #include <syscall.h>
 #include <sys/wait.h>
 #include <sys/mman.h>
+#include <sys/mount.h>
 
 #include "pidfd.h"
 #include "../kselftest.h"
-- 
2.43.0





[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux