[lkml]   [2015]   [Sep]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH v3] Cleanup: membarrier 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 <>
CC: Michael Ellerman <>
CC: Andrew Morton <>
CC: Pranith Kumar <>
CC: Shuah Khan <>
Changes since v2:
- Refine Changelog, removing references to comments, taking care
of comments from Shuah Khan.
Changes since v1:
- Add Changelog.
Changes since RFC:
- Take care of comments from Michael Ellerman.
tools/testing/selftests/membarrier/Makefile | 7 +++----
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 877a503..a1a9708 100644
--- a/tools/testing/selftests/membarrier/Makefile
+++ b/tools/testing/selftests/membarrier/Makefile
@@ -1,11 +1,10 @@
CFLAGS += -g -I../../../../usr/include/

- $(CC) $(CFLAGS) membarrier_test.c -o membarrier_test
TEST_PROGS := membarrier_test

+all: $(TEST_PROGS)
include ../

- $(RM) membarrier_test
diff --git a/tools/testing/selftests/membarrier/membarrier_test.c b/tools/testing/selftests/membarrier/membarrier_test.c
index dde3125..535f0fe 100644
--- a/tools/testing/selftests/membarrier/membarrier_test.c
+++ b/tools/testing/selftests/membarrier/membarrier_test.c
@@ -1,9 +1,6 @@
#define _GNU_SOURCE
#include <linux/membarrier.h>
-#include <asm-generic/unistd.h>
-#include <sys/syscall.h>
+#include <syscall.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>

 \ /
  Last update: 2015-09-08 23:21    [W:0.030 / U:7.604 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site