Skip to content

Commit

Permalink
membarrier: clean up selftest
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Michael Ellerman <[email protected]>
Cc: Pranith Kumar <[email protected]>
Cc: Shuah Khan <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
compudj authored and torvalds committed Sep 22, 2015
1 parent d5028f9 commit 7a07b50
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
7 changes: 3 additions & 4 deletions tools/testing/selftests/membarrier/Makefile
Original file line number Diff line number Diff line change
@@ -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)
5 changes: 1 addition & 4 deletions tools/testing/selftests/membarrier/membarrier_test.c
Original file line number Diff line number Diff line change
@@ -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>
Expand Down

0 comments on commit 7a07b50

Please sign in to comment.