diff options
author | Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | 2015-09-22 17:59:20 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-09-22 18:09:53 -0400 |
commit | 7a07b503bf249986a1eeef0351d66cac0d8bf721 (patch) | |
tree | 681226849c4c55f9b8ecf68a45f3f5c16fef690b | |
parent | d5028f9f7d8de5c375c52b98976b6f310e73398f (diff) |
membarrier: clean up selftest
We don't need to specify an explicit rule in the Makefile, the implicit
one will do the same. The "__EXPORTED_HEADERS__" define is not needed,
because we build the test against the installed kernel headers, not the
in-tree kernel headers. Re-use "$(TEST_PROGS)" in the clean target
rather than spelling the executable name twice. Include <unistd.h>
rather than the rather specific <asm-generic/unistd.h>. Include
<syscall.h> rather than <sys/syscall.h>. In both cases, the former
header is located in a standard location and includes the latter.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
Cc: Pranith Kumar <bobby.prani@gmail.com>
Cc: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | tools/testing/selftests/membarrier/Makefile | 7 | ||||
-rw-r--r-- | tools/testing/selftests/membarrier/membarrier_test.c | 5 |
2 files changed, 4 insertions, 8 deletions
diff --git a/tools/testing/selftests/membarrier/Makefile b/tools/testing/selftests/membarrier/Makefile index 877a50355d7f..a1a97085847d 100644 --- a/tools/testing/selftests/membarrier/Makefile +++ b/tools/testing/selftests/membarrier/Makefile | |||
@@ -1,11 +1,10 @@ | |||
1 | CFLAGS += -g -I../../../../usr/include/ | 1 | CFLAGS += -g -I../../../../usr/include/ |
2 | 2 | ||
3 | all: | ||
4 | $(CC) $(CFLAGS) membarrier_test.c -o membarrier_test | ||
5 | |||
6 | TEST_PROGS := membarrier_test | 3 | TEST_PROGS := membarrier_test |
7 | 4 | ||
5 | all: $(TEST_PROGS) | ||
6 | |||
8 | include ../lib.mk | 7 | include ../lib.mk |
9 | 8 | ||
10 | clean: | 9 | clean: |
11 | $(RM) membarrier_test | 10 | $(RM) $(TEST_PROGS) |
diff --git a/tools/testing/selftests/membarrier/membarrier_test.c b/tools/testing/selftests/membarrier/membarrier_test.c index dde312508007..535f0fef4d0b 100644 --- a/tools/testing/selftests/membarrier/membarrier_test.c +++ b/tools/testing/selftests/membarrier/membarrier_test.c | |||
@@ -1,9 +1,6 @@ | |||
1 | #define _GNU_SOURCE | 1 | #define _GNU_SOURCE |
2 | #define __EXPORTED_HEADERS__ | ||
3 | |||
4 | #include <linux/membarrier.h> | 2 | #include <linux/membarrier.h> |
5 | #include <asm-generic/unistd.h> | 3 | #include <syscall.h> |
6 | #include <sys/syscall.h> | ||
7 | #include <stdio.h> | 4 | #include <stdio.h> |
8 | #include <errno.h> | 5 | #include <errno.h> |
9 | #include <string.h> | 6 | #include <string.h> |