* [PATCH v2] Cleanup: membarrier selftest
@ 2015-09-08 19:21 Mathieu Desnoyers
[not found] ` <1441740119-24233-1-git-send-email-mathieu.desnoyers-vg+e7yoeK/dWk0Htik3J/w@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Mathieu Desnoyers @ 2015-09-08 19:21 UTC (permalink / raw)
To: Andrew Morton
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA, Mathieu Desnoyers,
Michael Ellerman, linux-api-u79uwXL29TY76Z2rM5mHXA, Pranith Kumar,
Shuah Khan
As per Michael Ellerman's comments, we don't need to specify the rule
in the Makefile, the implicit one will do the same. Also, the
"__EXPORTED_HEADERS__" include is not needed, because we build the
test against the installed kernel headers, not the kernel headers.
Include <unistd.h> rather than the rather specific
<asm-generic/unistd.h> (the former header is located in a standard
location and includes the latter).
My own cleanups: re-use "$(TEST_PROGS)" in the clean target rather than
spelling the executable twice. Include <syscall.h> rather than
<sys/syscall.h> (the former header is located in a standard location
and includes the latter).
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers-vg+e7yoeK/dWk0Htik3J/w@public.gmane.org>
CC: Michael Ellerman <mpe-Gsx/Oe8HsFggBc27wqDAHg@public.gmane.org>
CC: Andrew Morton <akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
CC: linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
CC: Pranith Kumar <bobby.prani-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
CC: Shuah Khan <shuahkh-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
--
Changes since v1:
- Add Changelog.
---
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/
-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)
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
-#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>
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread[parent not found: <1441740119-24233-1-git-send-email-mathieu.desnoyers-vg+e7yoeK/dWk0Htik3J/w@public.gmane.org>]
* Re: [PATCH v2] Cleanup: membarrier selftest [not found] ` <1441740119-24233-1-git-send-email-mathieu.desnoyers-vg+e7yoeK/dWk0Htik3J/w@public.gmane.org> @ 2015-09-08 19:39 ` Shuah Khan 0 siblings, 0 replies; 2+ messages in thread From: Shuah Khan @ 2015-09-08 19:39 UTC (permalink / raw) To: Mathieu Desnoyers, Andrew Morton Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA, Michael Ellerman, linux-api-u79uwXL29TY76Z2rM5mHXA, Pranith Kumar, Shuah Khan On 09/08/2015 01:21 PM, Mathieu Desnoyers wrote: > As per Michael Ellerman's comments, we don't need to specify the rule > in the Makefile, the implicit one will do the same. Also, the > "__EXPORTED_HEADERS__" include is not needed, because we build the > test against the installed kernel headers, not the kernel headers. > Include <unistd.h> rather than the rather specific > <asm-generic/unistd.h> (the former header is located in a standard > location and includes the latter). > > My own cleanups: re-use "$(TEST_PROGS)" in the clean target rather than > spelling the executable twice. Include <syscall.h> rather than > <sys/syscall.h> (the former header is located in a standard location > and includes the latter). Please refine this changelog. Reference to comments belongs in the Changes since section. Please rephrase to not include reference to comments. Please do the same for "My own cleanups:". Get rid of it. thanks, -- Shuah > > Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers-vg+e7yoeK/dWk0Htik3J/w@public.gmane.org> > CC: Michael Ellerman <mpe-Gsx/Oe8HsFggBc27wqDAHg@public.gmane.org> > CC: Andrew Morton <akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org> > CC: linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > CC: Pranith Kumar <bobby.prani-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > CC: Shuah Khan <shuahkh-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org> > -- > Changes since v1: > - Add Changelog. > --- > 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/ > > -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) > 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 > -#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> > -- Shuah Khan Sr. Linux Kernel Developer Open Source Innovation Group Samsung Research America (Silicon Valley) shuahkh-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org | (970) 217-8978 ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-09-08 19:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-08 19:21 [PATCH v2] Cleanup: membarrier selftest Mathieu Desnoyers
[not found] ` <1441740119-24233-1-git-send-email-mathieu.desnoyers-vg+e7yoeK/dWk0Htik3J/w@public.gmane.org>
2015-09-08 19:39 ` Shuah Khan
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox