Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Mathieu Desnoyers and committed by
Linus Torvalds
7a07b503 d5028f9f

+4 -8
+3 -4
tools/testing/selftests/membarrier/Makefile
··· 1 1 CFLAGS += -g -I../../../../usr/include/ 2 2 3 - all: 4 - $(CC) $(CFLAGS) membarrier_test.c -o membarrier_test 5 - 6 3 TEST_PROGS := membarrier_test 4 + 5 + all: $(TEST_PROGS) 7 6 8 7 include ../lib.mk 9 8 10 9 clean: 11 - $(RM) membarrier_test 10 + $(RM) $(TEST_PROGS)
+1 -4
tools/testing/selftests/membarrier/membarrier_test.c
··· 1 1 #define _GNU_SOURCE 2 - #define __EXPORTED_HEADERS__ 3 - 4 2 #include <linux/membarrier.h> 5 - #include <asm-generic/unistd.h> 6 - #include <sys/syscall.h> 3 + #include <syscall.h> 7 4 #include <stdio.h> 8 5 #include <errno.h> 9 6 #include <string.h>