Skip to contentSkip to conversation

selftests/memfd: Fix implicit declaration warnings

PATCH New Michael Ellerman 1 participant 1 message Nov 4, 2020 Kselftest

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests/memfd: Fix implicit declaration warnings

The memfd tests emit several warnings:

fuse_test.c:261:7: warning: implicit declaration of function 'open' fuse_test.c:67:6: warning: implicit declaration of function 'fcntl' memfd_test.c:397:6: warning: implicit declaration of function 'fallocate' memfd_test.c:64:7: warning: implicit declaration of function 'open' memfd_test.c:90:6: warning: implicit declaration of function 'fcntl'

These are all caused by the test not including fcntl.h.

Instead of including linux/fcntl.h, include fcntl.h, which should eventually cause the former to be included as well.

---
 tools/testing/selftests/memfd/fuse_test.c  | 2 +-
 tools/testing/selftests/memfd/memfd_test.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
tools/testing/selftests/memfd/fuse_test.c +1 -1
index b018e835737d..be675002f918 100644
@@ -20,7 +20,7 @@
 #include <inttypes.h>
 #include <limits.h>
 #include <linux/falloc.h>
-#include <linux/fcntl.h>
+#include <fcntl.h>
 #include <linux/memfd.h>
 #include <sched.h>
 #include <stdio.h>
tools/testing/selftests/memfd/memfd_test.c +1 -1
index 334a7eea2004..74baab83fec3 100644
@@ -6,7 +6,7 @@
 #include <inttypes.h>
 #include <limits.h>
 #include <linux/falloc.h>
-#include <linux/fcntl.h>
+#include <fcntl.h>
 #include <linux/memfd.h>
 #include <sched.h>
 #include <stdio.h>

base-commit: cf7cd542d1b538f6e9e83490bc090dd773f4266d

Signature · 1 line
2.25.1