]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
membarrier: clean up selftest
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 22 Sep 2015 21:59:20 +0000 (14:59 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 22 Sep 2015 22:09:53 +0000 (15:09 -0700)
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>
tools/testing/selftests/membarrier/Makefile
tools/testing/selftests/membarrier/membarrier_test.c

index 877a50355d7fd8787575c922db39ea280056fed4..a1a97085847d2e173f836864f35dfccc38229c2a 100644 (file)
@@ -1,11 +1,10 @@
 CFLAGS += -g -I../../../../usr/include/
 
-all:
-       $(CC) $(CFLAGS) membarrier_test.c -o membarrier_test
-
 TEST_PROGS := membarrier_test
 
+all: $(TEST_PROGS)
+
 include ../lib.mk
 
 clean:
-       $(RM) membarrier_test
+       $(RM) $(TEST_PROGS)
index dde3125080074a3588b99ee1beafee82f6a9eded..535f0fef4d0bb524f638774ffc199fde10c97497 100644 (file)
@@ -1,9 +1,6 @@
 #define _GNU_SOURCE
-#define __EXPORTED_HEADERS__
-
 #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>