]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
selftests/memfd: Fix implicit declaration warnings
authorMichael Ellerman <mpe@ellerman.id.au>
Wed, 4 Nov 2020 10:03:05 +0000 (21:03 +1100)
committerShuah Khan <skhan@linuxfoundation.org>
Tue, 10 Nov 2020 21:42:04 +0000 (14:42 -0700)
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.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/memfd/fuse_test.c
tools/testing/selftests/memfd/memfd_test.c

index b018e835737df55d2599dbe62f7b670fd7ec3458..be675002f918a0888d61c4196e06718d908a0ec2 100644 (file)
@@ -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>
index 334a7eea200428b07d8964555783f9959d028aa0..74baab83fec356b2caae8b0b1c6770a40e54c751 100644 (file)
@@ -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>