On 10/18/20 12:03 PM, Matthew Wilcox wrote:
On Sun, Oct 18, 2020 at 11:50:10AM -0700, John Hubbard wrote:
On 10/18/20 9:18 AM, Linus Torvalds wrote:
On Sat, Oct 17, 2020 at 4:14 PM Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:
--- a/mm/gup_test.c~selftests-vm-use-a-common-gup_testh
+++ a/mm/gup_test.c
@@ -4,22 +4,7 @@
+#include "../../../../mm/gup_test.h"
+++ a/mm/gup_test.h
There is no way I'm applying a crazy patch like this.
That can't be right.
And even if it works, it *still* isn't right.
Linus
I feel the same way about the ridiculous ../..'s in the include path. But that
seemed to be the accepted way (I even have an email that I'm trying to find, in
which someone confirmed that...ah here, it is [1], and I'm adding Jason to CC)
for the odd situation of sharing a header file between kernel and user space,
for the kselftest world.
If there's a different acceptable way, I'd be delighted to use that.
See where it says:
CFLAGS = -Wall -I ../../../../usr/include $(EXTRA_CFLAGS)
Does adding an extra -I../../../../mm to that line not do the trick?
Yes, that works. Here's a differential patch on top of the series to change it
over:
diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile
index a9332a7cf33f..350d37c21671 100644
--- a/tools/testing/selftests/vm/Makefile
+++ b/tools/testing/selftests/vm/Makefile
@@ -23,7 +23,7 @@ MACHINE ?= $(shell echo $(uname_M) | sed -e 's/aarch64.*/arm64/')
# LDLIBS.
MAKEFLAGS += --no-builtin-rules
-CFLAGS = -Wall -I ../../../../usr/include $(EXTRA_CFLAGS)
+CFLAGS = -Wall -I ../../../../usr/include -I ../../../../mm $(EXTRA_CFLAGS)
LDLIBS = -lrt -lpthread
TEST_GEN_FILES = compaction_test
TEST_GEN_FILES += gup_test
diff --git a/tools/testing/selftests/vm/gup_test.c b/tools/testing/selftests/vm/gup_test.c
index 1bef28174f3f..a8adda6edb07 100644
--- a/tools/testing/selftests/vm/gup_test.c
+++ b/tools/testing/selftests/vm/gup_test.c
@@ -6,7 +6,7 @@
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>
-#include "../../../../mm/gup_test.h"
+#include "gup_test.h"
#define MB (1UL << 20)
#define PAGE_SIZE sysconf(_SC_PAGESIZE)
thanks,
--
John Hubbard
NVIDIA