Skip to content

Commit 0ca2c53

Browse files
xzpeterakpm00
authored andcommitted
selftests/vm: remove __USE_GNU in hugetlb-madvise.c
__USE_GNU should be an internal macro only used inside glibc. Either memfd_create() or fallocate() requires _GNU_SOURCE per man page, where __USE_GNU will further be defined by glibc headers include/features.h: #ifdef _GNU_SOURCE # define __USE_GNU 1 #endif This fixes: >> hugetlb-madvise.c:20: warning: "__USE_GNU" redefined 20 | #define __USE_GNU | In file included from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33, from /usr/include/stdlib.h:26, from hugetlb-madvise.c:16: /usr/include/features.h:407: note: this is the location of the previous definition 407 | # define __USE_GNU 1 | Link: https://lkml.kernel.org/r/Y8V9z+z6Tk7NetI3@x1n Signed-off-by: Peter Xu <[email protected]> Reported-by: kernel test robot <[email protected]> Cc: Mike Kravetz <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 7e3ce3f commit 0ca2c53

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

tools/testing/selftests/vm/hugetlb-madvise.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include <stdio.h>
1818
#include <unistd.h>
1919
#include <sys/mman.h>
20-
#define __USE_GNU
2120
#include <fcntl.h>
2221

2322
#define MIN_FREE_PAGES 20

0 commit comments

Comments
 (0)