All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kselftest: using built-in rule when delete file
@ 2015-09-23  9:40 Wang Long
  2015-09-24  1:46 ` Michael Ellerman
  0 siblings, 1 reply; 25+ messages in thread
From: Wang Long @ 2015-09-23  9:40 UTC (permalink / raw)
  To: shuahkh, mpe
  Cc: sam.bobroff, aneesh.kumar, paulus, khandual, gkurz, anton,
	dvhart, tglx, john.stultz, linux-kernel, wanglong, long.wanglong,
	linux-doc, peifeiyue

Use make's built-in rules to when delete a file
or delete files.

Signed-off-by: Wang Long <long.wanglong@huawei.com>
---
 tools/testing/selftests/breakpoints/Makefile           | 2 +-
 tools/testing/selftests/efivarfs/Makefile              | 2 +-
 tools/testing/selftests/futex/functional/Makefile      | 2 +-
 tools/testing/selftests/ipc/Makefile                   | 2 +-
 tools/testing/selftests/mount/Makefile                 | 2 +-
 tools/testing/selftests/mqueue/Makefile                | 2 +-
 tools/testing/selftests/powerpc/Makefile               | 2 +-
 tools/testing/selftests/powerpc/copyloops/Makefile     | 2 +-
 tools/testing/selftests/powerpc/dscr/Makefile          | 2 +-
 tools/testing/selftests/powerpc/mm/Makefile            | 2 +-
 tools/testing/selftests/powerpc/pmu/Makefile           | 2 +-
 tools/testing/selftests/powerpc/pmu/ebb/Makefile       | 2 +-
 tools/testing/selftests/powerpc/primitives/Makefile    | 2 +-
 tools/testing/selftests/powerpc/stringloops/Makefile   | 2 +-
 tools/testing/selftests/powerpc/switch_endian/Makefile | 2 +-
 tools/testing/selftests/powerpc/tm/Makefile            | 2 +-
 tools/testing/selftests/powerpc/vphn/Makefile          | 2 +-
 tools/testing/selftests/ptrace/Makefile                | 2 +-
 tools/testing/selftests/timers/Makefile                | 2 +-
 19 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/tools/testing/selftests/breakpoints/Makefile b/tools/testing/selftests/breakpoints/Makefile
index d27108b..731bd31 100644
--- a/tools/testing/selftests/breakpoints/Makefile
+++ b/tools/testing/selftests/breakpoints/Makefile
@@ -11,4 +11,4 @@ all:
 include ../lib.mk
 
 clean:
-	rm -fr breakpoint_test
+	$(RM) breakpoint_test
diff --git a/tools/testing/selftests/efivarfs/Makefile b/tools/testing/selftests/efivarfs/Makefile
index 736c3dd..4a1c629 100644
--- a/tools/testing/selftests/efivarfs/Makefile
+++ b/tools/testing/selftests/efivarfs/Makefile
@@ -10,4 +10,4 @@ TEST_FILES := $(test_objs)
 include ../lib.mk
 
 clean:
-	rm -f $(test_objs)
+	$(RM) $(test_objs)
diff --git a/tools/testing/selftests/futex/functional/Makefile b/tools/testing/selftests/futex/functional/Makefile
index 9d6b75e..391d328 100644
--- a/tools/testing/selftests/futex/functional/Makefile
+++ b/tools/testing/selftests/futex/functional/Makefile
@@ -22,4 +22,4 @@ $(TARGETS): $(HEADERS)
 include ../../lib.mk
 
 clean:
-	rm -f $(TARGETS)
+	$(RM) $(TARGETS)
diff --git a/tools/testing/selftests/ipc/Makefile b/tools/testing/selftests/ipc/Makefile
index 25d2e70..071a706 100644
--- a/tools/testing/selftests/ipc/Makefile
+++ b/tools/testing/selftests/ipc/Makefile
@@ -19,4 +19,4 @@ TEST_PROGS := msgque_test
 include ../lib.mk
 
 clean:
-	rm -fr ./msgque_test
+	$(RM) ./msgque_test
diff --git a/tools/testing/selftests/mount/Makefile b/tools/testing/selftests/mount/Makefile
index 5e35c9c..9629382 100644
--- a/tools/testing/selftests/mount/Makefile
+++ b/tools/testing/selftests/mount/Makefile
@@ -18,4 +18,4 @@ override RUN_TESTS := if [ -f /proc/self/uid_map ] ; \
 override EMIT_TESTS := echo "$(RUN_TESTS)"
 
 clean:
-	rm -f unprivileged-remount-test
+	$(RM) unprivileged-remount-test
diff --git a/tools/testing/selftests/mqueue/Makefile b/tools/testing/selftests/mqueue/Makefile
index eebac29..d61b987 100644
--- a/tools/testing/selftests/mqueue/Makefile
+++ b/tools/testing/selftests/mqueue/Makefile
@@ -17,4 +17,4 @@ override define EMIT_TESTS
 endef
 
 clean:
-	rm -f mq_open_tests mq_perf_tests
+	$(RM) mq_open_tests mq_perf_tests
diff --git a/tools/testing/selftests/powerpc/Makefile b/tools/testing/selftests/powerpc/Makefile
index 03ca2e6..91aa06d 100644
--- a/tools/testing/selftests/powerpc/Makefile
+++ b/tools/testing/selftests/powerpc/Makefile
@@ -45,7 +45,7 @@ clean:
 	@for TARGET in $(SUB_DIRS); do \
 		$(MAKE) -C $$TARGET clean; \
 	done;
-	rm -f tags
+	$(RM) tags
 
 tags:
 	find . -name '*.c' -o -name '*.h' | xargs ctags
diff --git a/tools/testing/selftests/powerpc/copyloops/Makefile b/tools/testing/selftests/powerpc/copyloops/Makefile
index 384843e..28d6d6c 100644
--- a/tools/testing/selftests/powerpc/copyloops/Makefile
+++ b/tools/testing/selftests/powerpc/copyloops/Makefile
@@ -22,4 +22,4 @@ $(TEST_PROGS): $(EXTRA_SOURCES)
 include ../../lib.mk
 
 clean:
-	rm -f $(TEST_PROGS) *.o
+	$(RM) $(TEST_PROGS) *.o
diff --git a/tools/testing/selftests/powerpc/dscr/Makefile b/tools/testing/selftests/powerpc/dscr/Makefile
index 49327ee..d32a66e 100644
--- a/tools/testing/selftests/powerpc/dscr/Makefile
+++ b/tools/testing/selftests/powerpc/dscr/Makefile
@@ -11,4 +11,4 @@ $(TEST_PROGS): ../harness.c
 include ../../lib.mk
 
 clean:
-	rm -f $(TEST_PROGS) *.o
+	$(RM) $(TEST_PROGS) *.o
diff --git a/tools/testing/selftests/powerpc/mm/Makefile b/tools/testing/selftests/powerpc/mm/Makefile
index ee179e2..7f63469 100644
--- a/tools/testing/selftests/powerpc/mm/Makefile
+++ b/tools/testing/selftests/powerpc/mm/Makefile
@@ -14,4 +14,4 @@ tempfile:
 	dd if=/dev/zero of=tempfile bs=64k count=1
 
 clean:
-	rm -f $(TEST_PROGS) tempfile
+	$(RM) $(TEST_PROGS) tempfile
diff --git a/tools/testing/selftests/powerpc/pmu/Makefile b/tools/testing/selftests/powerpc/pmu/Makefile
index a9099d9..170f3a6 100644
--- a/tools/testing/selftests/powerpc/pmu/Makefile
+++ b/tools/testing/selftests/powerpc/pmu/Makefile
@@ -33,7 +33,7 @@ override define INSTALL_RULE
 endef
 
 clean:
-	rm -f $(TEST_PROGS) loop.o
+	$(RM) $(TEST_PROGS) loop.o
 	$(MAKE) -C ebb clean
 
 ebb:
diff --git a/tools/testing/selftests/powerpc/pmu/ebb/Makefile b/tools/testing/selftests/powerpc/pmu/ebb/Makefile
index 5cdc9db..977875f 100644
--- a/tools/testing/selftests/powerpc/pmu/ebb/Makefile
+++ b/tools/testing/selftests/powerpc/pmu/ebb/Makefile
@@ -27,4 +27,4 @@ lost_exception_test: ../lib.c
 include ../../../lib.mk
 
 clean:
-	rm -f $(TEST_PROGS)
+	$(RM) $(TEST_PROGS)
diff --git a/tools/testing/selftests/powerpc/primitives/Makefile b/tools/testing/selftests/powerpc/primitives/Makefile
index b68c622..2261bd1 100644
--- a/tools/testing/selftests/powerpc/primitives/Makefile
+++ b/tools/testing/selftests/powerpc/primitives/Makefile
@@ -9,4 +9,4 @@ $(TEST_PROGS): ../harness.c
 include ../../lib.mk
 
 clean:
-	rm -f $(TEST_PROGS) *.o
+	$(RM) $(TEST_PROGS) *.o
diff --git a/tools/testing/selftests/powerpc/stringloops/Makefile b/tools/testing/selftests/powerpc/stringloops/Makefile
index 2a728f4..ea89afd 100644
--- a/tools/testing/selftests/powerpc/stringloops/Makefile
+++ b/tools/testing/selftests/powerpc/stringloops/Makefile
@@ -12,4 +12,4 @@ $(TEST_PROGS): $(EXTRA_SOURCES)
 include ../../lib.mk
 
 clean:
-	rm -f $(TEST_PROGS) *.o
+	$(RM) $(TEST_PROGS) *.o
diff --git a/tools/testing/selftests/powerpc/switch_endian/Makefile b/tools/testing/selftests/powerpc/switch_endian/Makefile
index e21d106..6cfe0f0 100644
--- a/tools/testing/selftests/powerpc/switch_endian/Makefile
+++ b/tools/testing/selftests/powerpc/switch_endian/Makefile
@@ -15,4 +15,4 @@ check-reversed.S: check-reversed.o
 include ../../lib.mk
 
 clean:
-	rm -f $(TEST_PROGS) *.o check-reversed.S
+	$(RM) $(TEST_PROGS) *.o check-reversed.S
diff --git a/tools/testing/selftests/powerpc/tm/Makefile b/tools/testing/selftests/powerpc/tm/Makefile
index 4bea62a..f04bd4b 100644
--- a/tools/testing/selftests/powerpc/tm/Makefile
+++ b/tools/testing/selftests/powerpc/tm/Makefile
@@ -10,4 +10,4 @@ tm-syscall: CFLAGS += -mhtm -I../../../../../usr/include
 include ../../lib.mk
 
 clean:
-	rm -f $(TEST_PROGS) *.o
+	$(RM) $(TEST_PROGS) *.o
diff --git a/tools/testing/selftests/powerpc/vphn/Makefile b/tools/testing/selftests/powerpc/vphn/Makefile
index a485f2e..d98f32c 100644
--- a/tools/testing/selftests/powerpc/vphn/Makefile
+++ b/tools/testing/selftests/powerpc/vphn/Makefile
@@ -9,4 +9,4 @@ $(TEST_PROGS): ../harness.c
 include ../../lib.mk
 
 clean:
-	rm -f $(TEST_PROGS)
+	$(RM) $(TEST_PROGS)
diff --git a/tools/testing/selftests/ptrace/Makefile b/tools/testing/selftests/ptrace/Makefile
index 453927f..ec5bf58 100644
--- a/tools/testing/selftests/ptrace/Makefile
+++ b/tools/testing/selftests/ptrace/Makefile
@@ -4,7 +4,7 @@ peeksiginfo: peeksiginfo.c
 all: peeksiginfo
 
 clean:
-	rm -f peeksiginfo
+	$(RM) peeksiginfo
 
 TEST_PROGS := peeksiginfo
 
diff --git a/tools/testing/selftests/timers/Makefile b/tools/testing/selftests/timers/Makefile
index 89a3f44..a5889e2 100644
--- a/tools/testing/selftests/timers/Makefile
+++ b/tools/testing/selftests/timers/Makefile
@@ -33,4 +33,4 @@ run_destructive_tests: run_tests
 	./set-2038
 
 clean:
-	rm -f ${bins}
+	$(RM) ${bins}
-- 
1.8.3.4


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* Re: [PATCH] kselftest: using built-in rule when delete file
  2015-09-23  9:40 [PATCH] kselftest: using built-in rule when delete file Wang Long
@ 2015-09-24  1:46 ` Michael Ellerman
  2015-09-24  2:05   ` long.wanglong
  0 siblings, 1 reply; 25+ messages in thread
From: Michael Ellerman @ 2015-09-24  1:46 UTC (permalink / raw)
  To: Wang Long
  Cc: shuahkh, sam.bobroff, aneesh.kumar, paulus, khandual, gkurz,
	anton, dvhart, tglx, john.stultz, linux-kernel, wanglong,
	linux-doc, peifeiyue

On Wed, 2015-09-23 at 09:40 +0000, Wang Long wrote:
> Use make's built-in rules to when delete a file
> or delete files.

It's not a built-in rule, it's a variable.

Personally I think using rm directly is clearer, but I guess this is fine. Do
you actually want to override $RM ?

cheers



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH] kselftest: using built-in rule when delete file
  2015-09-24  1:46 ` Michael Ellerman
@ 2015-09-24  2:05   ` long.wanglong
  2015-09-24  2:07     ` Michael Ellerman
  0 siblings, 1 reply; 25+ messages in thread
From: long.wanglong @ 2015-09-24  2:05 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: shuahkh, sam.bobroff, aneesh.kumar, paulus, khandual, gkurz,
	anton, dvhart, tglx, john.stultz, linux-kernel, wanglong,
	linux-doc, peifeiyue

On 2015/9/24 9:46, Michael Ellerman wrote:
> On Wed, 2015-09-23 at 09:40 +0000, Wang Long wrote:
>> Use make's built-in rules to when delete a file
>> or delete files.
> 
> It's not a built-in rule, it's a variable.

Sorry,I did not describe clearly. It is a variable used as
name of program in built-in rules.

> 
> Personally I think using rm directly is clearer, but I guess this is fine. Do
> you actually want to override $RM ?
> 

So far, I do not want to override $(RM). But I found that some test's Makefile
using *$(RM)* while the other's using *rm -f*, I think it is better to use one
of them in all unit tests.

Do you think which one is better?

Best Regards
Wang Long

> cheers
> 
> 
> 
> .
> 



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH] kselftest: using built-in rule when delete file
  2015-09-24  2:05   ` long.wanglong
@ 2015-09-24  2:07     ` Michael Ellerman
  2015-09-25 15:44       ` Darren Hart
  0 siblings, 1 reply; 25+ messages in thread
From: Michael Ellerman @ 2015-09-24  2:07 UTC (permalink / raw)
  To: long.wanglong
  Cc: shuahkh, sam.bobroff, aneesh.kumar, paulus, khandual, gkurz,
	anton, dvhart, tglx, john.stultz, linux-kernel, wanglong,
	linux-doc, peifeiyue

On Thu, 2015-09-24 at 10:05 +0800, long.wanglong wrote:
> On 2015/9/24 9:46, Michael Ellerman wrote:
> > On Wed, 2015-09-23 at 09:40 +0000, Wang Long wrote:
> >> Use make's built-in rules to when delete a file
> >> or delete files.
> > 
> > It's not a built-in rule, it's a variable.
> 
> Sorry,I did not describe clearly. It is a variable used as
> name of program in built-in rules.
> 
> > Personally I think using rm directly is clearer, but I guess this is fine. Do
> > you actually want to override $RM ?
> 
> So far, I do not want to override $(RM). But I found that some test's Makefile
> using *$(RM)* while the other's using *rm -f*, I think it is better to use one
> of them in all unit tests.
> 
> Do you think which one is better?

I prefer just using rm -f, because it's less magic, everyone knows what it does.

cheers




^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH] kselftest: using built-in rule when delete file
  2015-09-24  2:07     ` Michael Ellerman
@ 2015-09-25 15:44       ` Darren Hart
  2015-09-28  2:03         ` long.wanglong
  2015-09-28  2:10           ` Wang Long
  0 siblings, 2 replies; 25+ messages in thread
From: Darren Hart @ 2015-09-25 15:44 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: long.wanglong, shuahkh, sam.bobroff, aneesh.kumar, paulus,
	khandual, gkurz, anton, dvhart, tglx, john.stultz, linux-kernel,
	wanglong, linux-doc, peifeiyue

On Thu, Sep 24, 2015 at 12:07:47PM +1000, Michael Ellerman wrote:
> On Thu, 2015-09-24 at 10:05 +0800, long.wanglong wrote:
> > On 2015/9/24 9:46, Michael Ellerman wrote:
> > > On Wed, 2015-09-23 at 09:40 +0000, Wang Long wrote:
> > >> Use make's built-in rules to when delete a file
> > >> or delete files.
> > > 
> > > It's not a built-in rule, it's a variable.
> > 
> > Sorry,I did not describe clearly. It is a variable used as
> > name of program in built-in rules.
> > 
> > > Personally I think using rm directly is clearer, but I guess this is fine. Do
> > > you actually want to override $RM ?
> > 
> > So far, I do not want to override $(RM). But I found that some test's Makefile
> > using *$(RM)* while the other's using *rm -f*, I think it is better to use one
> > of them in all unit tests.

Agreed, consistency is good.

> > 
> > Do you think which one is better?
> 
> I prefer just using rm -f, because it's less magic, everyone knows what it does.
> 

Also agreed, it's explicit and perfectly functional.

-- 
Darren Hart
Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH] kselftest: using built-in rule when delete file
  2015-09-25 15:44       ` Darren Hart
@ 2015-09-28  2:03         ` long.wanglong
  2015-09-28  2:10           ` Wang Long
  1 sibling, 0 replies; 25+ messages in thread
From: long.wanglong @ 2015-09-28  2:03 UTC (permalink / raw)
  To: Darren Hart
  Cc: Michael Ellerman, shuahkh, sam.bobroff, aneesh.kumar, paulus,
	khandual, gkurz, anton, dvhart, tglx, john.stultz, linux-kernel,
	wanglong, linux-doc, peifeiyue

On 2015/9/25 23:44, Darren Hart wrote:
> On Thu, Sep 24, 2015 at 12:07:47PM +1000, Michael Ellerman wrote:
>> On Thu, 2015-09-24 at 10:05 +0800, long.wanglong wrote:
>>> On 2015/9/24 9:46, Michael Ellerman wrote:
>>>> On Wed, 2015-09-23 at 09:40 +0000, Wang Long wrote:
>>>>> Use make's built-in rules to when delete a file
>>>>> or delete files.
>>>>
>>>> It's not a built-in rule, it's a variable.
>>>
>>> Sorry,I did not describe clearly. It is a variable used as
>>> name of program in built-in rules.
>>>
>>>> Personally I think using rm directly is clearer, but I guess this is fine. Do
>>>> you actually want to override $RM ?
>>>
>>> So far, I do not want to override $(RM). But I found that some test's Makefile
>>> using *$(RM)* while the other's using *rm -f*, I think it is better to use one
>>> of them in all unit tests.
> 
> Agreed, consistency is good.
> 
>>>
>>> Do you think which one is better?
>>
>> I prefer just using rm -f, because it's less magic, everyone knows what it does.
>>
> 
> Also agreed, it's explicit and perfectly functional.
> 
Ok, thanks, I will send another patch to replace $(RM) with "rm -f".

Best Regards
Wang Long


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [PATCH] kselftest: replace $(RM) with rm -f command
  2015-09-25 15:44       ` Darren Hart
@ 2015-09-28  2:10           ` Wang Long
  2015-09-28  2:10           ` Wang Long
  1 sibling, 0 replies; 25+ messages in thread
From: Wang Long @ 2015-09-28  2:10 UTC (permalink / raw)
  To: shuahkh, dvhart, mpe
  Cc: keescook, davem, luto, wad, akpm, long.wanglong, gorcunov, cov,
	mathieu.desnoyers, bobby.prani, tyler.baker, tim.bird, josh,
	aarcange, andrej.skvortzov, sjayaram, treding, mingo,
	naresh.kamboju, alexey.kodanev, linux-api, linux-kernel,
	wanglong

Some test's Makefile using "$(RM)" while the other's
using "rm -f". It is better to use one of them in all
tests.

"rm -f" is better, because it is less magic, and everyone
konws what is does.

Signed-off-by: Wang Long <long.wanglong@huawei.com>
---
 tools/testing/selftests/capabilities/Makefile | 2 +-
 tools/testing/selftests/kcmp/Makefile         | 2 +-
 tools/testing/selftests/membarrier/Makefile   | 2 +-
 tools/testing/selftests/memfd/Makefile        | 2 +-
 tools/testing/selftests/net/Makefile          | 2 +-
 tools/testing/selftests/seccomp/Makefile      | 2 +-
 tools/testing/selftests/size/Makefile         | 2 +-
 tools/testing/selftests/vm/Makefile           | 2 +-
 tools/testing/selftests/x86/Makefile          | 2 +-
 tools/testing/selftests/zram/Makefile         | 2 +-
 10 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/tools/testing/selftests/capabilities/Makefile b/tools/testing/selftests/capabilities/Makefile
index 8c8f0c1..dcc1972 100644
--- a/tools/testing/selftests/capabilities/Makefile
+++ b/tools/testing/selftests/capabilities/Makefile
@@ -12,7 +12,7 @@ CFLAGS := -O2 -g -std=gnu99 -Wall -lcap-ng
 all: $(TARGETS)
 
 clean:
-	$(RM) $(TARGETS)
+	rm -f $(TARGETS)
 
 $(TARGETS): %: %.c
 	$(CC) -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl
diff --git a/tools/testing/selftests/kcmp/Makefile b/tools/testing/selftests/kcmp/Makefile
index 2ae7450..2deaee0 100644
--- a/tools/testing/selftests/kcmp/Makefile
+++ b/tools/testing/selftests/kcmp/Makefile
@@ -7,4 +7,4 @@ TEST_PROGS := kcmp_test
 include ../lib.mk
 
 clean:
-	$(RM) kcmp_test kcmp-test-file
+	rn -f kcmp_test kcmp-test-file
diff --git a/tools/testing/selftests/membarrier/Makefile b/tools/testing/selftests/membarrier/Makefile
index a1a9708..f23fc58 100644
--- a/tools/testing/selftests/membarrier/Makefile
+++ b/tools/testing/selftests/membarrier/Makefile
@@ -7,4 +7,4 @@ all: $(TEST_PROGS)
 include ../lib.mk
 
 clean:
-	$(RM) $(TEST_PROGS)
+	rm -f $(TEST_PROGS)
diff --git a/tools/testing/selftests/memfd/Makefile b/tools/testing/selftests/memfd/Makefile
index 3e7eb79..068fa93 100644
--- a/tools/testing/selftests/memfd/Makefile
+++ b/tools/testing/selftests/memfd/Makefile
@@ -19,4 +19,4 @@ run_fuse: build_fuse
 	@./run_fuse_test.sh || echo "fuse_test: [FAIL]"
 
 clean:
-	$(RM) memfd_test fuse_test
+	rm -f memfd_test fuse_test
diff --git a/tools/testing/selftests/net/Makefile b/tools/testing/selftests/net/Makefile
index fac4782..ec7eaa4 100644
--- a/tools/testing/selftests/net/Makefile
+++ b/tools/testing/selftests/net/Makefile
@@ -16,4 +16,4 @@ TEST_FILES := $(NET_PROGS)
 include ../lib.mk
 
 clean:
-	$(RM) $(NET_PROGS)
+	rm -f $(NET_PROGS)
diff --git a/tools/testing/selftests/seccomp/Makefile b/tools/testing/selftests/seccomp/Makefile
index 8401e87..c16072a 100644
--- a/tools/testing/selftests/seccomp/Makefile
+++ b/tools/testing/selftests/seccomp/Makefile
@@ -7,4 +7,4 @@ all: $(TEST_PROGS)
 include ../lib.mk
 
 clean:
-	$(RM) $(TEST_PROGS)
+	rm -f $(TEST_PROGS)
diff --git a/tools/testing/selftests/size/Makefile b/tools/testing/selftests/size/Makefile
index bbd0b53..cefe914 100644
--- a/tools/testing/selftests/size/Makefile
+++ b/tools/testing/selftests/size/Makefile
@@ -8,4 +8,4 @@ TEST_PROGS := get_size
 include ../lib.mk
 
 clean:
-	$(RM) get_size
+	rm -f get_size
diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile
index 3c53cac..26663c7 100644
--- a/tools/testing/selftests/vm/Makefile
+++ b/tools/testing/selftests/vm/Makefile
@@ -24,4 +24,4 @@ TEST_FILES := $(BINARIES)
 include ../lib.mk
 
 clean:
-	$(RM) $(BINARIES)
+	rm -f $(BINARIES)
diff --git a/tools/testing/selftests/x86/Makefile b/tools/testing/selftests/x86/Makefile
index 29089b2..48b2406 100644
--- a/tools/testing/selftests/x86/Makefile
+++ b/tools/testing/selftests/x86/Makefile
@@ -32,7 +32,7 @@ all_32: $(BINARIES_32)
 all_64: $(BINARIES_64)
 
 clean:
-	$(RM) $(BINARIES_32) $(BINARIES_64)
+	rm -f $(BINARIES_32) $(BINARIES_64)
 
 $(TARGETS_C_32BIT_ALL:%=%_32): %_32: %.c
 	$(CC) -m32 -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl
diff --git a/tools/testing/selftests/zram/Makefile b/tools/testing/selftests/zram/Makefile
index 29d8034..e1591c8 100644
--- a/tools/testing/selftests/zram/Makefile
+++ b/tools/testing/selftests/zram/Makefile
@@ -6,4 +6,4 @@ TEST_FILES := zram01.sh zram02.sh zram_lib.sh
 include ../lib.mk
 
 clean:
-	$(RM) err.log
+	rm -f err.log
-- 
1.8.3.4


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH] kselftest: replace $(RM) with rm -f command
@ 2015-09-28  2:10           ` Wang Long
  0 siblings, 0 replies; 25+ messages in thread
From: Wang Long @ 2015-09-28  2:10 UTC (permalink / raw)
  To: shuahkh-JPH+aEBZ4P+UEJcrhfAQsw, dvhart-wEGCiKHe2LqWVfeAwA7xHQ,
	mpe-Gsx/Oe8HsFggBc27wqDAHg
  Cc: keescook-F7+t8E8rja9g9hUCZPvPmw, davem-fT/PcQaiUtIeIZ0/mPfg9Q,
	luto-kltTT9wpgjJwATOyAt5JVQ, wad-F7+t8E8rja9g9hUCZPvPmw,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
	long.wanglong-hv44wF8Li93QT0dZR+AlfA,
	gorcunov-GEFAQzZX7r8dnm+yROfE0A, cov-sgV2jX0FEOL9JmXXK+q4OQ,
	mathieu.desnoyers-vg+e7yoeK/dWk0Htik3J/w,
	bobby.prani-Re5JQEeQqe8AvxtiuMwx3w,
	tyler.baker-QSEj5FYQhm4dnm+yROfE0A,
	tim.bird-/MT0OVThwyLZJqsBc5GL+g, josh-iaAMLnmF4UmaiuxdJuQwMA,
	aarcange-H+wXaHxf7aLQT0dZR+AlfA,
	andrej.skvortzov-Re5JQEeQqe8AvxtiuMwx3w,
	sjayaram-JqFfY2XvxFXQT0dZR+AlfA, treding-DDmLM1+adcrQT0dZR+AlfA,
	mingo-DgEjT+Ai2ygdnm+yROfE0A,
	naresh.kamboju-QSEj5FYQhm4dnm+yROfE0A,
	alexey.kodanev-QHcLZuEGTsvQT0dZR+AlfA,
	linux-api-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	wanglong-m92B/FuLcaEcWVvVuXF20w

Some test's Makefile using "$(RM)" while the other's
using "rm -f". It is better to use one of them in all
tests.

"rm -f" is better, because it is less magic, and everyone
konws what is does.

Signed-off-by: Wang Long <long.wanglong-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
---
 tools/testing/selftests/capabilities/Makefile | 2 +-
 tools/testing/selftests/kcmp/Makefile         | 2 +-
 tools/testing/selftests/membarrier/Makefile   | 2 +-
 tools/testing/selftests/memfd/Makefile        | 2 +-
 tools/testing/selftests/net/Makefile          | 2 +-
 tools/testing/selftests/seccomp/Makefile      | 2 +-
 tools/testing/selftests/size/Makefile         | 2 +-
 tools/testing/selftests/vm/Makefile           | 2 +-
 tools/testing/selftests/x86/Makefile          | 2 +-
 tools/testing/selftests/zram/Makefile         | 2 +-
 10 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/tools/testing/selftests/capabilities/Makefile b/tools/testing/selftests/capabilities/Makefile
index 8c8f0c1..dcc1972 100644
--- a/tools/testing/selftests/capabilities/Makefile
+++ b/tools/testing/selftests/capabilities/Makefile
@@ -12,7 +12,7 @@ CFLAGS := -O2 -g -std=gnu99 -Wall -lcap-ng
 all: $(TARGETS)
 
 clean:
-	$(RM) $(TARGETS)
+	rm -f $(TARGETS)
 
 $(TARGETS): %: %.c
 	$(CC) -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl
diff --git a/tools/testing/selftests/kcmp/Makefile b/tools/testing/selftests/kcmp/Makefile
index 2ae7450..2deaee0 100644
--- a/tools/testing/selftests/kcmp/Makefile
+++ b/tools/testing/selftests/kcmp/Makefile
@@ -7,4 +7,4 @@ TEST_PROGS := kcmp_test
 include ../lib.mk
 
 clean:
-	$(RM) kcmp_test kcmp-test-file
+	rn -f kcmp_test kcmp-test-file
diff --git a/tools/testing/selftests/membarrier/Makefile b/tools/testing/selftests/membarrier/Makefile
index a1a9708..f23fc58 100644
--- a/tools/testing/selftests/membarrier/Makefile
+++ b/tools/testing/selftests/membarrier/Makefile
@@ -7,4 +7,4 @@ all: $(TEST_PROGS)
 include ../lib.mk
 
 clean:
-	$(RM) $(TEST_PROGS)
+	rm -f $(TEST_PROGS)
diff --git a/tools/testing/selftests/memfd/Makefile b/tools/testing/selftests/memfd/Makefile
index 3e7eb79..068fa93 100644
--- a/tools/testing/selftests/memfd/Makefile
+++ b/tools/testing/selftests/memfd/Makefile
@@ -19,4 +19,4 @@ run_fuse: build_fuse
 	@./run_fuse_test.sh || echo "fuse_test: [FAIL]"
 
 clean:
-	$(RM) memfd_test fuse_test
+	rm -f memfd_test fuse_test
diff --git a/tools/testing/selftests/net/Makefile b/tools/testing/selftests/net/Makefile
index fac4782..ec7eaa4 100644
--- a/tools/testing/selftests/net/Makefile
+++ b/tools/testing/selftests/net/Makefile
@@ -16,4 +16,4 @@ TEST_FILES := $(NET_PROGS)
 include ../lib.mk
 
 clean:
-	$(RM) $(NET_PROGS)
+	rm -f $(NET_PROGS)
diff --git a/tools/testing/selftests/seccomp/Makefile b/tools/testing/selftests/seccomp/Makefile
index 8401e87..c16072a 100644
--- a/tools/testing/selftests/seccomp/Makefile
+++ b/tools/testing/selftests/seccomp/Makefile
@@ -7,4 +7,4 @@ all: $(TEST_PROGS)
 include ../lib.mk
 
 clean:
-	$(RM) $(TEST_PROGS)
+	rm -f $(TEST_PROGS)
diff --git a/tools/testing/selftests/size/Makefile b/tools/testing/selftests/size/Makefile
index bbd0b53..cefe914 100644
--- a/tools/testing/selftests/size/Makefile
+++ b/tools/testing/selftests/size/Makefile
@@ -8,4 +8,4 @@ TEST_PROGS := get_size
 include ../lib.mk
 
 clean:
-	$(RM) get_size
+	rm -f get_size
diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile
index 3c53cac..26663c7 100644
--- a/tools/testing/selftests/vm/Makefile
+++ b/tools/testing/selftests/vm/Makefile
@@ -24,4 +24,4 @@ TEST_FILES := $(BINARIES)
 include ../lib.mk
 
 clean:
-	$(RM) $(BINARIES)
+	rm -f $(BINARIES)
diff --git a/tools/testing/selftests/x86/Makefile b/tools/testing/selftests/x86/Makefile
index 29089b2..48b2406 100644
--- a/tools/testing/selftests/x86/Makefile
+++ b/tools/testing/selftests/x86/Makefile
@@ -32,7 +32,7 @@ all_32: $(BINARIES_32)
 all_64: $(BINARIES_64)
 
 clean:
-	$(RM) $(BINARIES_32) $(BINARIES_64)
+	rm -f $(BINARIES_32) $(BINARIES_64)
 
 $(TARGETS_C_32BIT_ALL:%=%_32): %_32: %.c
 	$(CC) -m32 -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl
diff --git a/tools/testing/selftests/zram/Makefile b/tools/testing/selftests/zram/Makefile
index 29d8034..e1591c8 100644
--- a/tools/testing/selftests/zram/Makefile
+++ b/tools/testing/selftests/zram/Makefile
@@ -6,4 +6,4 @@ TEST_FILES := zram01.sh zram02.sh zram_lib.sh
 include ../lib.mk
 
 clean:
-	$(RM) err.log
+	rm -f err.log
-- 
1.8.3.4

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* Re: [PATCH] kselftest: replace $(RM) with rm -f command
@ 2015-09-28  3:16             ` Mathieu Desnoyers
  0 siblings, 0 replies; 25+ messages in thread
From: Mathieu Desnoyers @ 2015-09-28  3:16 UTC (permalink / raw)
  To: Wang Long
  Cc: shuahkh, dvhart, Michael Ellerman, keescook, davem, luto, wad,
	Andrew Morton, gorcunov, cov, bobby prani, tyler baker, Tim Bird,
	josh, Andrea Arcangeli, andrej skvortzov, sjayaram, treding,
	Ingo Molnar, naresh kamboju, alexey kodanev, linux-api,
	linux-kernel, wanglong

----- On Sep 27, 2015, at 10:10 PM, Wang Long long.wanglong@huawei.com wrote:

> Some test's Makefile using "$(RM)" while the other's
> using "rm -f". It is better to use one of them in all
> tests.

I agree that this disparity appears to be unwanted. We
should settle on one or the other.

> 
> "rm -f" is better, because it is less magic, and everyone
> konws what is does.

"$(RM)" is clearly defined as a Makefile implicit variable
which defaults to "rm -f".
Ref. https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html

Leaving it as a variable is more flexible because then the
default behavior can be overridden if need be, which is
not the case of a hardcoded "rm -f".

Following your line of argumentation, we should then
invoke "gcc" directly in every Makefile because it is
less magic than "$(CC)". This makes no sense.

Thanks,

Mathieu

> 
> Signed-off-by: Wang Long <long.wanglong@huawei.com>
> ---
> tools/testing/selftests/capabilities/Makefile | 2 +-
> tools/testing/selftests/kcmp/Makefile         | 2 +-
> tools/testing/selftests/membarrier/Makefile   | 2 +-
> tools/testing/selftests/memfd/Makefile        | 2 +-
> tools/testing/selftests/net/Makefile          | 2 +-
> tools/testing/selftests/seccomp/Makefile      | 2 +-
> tools/testing/selftests/size/Makefile         | 2 +-
> tools/testing/selftests/vm/Makefile           | 2 +-
> tools/testing/selftests/x86/Makefile          | 2 +-
> tools/testing/selftests/zram/Makefile         | 2 +-
> 10 files changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/tools/testing/selftests/capabilities/Makefile
> b/tools/testing/selftests/capabilities/Makefile
> index 8c8f0c1..dcc1972 100644
> --- a/tools/testing/selftests/capabilities/Makefile
> +++ b/tools/testing/selftests/capabilities/Makefile
> @@ -12,7 +12,7 @@ CFLAGS := -O2 -g -std=gnu99 -Wall -lcap-ng
> all: $(TARGETS)
> 
> clean:
> -	$(RM) $(TARGETS)
> +	rm -f $(TARGETS)
> 
> $(TARGETS): %: %.c
> 	$(CC) -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl
> diff --git a/tools/testing/selftests/kcmp/Makefile
> b/tools/testing/selftests/kcmp/Makefile
> index 2ae7450..2deaee0 100644
> --- a/tools/testing/selftests/kcmp/Makefile
> +++ b/tools/testing/selftests/kcmp/Makefile
> @@ -7,4 +7,4 @@ TEST_PROGS := kcmp_test
> include ../lib.mk
> 
> clean:
> -	$(RM) kcmp_test kcmp-test-file
> +	rn -f kcmp_test kcmp-test-file
> diff --git a/tools/testing/selftests/membarrier/Makefile
> b/tools/testing/selftests/membarrier/Makefile
> index a1a9708..f23fc58 100644
> --- a/tools/testing/selftests/membarrier/Makefile
> +++ b/tools/testing/selftests/membarrier/Makefile
> @@ -7,4 +7,4 @@ all: $(TEST_PROGS)
> include ../lib.mk
> 
> clean:
> -	$(RM) $(TEST_PROGS)
> +	rm -f $(TEST_PROGS)
> diff --git a/tools/testing/selftests/memfd/Makefile
> b/tools/testing/selftests/memfd/Makefile
> index 3e7eb79..068fa93 100644
> --- a/tools/testing/selftests/memfd/Makefile
> +++ b/tools/testing/selftests/memfd/Makefile
> @@ -19,4 +19,4 @@ run_fuse: build_fuse
> 	@./run_fuse_test.sh || echo "fuse_test: [FAIL]"
> 
> clean:
> -	$(RM) memfd_test fuse_test
> +	rm -f memfd_test fuse_test
> diff --git a/tools/testing/selftests/net/Makefile
> b/tools/testing/selftests/net/Makefile
> index fac4782..ec7eaa4 100644
> --- a/tools/testing/selftests/net/Makefile
> +++ b/tools/testing/selftests/net/Makefile
> @@ -16,4 +16,4 @@ TEST_FILES := $(NET_PROGS)
> include ../lib.mk
> 
> clean:
> -	$(RM) $(NET_PROGS)
> +	rm -f $(NET_PROGS)
> diff --git a/tools/testing/selftests/seccomp/Makefile
> b/tools/testing/selftests/seccomp/Makefile
> index 8401e87..c16072a 100644
> --- a/tools/testing/selftests/seccomp/Makefile
> +++ b/tools/testing/selftests/seccomp/Makefile
> @@ -7,4 +7,4 @@ all: $(TEST_PROGS)
> include ../lib.mk
> 
> clean:
> -	$(RM) $(TEST_PROGS)
> +	rm -f $(TEST_PROGS)
> diff --git a/tools/testing/selftests/size/Makefile
> b/tools/testing/selftests/size/Makefile
> index bbd0b53..cefe914 100644
> --- a/tools/testing/selftests/size/Makefile
> +++ b/tools/testing/selftests/size/Makefile
> @@ -8,4 +8,4 @@ TEST_PROGS := get_size
> include ../lib.mk
> 
> clean:
> -	$(RM) get_size
> +	rm -f get_size
> diff --git a/tools/testing/selftests/vm/Makefile
> b/tools/testing/selftests/vm/Makefile
> index 3c53cac..26663c7 100644
> --- a/tools/testing/selftests/vm/Makefile
> +++ b/tools/testing/selftests/vm/Makefile
> @@ -24,4 +24,4 @@ TEST_FILES := $(BINARIES)
> include ../lib.mk
> 
> clean:
> -	$(RM) $(BINARIES)
> +	rm -f $(BINARIES)
> diff --git a/tools/testing/selftests/x86/Makefile
> b/tools/testing/selftests/x86/Makefile
> index 29089b2..48b2406 100644
> --- a/tools/testing/selftests/x86/Makefile
> +++ b/tools/testing/selftests/x86/Makefile
> @@ -32,7 +32,7 @@ all_32: $(BINARIES_32)
> all_64: $(BINARIES_64)
> 
> clean:
> -	$(RM) $(BINARIES_32) $(BINARIES_64)
> +	rm -f $(BINARIES_32) $(BINARIES_64)
> 
> $(TARGETS_C_32BIT_ALL:%=%_32): %_32: %.c
> 	$(CC) -m32 -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl
> diff --git a/tools/testing/selftests/zram/Makefile
> b/tools/testing/selftests/zram/Makefile
> index 29d8034..e1591c8 100644
> --- a/tools/testing/selftests/zram/Makefile
> +++ b/tools/testing/selftests/zram/Makefile
> @@ -6,4 +6,4 @@ TEST_FILES := zram01.sh zram02.sh zram_lib.sh
> include ../lib.mk
> 
> clean:
> -	$(RM) err.log
> +	rm -f err.log
> --
> 1.8.3.4

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH] kselftest: replace $(RM) with rm -f command
@ 2015-09-28  3:16             ` Mathieu Desnoyers
  0 siblings, 0 replies; 25+ messages in thread
From: Mathieu Desnoyers @ 2015-09-28  3:16 UTC (permalink / raw)
  To: Wang Long
  Cc: shuahkh-JPH+aEBZ4P+UEJcrhfAQsw, dvhart-wEGCiKHe2LqWVfeAwA7xHQ,
	Michael Ellerman, keescook-F7+t8E8rja9g9hUCZPvPmw,
	davem-fT/PcQaiUtIeIZ0/mPfg9Q, luto-kltTT9wpgjJwATOyAt5JVQ,
	wad-F7+t8E8rja9g9hUCZPvPmw, Andrew Morton,
	gorcunov-GEFAQzZX7r8dnm+yROfE0A, cov-sgV2jX0FEOL9JmXXK+q4OQ,
	bobby prani, tyler baker, Tim Bird, josh-iaAMLnmF4UmaiuxdJuQwMA,
	Andrea Arcangeli, andrej skvortzov,
	sjayaram-JqFfY2XvxFXQT0dZR+AlfA, treding-DDmLM1+adcrQT0dZR+AlfA,
	Ingo Molnar, naresh kamboju, alexey kodanev, linux-api,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	wanglong-m92B/FuLcaEcWVvVuXF20w

----- On Sep 27, 2015, at 10:10 PM, Wang Long long.wanglong-hv44wF8Li93QT0dZR+AlfA@public.gmane.org wrote:

> Some test's Makefile using "$(RM)" while the other's
> using "rm -f". It is better to use one of them in all
> tests.

I agree that this disparity appears to be unwanted. We
should settle on one or the other.

> 
> "rm -f" is better, because it is less magic, and everyone
> konws what is does.

"$(RM)" is clearly defined as a Makefile implicit variable
which defaults to "rm -f".
Ref. https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html

Leaving it as a variable is more flexible because then the
default behavior can be overridden if need be, which is
not the case of a hardcoded "rm -f".

Following your line of argumentation, we should then
invoke "gcc" directly in every Makefile because it is
less magic than "$(CC)". This makes no sense.

Thanks,

Mathieu

> 
> Signed-off-by: Wang Long <long.wanglong-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
> ---
> tools/testing/selftests/capabilities/Makefile | 2 +-
> tools/testing/selftests/kcmp/Makefile         | 2 +-
> tools/testing/selftests/membarrier/Makefile   | 2 +-
> tools/testing/selftests/memfd/Makefile        | 2 +-
> tools/testing/selftests/net/Makefile          | 2 +-
> tools/testing/selftests/seccomp/Makefile      | 2 +-
> tools/testing/selftests/size/Makefile         | 2 +-
> tools/testing/selftests/vm/Makefile           | 2 +-
> tools/testing/selftests/x86/Makefile          | 2 +-
> tools/testing/selftests/zram/Makefile         | 2 +-
> 10 files changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/tools/testing/selftests/capabilities/Makefile
> b/tools/testing/selftests/capabilities/Makefile
> index 8c8f0c1..dcc1972 100644
> --- a/tools/testing/selftests/capabilities/Makefile
> +++ b/tools/testing/selftests/capabilities/Makefile
> @@ -12,7 +12,7 @@ CFLAGS := -O2 -g -std=gnu99 -Wall -lcap-ng
> all: $(TARGETS)
> 
> clean:
> -	$(RM) $(TARGETS)
> +	rm -f $(TARGETS)
> 
> $(TARGETS): %: %.c
> 	$(CC) -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl
> diff --git a/tools/testing/selftests/kcmp/Makefile
> b/tools/testing/selftests/kcmp/Makefile
> index 2ae7450..2deaee0 100644
> --- a/tools/testing/selftests/kcmp/Makefile
> +++ b/tools/testing/selftests/kcmp/Makefile
> @@ -7,4 +7,4 @@ TEST_PROGS := kcmp_test
> include ../lib.mk
> 
> clean:
> -	$(RM) kcmp_test kcmp-test-file
> +	rn -f kcmp_test kcmp-test-file
> diff --git a/tools/testing/selftests/membarrier/Makefile
> b/tools/testing/selftests/membarrier/Makefile
> index a1a9708..f23fc58 100644
> --- a/tools/testing/selftests/membarrier/Makefile
> +++ b/tools/testing/selftests/membarrier/Makefile
> @@ -7,4 +7,4 @@ all: $(TEST_PROGS)
> include ../lib.mk
> 
> clean:
> -	$(RM) $(TEST_PROGS)
> +	rm -f $(TEST_PROGS)
> diff --git a/tools/testing/selftests/memfd/Makefile
> b/tools/testing/selftests/memfd/Makefile
> index 3e7eb79..068fa93 100644
> --- a/tools/testing/selftests/memfd/Makefile
> +++ b/tools/testing/selftests/memfd/Makefile
> @@ -19,4 +19,4 @@ run_fuse: build_fuse
> 	@./run_fuse_test.sh || echo "fuse_test: [FAIL]"
> 
> clean:
> -	$(RM) memfd_test fuse_test
> +	rm -f memfd_test fuse_test
> diff --git a/tools/testing/selftests/net/Makefile
> b/tools/testing/selftests/net/Makefile
> index fac4782..ec7eaa4 100644
> --- a/tools/testing/selftests/net/Makefile
> +++ b/tools/testing/selftests/net/Makefile
> @@ -16,4 +16,4 @@ TEST_FILES := $(NET_PROGS)
> include ../lib.mk
> 
> clean:
> -	$(RM) $(NET_PROGS)
> +	rm -f $(NET_PROGS)
> diff --git a/tools/testing/selftests/seccomp/Makefile
> b/tools/testing/selftests/seccomp/Makefile
> index 8401e87..c16072a 100644
> --- a/tools/testing/selftests/seccomp/Makefile
> +++ b/tools/testing/selftests/seccomp/Makefile
> @@ -7,4 +7,4 @@ all: $(TEST_PROGS)
> include ../lib.mk
> 
> clean:
> -	$(RM) $(TEST_PROGS)
> +	rm -f $(TEST_PROGS)
> diff --git a/tools/testing/selftests/size/Makefile
> b/tools/testing/selftests/size/Makefile
> index bbd0b53..cefe914 100644
> --- a/tools/testing/selftests/size/Makefile
> +++ b/tools/testing/selftests/size/Makefile
> @@ -8,4 +8,4 @@ TEST_PROGS := get_size
> include ../lib.mk
> 
> clean:
> -	$(RM) get_size
> +	rm -f get_size
> diff --git a/tools/testing/selftests/vm/Makefile
> b/tools/testing/selftests/vm/Makefile
> index 3c53cac..26663c7 100644
> --- a/tools/testing/selftests/vm/Makefile
> +++ b/tools/testing/selftests/vm/Makefile
> @@ -24,4 +24,4 @@ TEST_FILES := $(BINARIES)
> include ../lib.mk
> 
> clean:
> -	$(RM) $(BINARIES)
> +	rm -f $(BINARIES)
> diff --git a/tools/testing/selftests/x86/Makefile
> b/tools/testing/selftests/x86/Makefile
> index 29089b2..48b2406 100644
> --- a/tools/testing/selftests/x86/Makefile
> +++ b/tools/testing/selftests/x86/Makefile
> @@ -32,7 +32,7 @@ all_32: $(BINARIES_32)
> all_64: $(BINARIES_64)
> 
> clean:
> -	$(RM) $(BINARIES_32) $(BINARIES_64)
> +	rm -f $(BINARIES_32) $(BINARIES_64)
> 
> $(TARGETS_C_32BIT_ALL:%=%_32): %_32: %.c
> 	$(CC) -m32 -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl
> diff --git a/tools/testing/selftests/zram/Makefile
> b/tools/testing/selftests/zram/Makefile
> index 29d8034..e1591c8 100644
> --- a/tools/testing/selftests/zram/Makefile
> +++ b/tools/testing/selftests/zram/Makefile
> @@ -6,4 +6,4 @@ TEST_FILES := zram01.sh zram02.sh zram_lib.sh
> include ../lib.mk
> 
> clean:
> -	$(RM) err.log
> +	rm -f err.log
> --
> 1.8.3.4

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH] kselftest: replace $(RM) with rm -f command
  2015-09-28  3:16             ` Mathieu Desnoyers
  (?)
@ 2015-09-28  5:11             ` Cam Hutchison
  -1 siblings, 0 replies; 25+ messages in thread
From: Cam Hutchison @ 2015-09-28  5:11 UTC (permalink / raw)
  To: linux-kernel

Mathieu Desnoyers <mathieu.desnoyers@efficios.com> writes:

>----- On Sep 27, 2015, at 10:10 PM, Wang Long long.wanglong@huawei.com wrote:

>> Some test's Makefile using "$(RM)" while the other's
>> using "rm -f". It is better to use one of them in all
>> tests.

>I agree that this disparity appears to be unwanted. We
>should settle on one or the other.

>> 
>> "rm -f" is better, because it is less magic, and everyone
>> konws what is does.

>"$(RM)" is clearly defined as a Makefile implicit variable
>which defaults to "rm -f".
>Ref. https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html

>Leaving it as a variable is more flexible because then the
>default behavior can be overridden if need be, which is
>not the case of a hardcoded "rm -f".

And you're also possibly less likely to get errors like below...

>Following your line of argumentation, we should then
>invoke "gcc" directly in every Makefile because it is
>less magic than "$(CC)". This makes no sense.

>Thanks,

>Mathieu

>> 
>> Signed-off-by: Wang Long <long.wanglong@huawei.com>
>> ---
>> tools/testing/selftests/capabilities/Makefile | 2 +-
>> tools/testing/selftests/kcmp/Makefile         | 2 +-
>> tools/testing/selftests/membarrier/Makefile   | 2 +-
>> tools/testing/selftests/memfd/Makefile        | 2 +-
>> tools/testing/selftests/net/Makefile          | 2 +-
>> tools/testing/selftests/seccomp/Makefile      | 2 +-
>> tools/testing/selftests/size/Makefile         | 2 +-
>> tools/testing/selftests/vm/Makefile           | 2 +-
>> tools/testing/selftests/x86/Makefile          | 2 +-
>> tools/testing/selftests/zram/Makefile         | 2 +-
>> 10 files changed, 10 insertions(+), 10 deletions(-)
>> 
>> diff --git a/tools/testing/selftests/capabilities/Makefile
>> b/tools/testing/selftests/capabilities/Makefile
>> index 8c8f0c1..dcc1972 100644
>> --- a/tools/testing/selftests/capabilities/Makefile
>> +++ b/tools/testing/selftests/capabilities/Makefile
>> @@ -12,7 +12,7 @@ CFLAGS := -O2 -g -std=gnu99 -Wall -lcap-ng
>> all: $(TARGETS)
>> 
>> clean:
>> -	$(RM) $(TARGETS)
>> +	rm -f $(TARGETS)
>> 
>> $(TARGETS): %: %.c
>> 	$(CC) -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl
>> diff --git a/tools/testing/selftests/kcmp/Makefile
>> b/tools/testing/selftests/kcmp/Makefile
>> index 2ae7450..2deaee0 100644
>> --- a/tools/testing/selftests/kcmp/Makefile
>> +++ b/tools/testing/selftests/kcmp/Makefile
>> @@ -7,4 +7,4 @@ TEST_PROGS := kcmp_test
>> include ../lib.mk
>> 
>> clean:
>> -	$(RM) kcmp_test kcmp-test-file
>> +	rn -f kcmp_test kcmp-test-file

s/rn/rm/


>> diff --git a/tools/testing/selftests/membarrier/Makefile
>> b/tools/testing/selftests/membarrier/Makefile
>> index a1a9708..f23fc58 100644
>> --- a/tools/testing/selftests/membarrier/Makefile
>> +++ b/tools/testing/selftests/membarrier/Makefile
>> @@ -7,4 +7,4 @@ all: $(TEST_PROGS)
>> include ../lib.mk
>> 
>> clean:
>> -	$(RM) $(TEST_PROGS)
>> +	rm -f $(TEST_PROGS)
>> diff --git a/tools/testing/selftests/memfd/Makefile
>> b/tools/testing/selftests/memfd/Makefile
>> index 3e7eb79..068fa93 100644
>> --- a/tools/testing/selftests/memfd/Makefile
>> +++ b/tools/testing/selftests/memfd/Makefile
>> @@ -19,4 +19,4 @@ run_fuse: build_fuse
>> 	@./run_fuse_test.sh || echo "fuse_test: [FAIL]"
>> 
>> clean:
>> -	$(RM) memfd_test fuse_test
>> +	rm -f memfd_test fuse_test
>> diff --git a/tools/testing/selftests/net/Makefile
>> b/tools/testing/selftests/net/Makefile
>> index fac4782..ec7eaa4 100644
>> --- a/tools/testing/selftests/net/Makefile
>> +++ b/tools/testing/selftests/net/Makefile
>> @@ -16,4 +16,4 @@ TEST_FILES := $(NET_PROGS)
>> include ../lib.mk
>> 
>> clean:
>> -	$(RM) $(NET_PROGS)
>> +	rm -f $(NET_PROGS)
>> diff --git a/tools/testing/selftests/seccomp/Makefile
>> b/tools/testing/selftests/seccomp/Makefile
>> index 8401e87..c16072a 100644
>> --- a/tools/testing/selftests/seccomp/Makefile
>> +++ b/tools/testing/selftests/seccomp/Makefile
>> @@ -7,4 +7,4 @@ all: $(TEST_PROGS)
>> include ../lib.mk
>> 
>> clean:
>> -	$(RM) $(TEST_PROGS)
>> +	rm -f $(TEST_PROGS)
>> diff --git a/tools/testing/selftests/size/Makefile
>> b/tools/testing/selftests/size/Makefile
>> index bbd0b53..cefe914 100644
>> --- a/tools/testing/selftests/size/Makefile
>> +++ b/tools/testing/selftests/size/Makefile
>> @@ -8,4 +8,4 @@ TEST_PROGS := get_size
>> include ../lib.mk
>> 
>> clean:
>> -	$(RM) get_size
>> +	rm -f get_size
>> diff --git a/tools/testing/selftests/vm/Makefile
>> b/tools/testing/selftests/vm/Makefile
>> index 3c53cac..26663c7 100644
>> --- a/tools/testing/selftests/vm/Makefile
>> +++ b/tools/testing/selftests/vm/Makefile
>> @@ -24,4 +24,4 @@ TEST_FILES := $(BINARIES)
>> include ../lib.mk
>> 
>> clean:
>> -	$(RM) $(BINARIES)
>> +	rm -f $(BINARIES)
>> diff --git a/tools/testing/selftests/x86/Makefile
>> b/tools/testing/selftests/x86/Makefile
>> index 29089b2..48b2406 100644
>> --- a/tools/testing/selftests/x86/Makefile
>> +++ b/tools/testing/selftests/x86/Makefile
>> @@ -32,7 +32,7 @@ all_32: $(BINARIES_32)
>> all_64: $(BINARIES_64)
>> 
>> clean:
>> -	$(RM) $(BINARIES_32) $(BINARIES_64)
>> +	rm -f $(BINARIES_32) $(BINARIES_64)
>> 
>> $(TARGETS_C_32BIT_ALL:%=%_32): %_32: %.c
>> 	$(CC) -m32 -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl
>> diff --git a/tools/testing/selftests/zram/Makefile
>> b/tools/testing/selftests/zram/Makefile
>> index 29d8034..e1591c8 100644
>> --- a/tools/testing/selftests/zram/Makefile
>> +++ b/tools/testing/selftests/zram/Makefile
>> @@ -6,4 +6,4 @@ TEST_FILES := zram01.sh zram02.sh zram_lib.sh
>> include ../lib.mk
>> 
>> clean:
>> -	$(RM) err.log
>> +	rm -f err.log
>> --
>> 1.8.3.4

>-- 
>Mathieu Desnoyers
>EfficiOS Inc.
>http://www.efficios.com
>--
>To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
>Please read the FAQ at  http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH] kselftest: replace $(RM) with rm -f command
@ 2015-09-28  7:26             ` Yuan Sun
  0 siblings, 0 replies; 25+ messages in thread
From: Yuan Sun @ 2015-09-28  7:26 UTC (permalink / raw)
  To: Wang Long, shuahkh, dvhart, mpe
  Cc: keescook, davem, luto, wad, akpm, gorcunov, cov,
	mathieu.desnoyers, bobby.prani, tyler.baker, tim.bird, josh,
	aarcange, andrej.skvortzov, sjayaram, treding, mingo,
	naresh.kamboju, alexey.kodanev, linux-api, linux-kernel,
	wanglong, peifeiyue

See the in-line comment.
On 2015/9/28 10:10, Wang Long wrote:
> Some test's Makefile using "$(RM)" while the other's
> using "rm -f". It is better to use one of them in all
> tests.
>
> "rm -f" is better, because it is less magic, and everyone
> konws what is does.
>
> Signed-off-by: Wang Long <long.wanglong@huawei.com>
> ---
>   tools/testing/selftests/capabilities/Makefile | 2 +-
>   tools/testing/selftests/kcmp/Makefile         | 2 +-
>   tools/testing/selftests/membarrier/Makefile   | 2 +-
>   tools/testing/selftests/memfd/Makefile        | 2 +-
>   tools/testing/selftests/net/Makefile          | 2 +-
>   tools/testing/selftests/seccomp/Makefile      | 2 +-
>   tools/testing/selftests/size/Makefile         | 2 +-
>   tools/testing/selftests/vm/Makefile           | 2 +-
>   tools/testing/selftests/x86/Makefile          | 2 +-
>   tools/testing/selftests/zram/Makefile         | 2 +-
>   10 files changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/tools/testing/selftests/capabilities/Makefile b/tools/testing/selftests/capabilities/Makefile
> index 8c8f0c1..dcc1972 100644
> --- a/tools/testing/selftests/capabilities/Makefile
> +++ b/tools/testing/selftests/capabilities/Makefile
> @@ -12,7 +12,7 @@ CFLAGS := -O2 -g -std=gnu99 -Wall -lcap-ng
>   all: $(TARGETS)
>   
>   clean:
> -	$(RM) $(TARGETS)
> +	rm -f $(TARGETS)
>   
>   $(TARGETS): %: %.c
>   	$(CC) -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl
> diff --git a/tools/testing/selftests/kcmp/Makefile b/tools/testing/selftests/kcmp/Makefile
> index 2ae7450..2deaee0 100644
> --- a/tools/testing/selftests/kcmp/Makefile
> +++ b/tools/testing/selftests/kcmp/Makefile
> @@ -7,4 +7,4 @@ TEST_PROGS := kcmp_test
>   include ../lib.mk
>   
>   clean:
> -	$(RM) kcmp_test kcmp-test-file
> +	rn -f kcmp_test kcmp-test-file
It should be rm, not rn.
> diff --git a/tools/testing/selftests/membarrier/Makefile b/tools/testing/selftests/membarrier/Makefile
> index a1a9708..f23fc58 100644
> --- a/tools/testing/selftests/membarrier/Makefile
> +++ b/tools/testing/selftests/membarrier/Makefile
> @@ -7,4 +7,4 @@ all: $(TEST_PROGS)
>   include ../lib.mk
>   
>   clean:
> -	$(RM) $(TEST_PROGS)
> +	rm -f $(TEST_PROGS)
> diff --git a/tools/testing/selftests/memfd/Makefile b/tools/testing/selftests/memfd/Makefile
> index 3e7eb79..068fa93 100644
> --- a/tools/testing/selftests/memfd/Makefile
> +++ b/tools/testing/selftests/memfd/Makefile
> @@ -19,4 +19,4 @@ run_fuse: build_fuse
>   	@./run_fuse_test.sh || echo "fuse_test: [FAIL]"
>   
>   clean:
> -	$(RM) memfd_test fuse_test
> +	rm -f memfd_test fuse_test
> diff --git a/tools/testing/selftests/net/Makefile b/tools/testing/selftests/net/Makefile
> index fac4782..ec7eaa4 100644
> --- a/tools/testing/selftests/net/Makefile
> +++ b/tools/testing/selftests/net/Makefile
> @@ -16,4 +16,4 @@ TEST_FILES := $(NET_PROGS)
>   include ../lib.mk
>   
>   clean:
> -	$(RM) $(NET_PROGS)
> +	rm -f $(NET_PROGS)
> diff --git a/tools/testing/selftests/seccomp/Makefile b/tools/testing/selftests/seccomp/Makefile
> index 8401e87..c16072a 100644
> --- a/tools/testing/selftests/seccomp/Makefile
> +++ b/tools/testing/selftests/seccomp/Makefile
> @@ -7,4 +7,4 @@ all: $(TEST_PROGS)
>   include ../lib.mk
>   
>   clean:
> -	$(RM) $(TEST_PROGS)
> +	rm -f $(TEST_PROGS)
> diff --git a/tools/testing/selftests/size/Makefile b/tools/testing/selftests/size/Makefile
> index bbd0b53..cefe914 100644
> --- a/tools/testing/selftests/size/Makefile
> +++ b/tools/testing/selftests/size/Makefile
> @@ -8,4 +8,4 @@ TEST_PROGS := get_size
>   include ../lib.mk
>   
>   clean:
> -	$(RM) get_size
> +	rm -f get_size
> diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile
> index 3c53cac..26663c7 100644
> --- a/tools/testing/selftests/vm/Makefile
> +++ b/tools/testing/selftests/vm/Makefile
> @@ -24,4 +24,4 @@ TEST_FILES := $(BINARIES)
>   include ../lib.mk
>   
>   clean:
> -	$(RM) $(BINARIES)
> +	rm -f $(BINARIES)
> diff --git a/tools/testing/selftests/x86/Makefile b/tools/testing/selftests/x86/Makefile
> index 29089b2..48b2406 100644
> --- a/tools/testing/selftests/x86/Makefile
> +++ b/tools/testing/selftests/x86/Makefile
> @@ -32,7 +32,7 @@ all_32: $(BINARIES_32)
>   all_64: $(BINARIES_64)
>   
>   clean:
> -	$(RM) $(BINARIES_32) $(BINARIES_64)
> +	rm -f $(BINARIES_32) $(BINARIES_64)
>   
>   $(TARGETS_C_32BIT_ALL:%=%_32): %_32: %.c
>   	$(CC) -m32 -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl
> diff --git a/tools/testing/selftests/zram/Makefile b/tools/testing/selftests/zram/Makefile
> index 29d8034..e1591c8 100644
> --- a/tools/testing/selftests/zram/Makefile
> +++ b/tools/testing/selftests/zram/Makefile
> @@ -6,4 +6,4 @@ TEST_FILES := zram01.sh zram02.sh zram_lib.sh
>   include ../lib.mk
>   
>   clean:
> -	$(RM) err.log
> +	rm -f err.log


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH] kselftest: replace $(RM) with rm -f command
@ 2015-09-28  7:26             ` Yuan Sun
  0 siblings, 0 replies; 25+ messages in thread
From: Yuan Sun @ 2015-09-28  7:26 UTC (permalink / raw)
  To: Wang Long, shuahkh-JPH+aEBZ4P+UEJcrhfAQsw,
	dvhart-wEGCiKHe2LqWVfeAwA7xHQ, mpe-Gsx/Oe8HsFggBc27wqDAHg
  Cc: keescook-F7+t8E8rja9g9hUCZPvPmw, davem-fT/PcQaiUtIeIZ0/mPfg9Q,
	luto-kltTT9wpgjJwATOyAt5JVQ, wad-F7+t8E8rja9g9hUCZPvPmw,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
	gorcunov-GEFAQzZX7r8dnm+yROfE0A, cov-sgV2jX0FEOL9JmXXK+q4OQ,
	mathieu.desnoyers-vg+e7yoeK/dWk0Htik3J/w,
	bobby.prani-Re5JQEeQqe8AvxtiuMwx3w,
	tyler.baker-QSEj5FYQhm4dnm+yROfE0A,
	tim.bird-/MT0OVThwyLZJqsBc5GL+g, josh-iaAMLnmF4UmaiuxdJuQwMA,
	aarcange-H+wXaHxf7aLQT0dZR+AlfA,
	andrej.skvortzov-Re5JQEeQqe8AvxtiuMwx3w,
	sjayaram-JqFfY2XvxFXQT0dZR+AlfA, treding-DDmLM1+adcrQT0dZR+AlfA,
	mingo-DgEjT+Ai2ygdnm+yROfE0A,
	naresh.kamboju-QSEj5FYQhm4dnm+yROfE0A,
	alexey.kodanev-QHcLZuEGTsvQT0dZR+AlfA,
	linux-api-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	wanglong-m92B/FuLcaEcWVvVuXF20w,
	peifeiyue-hv44wF8Li93QT0dZR+AlfA

See the in-line comment.
On 2015/9/28 10:10, Wang Long wrote:
> Some test's Makefile using "$(RM)" while the other's
> using "rm -f". It is better to use one of them in all
> tests.
>
> "rm -f" is better, because it is less magic, and everyone
> konws what is does.
>
> Signed-off-by: Wang Long <long.wanglong-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
> ---
>   tools/testing/selftests/capabilities/Makefile | 2 +-
>   tools/testing/selftests/kcmp/Makefile         | 2 +-
>   tools/testing/selftests/membarrier/Makefile   | 2 +-
>   tools/testing/selftests/memfd/Makefile        | 2 +-
>   tools/testing/selftests/net/Makefile          | 2 +-
>   tools/testing/selftests/seccomp/Makefile      | 2 +-
>   tools/testing/selftests/size/Makefile         | 2 +-
>   tools/testing/selftests/vm/Makefile           | 2 +-
>   tools/testing/selftests/x86/Makefile          | 2 +-
>   tools/testing/selftests/zram/Makefile         | 2 +-
>   10 files changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/tools/testing/selftests/capabilities/Makefile b/tools/testing/selftests/capabilities/Makefile
> index 8c8f0c1..dcc1972 100644
> --- a/tools/testing/selftests/capabilities/Makefile
> +++ b/tools/testing/selftests/capabilities/Makefile
> @@ -12,7 +12,7 @@ CFLAGS := -O2 -g -std=gnu99 -Wall -lcap-ng
>   all: $(TARGETS)
>   
>   clean:
> -	$(RM) $(TARGETS)
> +	rm -f $(TARGETS)
>   
>   $(TARGETS): %: %.c
>   	$(CC) -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl
> diff --git a/tools/testing/selftests/kcmp/Makefile b/tools/testing/selftests/kcmp/Makefile
> index 2ae7450..2deaee0 100644
> --- a/tools/testing/selftests/kcmp/Makefile
> +++ b/tools/testing/selftests/kcmp/Makefile
> @@ -7,4 +7,4 @@ TEST_PROGS := kcmp_test
>   include ../lib.mk
>   
>   clean:
> -	$(RM) kcmp_test kcmp-test-file
> +	rn -f kcmp_test kcmp-test-file
It should be rm, not rn.
> diff --git a/tools/testing/selftests/membarrier/Makefile b/tools/testing/selftests/membarrier/Makefile
> index a1a9708..f23fc58 100644
> --- a/tools/testing/selftests/membarrier/Makefile
> +++ b/tools/testing/selftests/membarrier/Makefile
> @@ -7,4 +7,4 @@ all: $(TEST_PROGS)
>   include ../lib.mk
>   
>   clean:
> -	$(RM) $(TEST_PROGS)
> +	rm -f $(TEST_PROGS)
> diff --git a/tools/testing/selftests/memfd/Makefile b/tools/testing/selftests/memfd/Makefile
> index 3e7eb79..068fa93 100644
> --- a/tools/testing/selftests/memfd/Makefile
> +++ b/tools/testing/selftests/memfd/Makefile
> @@ -19,4 +19,4 @@ run_fuse: build_fuse
>   	@./run_fuse_test.sh || echo "fuse_test: [FAIL]"
>   
>   clean:
> -	$(RM) memfd_test fuse_test
> +	rm -f memfd_test fuse_test
> diff --git a/tools/testing/selftests/net/Makefile b/tools/testing/selftests/net/Makefile
> index fac4782..ec7eaa4 100644
> --- a/tools/testing/selftests/net/Makefile
> +++ b/tools/testing/selftests/net/Makefile
> @@ -16,4 +16,4 @@ TEST_FILES := $(NET_PROGS)
>   include ../lib.mk
>   
>   clean:
> -	$(RM) $(NET_PROGS)
> +	rm -f $(NET_PROGS)
> diff --git a/tools/testing/selftests/seccomp/Makefile b/tools/testing/selftests/seccomp/Makefile
> index 8401e87..c16072a 100644
> --- a/tools/testing/selftests/seccomp/Makefile
> +++ b/tools/testing/selftests/seccomp/Makefile
> @@ -7,4 +7,4 @@ all: $(TEST_PROGS)
>   include ../lib.mk
>   
>   clean:
> -	$(RM) $(TEST_PROGS)
> +	rm -f $(TEST_PROGS)
> diff --git a/tools/testing/selftests/size/Makefile b/tools/testing/selftests/size/Makefile
> index bbd0b53..cefe914 100644
> --- a/tools/testing/selftests/size/Makefile
> +++ b/tools/testing/selftests/size/Makefile
> @@ -8,4 +8,4 @@ TEST_PROGS := get_size
>   include ../lib.mk
>   
>   clean:
> -	$(RM) get_size
> +	rm -f get_size
> diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile
> index 3c53cac..26663c7 100644
> --- a/tools/testing/selftests/vm/Makefile
> +++ b/tools/testing/selftests/vm/Makefile
> @@ -24,4 +24,4 @@ TEST_FILES := $(BINARIES)
>   include ../lib.mk
>   
>   clean:
> -	$(RM) $(BINARIES)
> +	rm -f $(BINARIES)
> diff --git a/tools/testing/selftests/x86/Makefile b/tools/testing/selftests/x86/Makefile
> index 29089b2..48b2406 100644
> --- a/tools/testing/selftests/x86/Makefile
> +++ b/tools/testing/selftests/x86/Makefile
> @@ -32,7 +32,7 @@ all_32: $(BINARIES_32)
>   all_64: $(BINARIES_64)
>   
>   clean:
> -	$(RM) $(BINARIES_32) $(BINARIES_64)
> +	rm -f $(BINARIES_32) $(BINARIES_64)
>   
>   $(TARGETS_C_32BIT_ALL:%=%_32): %_32: %.c
>   	$(CC) -m32 -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl
> diff --git a/tools/testing/selftests/zram/Makefile b/tools/testing/selftests/zram/Makefile
> index 29d8034..e1591c8 100644
> --- a/tools/testing/selftests/zram/Makefile
> +++ b/tools/testing/selftests/zram/Makefile
> @@ -6,4 +6,4 @@ TEST_FILES := zram01.sh zram02.sh zram_lib.sh
>   include ../lib.mk
>   
>   clean:
> -	$(RM) err.log
> +	rm -f err.log

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH] kselftest: replace $(RM) with rm -f command
@ 2015-09-29  9:57               ` Michael Ellerman
  0 siblings, 0 replies; 25+ messages in thread
From: Michael Ellerman @ 2015-09-29  9:57 UTC (permalink / raw)
  To: Mathieu Desnoyers
  Cc: Wang Long, shuahkh, dvhart, keescook, davem, luto, wad,
	Andrew Morton, gorcunov, cov, bobby prani, tyler baker, Tim Bird,
	josh, Andrea Arcangeli, andrej skvortzov, sjayaram, treding,
	Ingo Molnar, naresh kamboju, alexey kodanev, linux-api,
	linux-kernel, wanglong

On Mon, 2015-09-28 at 03:16 +0000, Mathieu Desnoyers wrote:
> ----- On Sep 27, 2015, at 10:10 PM, Wang Long long.wanglong@huawei.com wrote:
> 
> > Some test's Makefile using "$(RM)" while the other's
> > using "rm -f". It is better to use one of them in all
> > tests.
> 
> I agree that this disparity appears to be unwanted. We
> should settle on one or the other.
> 
> > "rm -f" is better, because it is less magic, and everyone
> > konws what is does.
> 
> "$(RM)" is clearly defined as a Makefile implicit variable
> which defaults to "rm -f".
> Ref. https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html

Sure, but you had to look it up didn't you :) - I did.

> Leaving it as a variable is more flexible because then the
> default behavior can be overridden if need be, which is
> not the case of a hardcoded "rm -f".

But I don't think anyone actually wants to do that. Do they?

Anyway I don't really care either way, so I'm happy for you to do a patch that
uses $(RM). Or maybe Wang Long will be happy to respin his patch to use $(RM).

cheers



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH] kselftest: replace $(RM) with rm -f command
@ 2015-09-29  9:57               ` Michael Ellerman
  0 siblings, 0 replies; 25+ messages in thread
From: Michael Ellerman @ 2015-09-29  9:57 UTC (permalink / raw)
  To: Mathieu Desnoyers
  Cc: Wang Long, shuahkh-JPH+aEBZ4P+UEJcrhfAQsw,
	dvhart-wEGCiKHe2LqWVfeAwA7xHQ, keescook-F7+t8E8rja9g9hUCZPvPmw,
	davem-fT/PcQaiUtIeIZ0/mPfg9Q, luto-kltTT9wpgjJwATOyAt5JVQ,
	wad-F7+t8E8rja9g9hUCZPvPmw, Andrew Morton,
	gorcunov-GEFAQzZX7r8dnm+yROfE0A, cov-sgV2jX0FEOL9JmXXK+q4OQ,
	bobby prani, tyler baker, Tim Bird, josh-iaAMLnmF4UmaiuxdJuQwMA,
	Andrea Arcangeli, andrej skvortzov,
	sjayaram-JqFfY2XvxFXQT0dZR+AlfA, treding-DDmLM1+adcrQT0dZR+AlfA,
	Ingo Molnar, naresh kamboju, alexey kodanev, linux-api,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	wanglong-m92B/FuLcaEcWVvVuXF20w

On Mon, 2015-09-28 at 03:16 +0000, Mathieu Desnoyers wrote:
> ----- On Sep 27, 2015, at 10:10 PM, Wang Long long.wanglong-hv44wF8Li93QT0dZR+AlfA@public.gmane.org wrote:
> 
> > Some test's Makefile using "$(RM)" while the other's
> > using "rm -f". It is better to use one of them in all
> > tests.
> 
> I agree that this disparity appears to be unwanted. We
> should settle on one or the other.
> 
> > "rm -f" is better, because it is less magic, and everyone
> > konws what is does.
> 
> "$(RM)" is clearly defined as a Makefile implicit variable
> which defaults to "rm -f".
> Ref. https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html

Sure, but you had to look it up didn't you :) - I did.

> Leaving it as a variable is more flexible because then the
> default behavior can be overridden if need be, which is
> not the case of a hardcoded "rm -f".

But I don't think anyone actually wants to do that. Do they?

Anyway I don't really care either way, so I'm happy for you to do a patch that
uses $(RM). Or maybe Wang Long will be happy to respin his patch to use $(RM).

cheers

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [PATCH] kselftest: replace rm -f command with $(RM)
@ 2015-09-29 11:21                 ` Wang Long
  0 siblings, 0 replies; 25+ messages in thread
From: Wang Long @ 2015-09-29 11:21 UTC (permalink / raw)
  To: shuahkh, mpe, mathieu.desnoyers
  Cc: john.stultz, tglx, long.wanglong, dvhart, tyler.baker, anton,
	gkurz, khandual, paulus, sam.bobroff, linux-api, linux-kernel,
	wanglong, peifeiyue

Some test's Makefile using "$(RM)" while the other's
using "rm -f". It is better to use one of them in all
tests.

"$(RM)" is clearly defined as a Makefile implicit variable
which defaults to "rm -f".
Ref. https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html

Signed-off-by: Wang Long <long.wanglong@huawei.com>
---
 tools/testing/selftests/breakpoints/Makefile           | 2 +-
 tools/testing/selftests/efivarfs/Makefile              | 2 +-
 tools/testing/selftests/futex/functional/Makefile      | 2 +-
 tools/testing/selftests/ipc/Makefile                   | 2 +-
 tools/testing/selftests/mount/Makefile                 | 2 +-
 tools/testing/selftests/mqueue/Makefile                | 2 +-
 tools/testing/selftests/powerpc/Makefile               | 2 +-
 tools/testing/selftests/powerpc/copyloops/Makefile     | 2 +-
 tools/testing/selftests/powerpc/dscr/Makefile          | 2 +-
 tools/testing/selftests/powerpc/mm/Makefile            | 2 +-
 tools/testing/selftests/powerpc/pmu/Makefile           | 2 +-
 tools/testing/selftests/powerpc/pmu/ebb/Makefile       | 2 +-
 tools/testing/selftests/powerpc/primitives/Makefile    | 2 +-
 tools/testing/selftests/powerpc/stringloops/Makefile   | 2 +-
 tools/testing/selftests/powerpc/switch_endian/Makefile | 2 +-
 tools/testing/selftests/powerpc/tm/Makefile            | 2 +-
 tools/testing/selftests/powerpc/vphn/Makefile          | 2 +-
 tools/testing/selftests/ptrace/Makefile                | 2 +-
 tools/testing/selftests/timers/Makefile                | 2 +-
 19 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/tools/testing/selftests/breakpoints/Makefile b/tools/testing/selftests/breakpoints/Makefile
index d27108b..731bd31 100644
--- a/tools/testing/selftests/breakpoints/Makefile
+++ b/tools/testing/selftests/breakpoints/Makefile
@@ -11,4 +11,4 @@ all:
 include ../lib.mk
 
 clean:
-	rm -fr breakpoint_test
+	$(RM) breakpoint_test
diff --git a/tools/testing/selftests/efivarfs/Makefile b/tools/testing/selftests/efivarfs/Makefile
index 736c3dd..4a1c629 100644
--- a/tools/testing/selftests/efivarfs/Makefile
+++ b/tools/testing/selftests/efivarfs/Makefile
@@ -10,4 +10,4 @@ TEST_FILES := $(test_objs)
 include ../lib.mk
 
 clean:
-	rm -f $(test_objs)
+	$(RM) $(test_objs)
diff --git a/tools/testing/selftests/futex/functional/Makefile b/tools/testing/selftests/futex/functional/Makefile
index 9d6b75e..391d328 100644
--- a/tools/testing/selftests/futex/functional/Makefile
+++ b/tools/testing/selftests/futex/functional/Makefile
@@ -22,4 +22,4 @@ $(TARGETS): $(HEADERS)
 include ../../lib.mk
 
 clean:
-	rm -f $(TARGETS)
+	$(RM) $(TARGETS)
diff --git a/tools/testing/selftests/ipc/Makefile b/tools/testing/selftests/ipc/Makefile
index 25d2e70..071a706 100644
--- a/tools/testing/selftests/ipc/Makefile
+++ b/tools/testing/selftests/ipc/Makefile
@@ -19,4 +19,4 @@ TEST_PROGS := msgque_test
 include ../lib.mk
 
 clean:
-	rm -fr ./msgque_test
+	$(RM) ./msgque_test
diff --git a/tools/testing/selftests/mount/Makefile b/tools/testing/selftests/mount/Makefile
index 5e35c9c..9629382 100644
--- a/tools/testing/selftests/mount/Makefile
+++ b/tools/testing/selftests/mount/Makefile
@@ -18,4 +18,4 @@ override RUN_TESTS := if [ -f /proc/self/uid_map ] ; \
 override EMIT_TESTS := echo "$(RUN_TESTS)"
 
 clean:
-	rm -f unprivileged-remount-test
+	$(RM) unprivileged-remount-test
diff --git a/tools/testing/selftests/mqueue/Makefile b/tools/testing/selftests/mqueue/Makefile
index eebac29..d61b987 100644
--- a/tools/testing/selftests/mqueue/Makefile
+++ b/tools/testing/selftests/mqueue/Makefile
@@ -17,4 +17,4 @@ override define EMIT_TESTS
 endef
 
 clean:
-	rm -f mq_open_tests mq_perf_tests
+	$(RM) mq_open_tests mq_perf_tests
diff --git a/tools/testing/selftests/powerpc/Makefile b/tools/testing/selftests/powerpc/Makefile
index 03ca2e6..91aa06d 100644
--- a/tools/testing/selftests/powerpc/Makefile
+++ b/tools/testing/selftests/powerpc/Makefile
@@ -45,7 +45,7 @@ clean:
 	@for TARGET in $(SUB_DIRS); do \
 		$(MAKE) -C $$TARGET clean; \
 	done;
-	rm -f tags
+	$(RM) tags
 
 tags:
 	find . -name '*.c' -o -name '*.h' | xargs ctags
diff --git a/tools/testing/selftests/powerpc/copyloops/Makefile b/tools/testing/selftests/powerpc/copyloops/Makefile
index 384843e..28d6d6c 100644
--- a/tools/testing/selftests/powerpc/copyloops/Makefile
+++ b/tools/testing/selftests/powerpc/copyloops/Makefile
@@ -22,4 +22,4 @@ $(TEST_PROGS): $(EXTRA_SOURCES)
 include ../../lib.mk
 
 clean:
-	rm -f $(TEST_PROGS) *.o
+	$(RM) $(TEST_PROGS) *.o
diff --git a/tools/testing/selftests/powerpc/dscr/Makefile b/tools/testing/selftests/powerpc/dscr/Makefile
index 49327ee..d32a66e 100644
--- a/tools/testing/selftests/powerpc/dscr/Makefile
+++ b/tools/testing/selftests/powerpc/dscr/Makefile
@@ -11,4 +11,4 @@ $(TEST_PROGS): ../harness.c
 include ../../lib.mk
 
 clean:
-	rm -f $(TEST_PROGS) *.o
+	$(RM) $(TEST_PROGS) *.o
diff --git a/tools/testing/selftests/powerpc/mm/Makefile b/tools/testing/selftests/powerpc/mm/Makefile
index ee179e2..7f63469 100644
--- a/tools/testing/selftests/powerpc/mm/Makefile
+++ b/tools/testing/selftests/powerpc/mm/Makefile
@@ -14,4 +14,4 @@ tempfile:
 	dd if=/dev/zero of=tempfile bs=64k count=1
 
 clean:
-	rm -f $(TEST_PROGS) tempfile
+	$(RM) $(TEST_PROGS) tempfile
diff --git a/tools/testing/selftests/powerpc/pmu/Makefile b/tools/testing/selftests/powerpc/pmu/Makefile
index a9099d9..170f3a6 100644
--- a/tools/testing/selftests/powerpc/pmu/Makefile
+++ b/tools/testing/selftests/powerpc/pmu/Makefile
@@ -33,7 +33,7 @@ override define INSTALL_RULE
 endef
 
 clean:
-	rm -f $(TEST_PROGS) loop.o
+	$(RM) $(TEST_PROGS) loop.o
 	$(MAKE) -C ebb clean
 
 ebb:
diff --git a/tools/testing/selftests/powerpc/pmu/ebb/Makefile b/tools/testing/selftests/powerpc/pmu/ebb/Makefile
index 5cdc9db..977875f 100644
--- a/tools/testing/selftests/powerpc/pmu/ebb/Makefile
+++ b/tools/testing/selftests/powerpc/pmu/ebb/Makefile
@@ -27,4 +27,4 @@ lost_exception_test: ../lib.c
 include ../../../lib.mk
 
 clean:
-	rm -f $(TEST_PROGS)
+	$(RM) $(TEST_PROGS)
diff --git a/tools/testing/selftests/powerpc/primitives/Makefile b/tools/testing/selftests/powerpc/primitives/Makefile
index b68c622..2261bd1 100644
--- a/tools/testing/selftests/powerpc/primitives/Makefile
+++ b/tools/testing/selftests/powerpc/primitives/Makefile
@@ -9,4 +9,4 @@ $(TEST_PROGS): ../harness.c
 include ../../lib.mk
 
 clean:
-	rm -f $(TEST_PROGS) *.o
+	$(RM) $(TEST_PROGS) *.o
diff --git a/tools/testing/selftests/powerpc/stringloops/Makefile b/tools/testing/selftests/powerpc/stringloops/Makefile
index 2a728f4..ea89afd 100644
--- a/tools/testing/selftests/powerpc/stringloops/Makefile
+++ b/tools/testing/selftests/powerpc/stringloops/Makefile
@@ -12,4 +12,4 @@ $(TEST_PROGS): $(EXTRA_SOURCES)
 include ../../lib.mk
 
 clean:
-	rm -f $(TEST_PROGS) *.o
+	$(RM) $(TEST_PROGS) *.o
diff --git a/tools/testing/selftests/powerpc/switch_endian/Makefile b/tools/testing/selftests/powerpc/switch_endian/Makefile
index e21d106..6cfe0f0 100644
--- a/tools/testing/selftests/powerpc/switch_endian/Makefile
+++ b/tools/testing/selftests/powerpc/switch_endian/Makefile
@@ -15,4 +15,4 @@ check-reversed.S: check-reversed.o
 include ../../lib.mk
 
 clean:
-	rm -f $(TEST_PROGS) *.o check-reversed.S
+	$(RM) $(TEST_PROGS) *.o check-reversed.S
diff --git a/tools/testing/selftests/powerpc/tm/Makefile b/tools/testing/selftests/powerpc/tm/Makefile
index 4bea62a..f04bd4b 100644
--- a/tools/testing/selftests/powerpc/tm/Makefile
+++ b/tools/testing/selftests/powerpc/tm/Makefile
@@ -10,4 +10,4 @@ tm-syscall: CFLAGS += -mhtm -I../../../../../usr/include
 include ../../lib.mk
 
 clean:
-	rm -f $(TEST_PROGS) *.o
+	$(RM) $(TEST_PROGS) *.o
diff --git a/tools/testing/selftests/powerpc/vphn/Makefile b/tools/testing/selftests/powerpc/vphn/Makefile
index a485f2e..d98f32c 100644
--- a/tools/testing/selftests/powerpc/vphn/Makefile
+++ b/tools/testing/selftests/powerpc/vphn/Makefile
@@ -9,4 +9,4 @@ $(TEST_PROGS): ../harness.c
 include ../../lib.mk
 
 clean:
-	rm -f $(TEST_PROGS)
+	$(RM) $(TEST_PROGS)
diff --git a/tools/testing/selftests/ptrace/Makefile b/tools/testing/selftests/ptrace/Makefile
index 453927f..ec5bf58 100644
--- a/tools/testing/selftests/ptrace/Makefile
+++ b/tools/testing/selftests/ptrace/Makefile
@@ -4,7 +4,7 @@ peeksiginfo: peeksiginfo.c
 all: peeksiginfo
 
 clean:
-	rm -f peeksiginfo
+	$(RM) peeksiginfo
 
 TEST_PROGS := peeksiginfo
 
diff --git a/tools/testing/selftests/timers/Makefile b/tools/testing/selftests/timers/Makefile
index 89a3f44..a5889e2 100644
--- a/tools/testing/selftests/timers/Makefile
+++ b/tools/testing/selftests/timers/Makefile
@@ -33,4 +33,4 @@ run_destructive_tests: run_tests
 	./set-2038
 
 clean:
-	rm -f ${bins}
+	$(RM) ${bins}
-- 
1.8.3.4


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH] kselftest: replace rm -f command with $(RM)
@ 2015-09-29 11:21                 ` Wang Long
  0 siblings, 0 replies; 25+ messages in thread
From: Wang Long @ 2015-09-29 11:21 UTC (permalink / raw)
  To: shuahkh-JPH+aEBZ4P+UEJcrhfAQsw, mpe-Gsx/Oe8HsFggBc27wqDAHg,
	mathieu.desnoyers-vg+e7yoeK/dWk0Htik3J/w
  Cc: john.stultz-QSEj5FYQhm4dnm+yROfE0A, tglx-hfZtesqFncYOwBW4kG4KsQ,
	long.wanglong-hv44wF8Li93QT0dZR+AlfA,
	dvhart-VuQAYsv1563Yd54FQh9/CA,
	tyler.baker-QSEj5FYQhm4dnm+yROfE0A, anton-eUNUBHrolfbYtjvyW6yDsg,
	gkurz-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8,
	khandual-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8,
	paulus-eUNUBHrolfbYtjvyW6yDsg,
	sam.bobroff-8fk3Idey6ehBDgjK7y7TUQ,
	linux-api-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

Some test's Makefile using "$(RM)" while the other's
using "rm -f". It is better to use one of them in all
tests.

"$(RM)" is clearly defined as a Makefile implicit variable
which defaults to "rm -f".
Ref. https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html

Signed-off-by: Wang Long <long.wanglong-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
---
 tools/testing/selftests/breakpoints/Makefile           | 2 +-
 tools/testing/selftests/efivarfs/Makefile              | 2 +-
 tools/testing/selftests/futex/functional/Makefile      | 2 +-
 tools/testing/selftests/ipc/Makefile                   | 2 +-
 tools/testing/selftests/mount/Makefile                 | 2 +-
 tools/testing/selftests/mqueue/Makefile                | 2 +-
 tools/testing/selftests/powerpc/Makefile               | 2 +-
 tools/testing/selftests/powerpc/copyloops/Makefile     | 2 +-
 tools/testing/selftests/powerpc/dscr/Makefile          | 2 +-
 tools/testing/selftests/powerpc/mm/Makefile            | 2 +-
 tools/testing/selftests/powerpc/pmu/Makefile           | 2 +-
 tools/testing/selftests/powerpc/pmu/ebb/Makefile       | 2 +-
 tools/testing/selftests/powerpc/primitives/Makefile    | 2 +-
 tools/testing/selftests/powerpc/stringloops/Makefile   | 2 +-
 tools/testing/selftests/powerpc/switch_endian/Makefile | 2 +-
 tools/testing/selftests/powerpc/tm/Makefile            | 2 +-
 tools/testing/selftests/powerpc/vphn/Makefile          | 2 +-
 tools/testing/selftests/ptrace/Makefile                | 2 +-
 tools/testing/selftests/timers/Makefile                | 2 +-
 19 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/tools/testing/selftests/breakpoints/Makefile b/tools/testing/selftests/breakpoints/Makefile
index d27108b..731bd31 100644
--- a/tools/testing/selftests/breakpoints/Makefile
+++ b/tools/testing/selftests/breakpoints/Makefile
@@ -11,4 +11,4 @@ all:
 include ../lib.mk
 
 clean:
-	rm -fr breakpoint_test
+	$(RM) breakpoint_test
diff --git a/tools/testing/selftests/efivarfs/Makefile b/tools/testing/selftests/efivarfs/Makefile
index 736c3dd..4a1c629 100644
--- a/tools/testing/selftests/efivarfs/Makefile
+++ b/tools/testing/selftests/efivarfs/Makefile
@@ -10,4 +10,4 @@ TEST_FILES := $(test_objs)
 include ../lib.mk
 
 clean:
-	rm -f $(test_objs)
+	$(RM) $(test_objs)
diff --git a/tools/testing/selftests/futex/functional/Makefile b/tools/testing/selftests/futex/functional/Makefile
index 9d6b75e..391d328 100644
--- a/tools/testing/selftests/futex/functional/Makefile
+++ b/tools/testing/selftests/futex/functional/Makefile
@@ -22,4 +22,4 @@ $(TARGETS): $(HEADERS)
 include ../../lib.mk
 
 clean:
-	rm -f $(TARGETS)
+	$(RM) $(TARGETS)
diff --git a/tools/testing/selftests/ipc/Makefile b/tools/testing/selftests/ipc/Makefile
index 25d2e70..071a706 100644
--- a/tools/testing/selftests/ipc/Makefile
+++ b/tools/testing/selftests/ipc/Makefile
@@ -19,4 +19,4 @@ TEST_PROGS := msgque_test
 include ../lib.mk
 
 clean:
-	rm -fr ./msgque_test
+	$(RM) ./msgque_test
diff --git a/tools/testing/selftests/mount/Makefile b/tools/testing/selftests/mount/Makefile
index 5e35c9c..9629382 100644
--- a/tools/testing/selftests/mount/Makefile
+++ b/tools/testing/selftests/mount/Makefile
@@ -18,4 +18,4 @@ override RUN_TESTS := if [ -f /proc/self/uid_map ] ; \
 override EMIT_TESTS := echo "$(RUN_TESTS)"
 
 clean:
-	rm -f unprivileged-remount-test
+	$(RM) unprivileged-remount-test
diff --git a/tools/testing/selftests/mqueue/Makefile b/tools/testing/selftests/mqueue/Makefile
index eebac29..d61b987 100644
--- a/tools/testing/selftests/mqueue/Makefile
+++ b/tools/testing/selftests/mqueue/Makefile
@@ -17,4 +17,4 @@ override define EMIT_TESTS
 endef
 
 clean:
-	rm -f mq_open_tests mq_perf_tests
+	$(RM) mq_open_tests mq_perf_tests
diff --git a/tools/testing/selftests/powerpc/Makefile b/tools/testing/selftests/powerpc/Makefile
index 03ca2e6..91aa06d 100644
--- a/tools/testing/selftests/powerpc/Makefile
+++ b/tools/testing/selftests/powerpc/Makefile
@@ -45,7 +45,7 @@ clean:
 	@for TARGET in $(SUB_DIRS); do \
 		$(MAKE) -C $$TARGET clean; \
 	done;
-	rm -f tags
+	$(RM) tags
 
 tags:
 	find . -name '*.c' -o -name '*.h' | xargs ctags
diff --git a/tools/testing/selftests/powerpc/copyloops/Makefile b/tools/testing/selftests/powerpc/copyloops/Makefile
index 384843e..28d6d6c 100644
--- a/tools/testing/selftests/powerpc/copyloops/Makefile
+++ b/tools/testing/selftests/powerpc/copyloops/Makefile
@@ -22,4 +22,4 @@ $(TEST_PROGS): $(EXTRA_SOURCES)
 include ../../lib.mk
 
 clean:
-	rm -f $(TEST_PROGS) *.o
+	$(RM) $(TEST_PROGS) *.o
diff --git a/tools/testing/selftests/powerpc/dscr/Makefile b/tools/testing/selftests/powerpc/dscr/Makefile
index 49327ee..d32a66e 100644
--- a/tools/testing/selftests/powerpc/dscr/Makefile
+++ b/tools/testing/selftests/powerpc/dscr/Makefile
@@ -11,4 +11,4 @@ $(TEST_PROGS): ../harness.c
 include ../../lib.mk
 
 clean:
-	rm -f $(TEST_PROGS) *.o
+	$(RM) $(TEST_PROGS) *.o
diff --git a/tools/testing/selftests/powerpc/mm/Makefile b/tools/testing/selftests/powerpc/mm/Makefile
index ee179e2..7f63469 100644
--- a/tools/testing/selftests/powerpc/mm/Makefile
+++ b/tools/testing/selftests/powerpc/mm/Makefile
@@ -14,4 +14,4 @@ tempfile:
 	dd if=/dev/zero of=tempfile bs=64k count=1
 
 clean:
-	rm -f $(TEST_PROGS) tempfile
+	$(RM) $(TEST_PROGS) tempfile
diff --git a/tools/testing/selftests/powerpc/pmu/Makefile b/tools/testing/selftests/powerpc/pmu/Makefile
index a9099d9..170f3a6 100644
--- a/tools/testing/selftests/powerpc/pmu/Makefile
+++ b/tools/testing/selftests/powerpc/pmu/Makefile
@@ -33,7 +33,7 @@ override define INSTALL_RULE
 endef
 
 clean:
-	rm -f $(TEST_PROGS) loop.o
+	$(RM) $(TEST_PROGS) loop.o
 	$(MAKE) -C ebb clean
 
 ebb:
diff --git a/tools/testing/selftests/powerpc/pmu/ebb/Makefile b/tools/testing/selftests/powerpc/pmu/ebb/Makefile
index 5cdc9db..977875f 100644
--- a/tools/testing/selftests/powerpc/pmu/ebb/Makefile
+++ b/tools/testing/selftests/powerpc/pmu/ebb/Makefile
@@ -27,4 +27,4 @@ lost_exception_test: ../lib.c
 include ../../../lib.mk
 
 clean:
-	rm -f $(TEST_PROGS)
+	$(RM) $(TEST_PROGS)
diff --git a/tools/testing/selftests/powerpc/primitives/Makefile b/tools/testing/selftests/powerpc/primitives/Makefile
index b68c622..2261bd1 100644
--- a/tools/testing/selftests/powerpc/primitives/Makefile
+++ b/tools/testing/selftests/powerpc/primitives/Makefile
@@ -9,4 +9,4 @@ $(TEST_PROGS): ../harness.c
 include ../../lib.mk
 
 clean:
-	rm -f $(TEST_PROGS) *.o
+	$(RM) $(TEST_PROGS) *.o
diff --git a/tools/testing/selftests/powerpc/stringloops/Makefile b/tools/testing/selftests/powerpc/stringloops/Makefile
index 2a728f4..ea89afd 100644
--- a/tools/testing/selftests/powerpc/stringloops/Makefile
+++ b/tools/testing/selftests/powerpc/stringloops/Makefile
@@ -12,4 +12,4 @@ $(TEST_PROGS): $(EXTRA_SOURCES)
 include ../../lib.mk
 
 clean:
-	rm -f $(TEST_PROGS) *.o
+	$(RM) $(TEST_PROGS) *.o
diff --git a/tools/testing/selftests/powerpc/switch_endian/Makefile b/tools/testing/selftests/powerpc/switch_endian/Makefile
index e21d106..6cfe0f0 100644
--- a/tools/testing/selftests/powerpc/switch_endian/Makefile
+++ b/tools/testing/selftests/powerpc/switch_endian/Makefile
@@ -15,4 +15,4 @@ check-reversed.S: check-reversed.o
 include ../../lib.mk
 
 clean:
-	rm -f $(TEST_PROGS) *.o check-reversed.S
+	$(RM) $(TEST_PROGS) *.o check-reversed.S
diff --git a/tools/testing/selftests/powerpc/tm/Makefile b/tools/testing/selftests/powerpc/tm/Makefile
index 4bea62a..f04bd4b 100644
--- a/tools/testing/selftests/powerpc/tm/Makefile
+++ b/tools/testing/selftests/powerpc/tm/Makefile
@@ -10,4 +10,4 @@ tm-syscall: CFLAGS += -mhtm -I../../../../../usr/include
 include ../../lib.mk
 
 clean:
-	rm -f $(TEST_PROGS) *.o
+	$(RM) $(TEST_PROGS) *.o
diff --git a/tools/testing/selftests/powerpc/vphn/Makefile b/tools/testing/selftests/powerpc/vphn/Makefile
index a485f2e..d98f32c 100644
--- a/tools/testing/selftests/powerpc/vphn/Makefile
+++ b/tools/testing/selftests/powerpc/vphn/Makefile
@@ -9,4 +9,4 @@ $(TEST_PROGS): ../harness.c
 include ../../lib.mk
 
 clean:
-	rm -f $(TEST_PROGS)
+	$(RM) $(TEST_PROGS)
diff --git a/tools/testing/selftests/ptrace/Makefile b/tools/testing/selftests/ptrace/Makefile
index 453927f..ec5bf58 100644
--- a/tools/testing/selftests/ptrace/Makefile
+++ b/tools/testing/selftests/ptrace/Makefile
@@ -4,7 +4,7 @@ peeksiginfo: peeksiginfo.c
 all: peeksiginfo
 
 clean:
-	rm -f peeksiginfo
+	$(RM) peeksiginfo
 
 TEST_PROGS := peeksiginfo
 
diff --git a/tools/testing/selftests/timers/Makefile b/tools/testing/selftests/timers/Makefile
index 89a3f44..a5889e2 100644
--- a/tools/testing/selftests/timers/Makefile
+++ b/tools/testing/selftests/timers/Makefile
@@ -33,4 +33,4 @@ run_destructive_tests: run_tests
 	./set-2038
 
 clean:
-	rm -f ${bins}
+	$(RM) ${bins}
-- 
1.8.3.4

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* Re: [PATCH] kselftest: replace $(RM) with rm -f command
@ 2015-09-29 17:45                 ` Kees Cook
  0 siblings, 0 replies; 25+ messages in thread
From: Kees Cook @ 2015-09-29 17:45 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Mathieu Desnoyers, Wang Long, Shuah Khan, dvhart,
	David S. Miller, Andy Lutomirski, Will Drewry, Andrew Morton,
	Cyrill Gorcunov, cov, bobby prani, tyler baker, Tim Bird,
	Josh Triplett, Andrea Arcangeli, andrej skvortzov, sjayaram,
	treding, Ingo Molnar, naresh kamboju, alexey kodanev, linux-api,
	LKML, wanglong

On Tue, Sep 29, 2015 at 2:57 AM, Michael Ellerman <mpe@ellerman.id.au> wrote:
> On Mon, 2015-09-28 at 03:16 +0000, Mathieu Desnoyers wrote:
>> ----- On Sep 27, 2015, at 10:10 PM, Wang Long long.wanglong@huawei.com wrote:
>>
>> > Some test's Makefile using "$(RM)" while the other's
>> > using "rm -f". It is better to use one of them in all
>> > tests.
>>
>> I agree that this disparity appears to be unwanted. We
>> should settle on one or the other.
>>
>> > "rm -f" is better, because it is less magic, and everyone
>> > konws what is does.
>>
>> "$(RM)" is clearly defined as a Makefile implicit variable
>> which defaults to "rm -f".
>> Ref. https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html
>
> Sure, but you had to look it up didn't you :) - I did.
>
>> Leaving it as a variable is more flexible because then the
>> default behavior can be overridden if need be, which is
>> not the case of a hardcoded "rm -f".
>
> But I don't think anyone actually wants to do that. Do they?
>
> Anyway I don't really care either way, so I'm happy for you to do a patch that
> uses $(RM). Or maybe Wang Long will be happy to respin his patch to use $(RM).

Yes, please. $(RM) is preferred, as that is the existing standard and
gives us flexibility.

-Kees

-- 
Kees Cook
Chrome OS Security

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH] kselftest: replace $(RM) with rm -f command
@ 2015-09-29 17:45                 ` Kees Cook
  0 siblings, 0 replies; 25+ messages in thread
From: Kees Cook @ 2015-09-29 17:45 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Mathieu Desnoyers, Wang Long, Shuah Khan,
	dvhart-wEGCiKHe2LqWVfeAwA7xHQ, David S. Miller, Andy Lutomirski,
	Will Drewry, Andrew Morton, Cyrill Gorcunov,
	cov-sgV2jX0FEOL9JmXXK+q4OQ, bobby prani, tyler baker, Tim Bird,
	Josh Triplett, Andrea Arcangeli, andrej skvortzov,
	sjayaram-JqFfY2XvxFXQT0dZR+AlfA, treding-DDmLM1+adcrQT0dZR+AlfA,
	Ingo Molnar, naresh kamboju, alexey kodanev, linux-api, LKML,
	wanglong-m92B/FuLcaEcWVvVuXF20w

On Tue, Sep 29, 2015 at 2:57 AM, Michael Ellerman <mpe-Gsx/Oe8HsFggBc27wqDAHg@public.gmane.org> wrote:
> On Mon, 2015-09-28 at 03:16 +0000, Mathieu Desnoyers wrote:
>> ----- On Sep 27, 2015, at 10:10 PM, Wang Long long.wanglong-hv44wF8Li93QT0dZR+AlfA@public.gmane.org wrote:
>>
>> > Some test's Makefile using "$(RM)" while the other's
>> > using "rm -f". It is better to use one of them in all
>> > tests.
>>
>> I agree that this disparity appears to be unwanted. We
>> should settle on one or the other.
>>
>> > "rm -f" is better, because it is less magic, and everyone
>> > konws what is does.
>>
>> "$(RM)" is clearly defined as a Makefile implicit variable
>> which defaults to "rm -f".
>> Ref. https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html
>
> Sure, but you had to look it up didn't you :) - I did.
>
>> Leaving it as a variable is more flexible because then the
>> default behavior can be overridden if need be, which is
>> not the case of a hardcoded "rm -f".
>
> But I don't think anyone actually wants to do that. Do they?
>
> Anyway I don't really care either way, so I'm happy for you to do a patch that
> uses $(RM). Or maybe Wang Long will be happy to respin his patch to use $(RM).

Yes, please. $(RM) is preferred, as that is the existing standard and
gives us flexibility.

-Kees

-- 
Kees Cook
Chrome OS Security

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH] kselftest: replace $(RM) with rm -f command
@ 2015-10-03  4:38               ` Darren Hart
  0 siblings, 0 replies; 25+ messages in thread
From: Darren Hart @ 2015-10-03  4:38 UTC (permalink / raw)
  To: Mathieu Desnoyers
  Cc: Wang Long, shuahkh, Michael Ellerman, keescook, davem, luto, wad,
	Andrew Morton, gorcunov, cov, bobby prani, tyler baker, Tim Bird,
	josh, Andrea Arcangeli, andrej skvortzov, sjayaram, treding,
	Ingo Molnar, naresh kamboju, alexey kodanev, linux-api,
	linux-kernel, wanglong

On Mon, Sep 28, 2015 at 03:16:53AM +0000, Mathieu Desnoyers wrote:
> ----- On Sep 27, 2015, at 10:10 PM, Wang Long long.wanglong@huawei.com wrote:
> 
> > Some test's Makefile using "$(RM)" while the other's
> > using "rm -f". It is better to use one of them in all
> > tests.
> 
> I agree that this disparity appears to be unwanted. We
> should settle on one or the other.
> 
> > 
> > "rm -f" is better, because it is less magic, and everyone
> > konws what is does.
> 
> "$(RM)" is clearly defined as a Makefile implicit variable
> which defaults to "rm -f".
> Ref. https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html
> 
> Leaving it as a variable is more flexible because then the
> default behavior can be overridden if need be, which is
> not the case of a hardcoded "rm -f".
> 
> Following your line of argumentation, we should then
> invoke "gcc" directly in every Makefile because it is
> less magic than "$(CC)". This makes no sense.

I don't think they can be compared so simply. Specifying a compiler is a common
use case. Customizing the rm command is not, in my experience anyway, and like
Michael, I would definately have to look up what RM means.

That said, I care more about consistency than which is used. Both are valid, but
$(RM), while more flexible, will cost more people time to look up what it does
as it isn't commonly used than any benefit we're likely to see from its use.

Meh. :-)

-- 
Darren Hart
Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH] kselftest: replace $(RM) with rm -f command
@ 2015-10-03  4:38               ` Darren Hart
  0 siblings, 0 replies; 25+ messages in thread
From: Darren Hart @ 2015-10-03  4:38 UTC (permalink / raw)
  To: Mathieu Desnoyers
  Cc: Wang Long, shuahkh-JPH+aEBZ4P+UEJcrhfAQsw, Michael Ellerman,
	keescook-F7+t8E8rja9g9hUCZPvPmw, davem-fT/PcQaiUtIeIZ0/mPfg9Q,
	luto-kltTT9wpgjJwATOyAt5JVQ, wad-F7+t8E8rja9g9hUCZPvPmw,
	Andrew Morton, gorcunov-GEFAQzZX7r8dnm+yROfE0A,
	cov-sgV2jX0FEOL9JmXXK+q4OQ, bobby prani, tyler baker, Tim Bird,
	josh-iaAMLnmF4UmaiuxdJuQwMA, Andrea Arcangeli, andrej skvortzov,
	sjayaram-JqFfY2XvxFXQT0dZR+AlfA, treding-DDmLM1+adcrQT0dZR+AlfA,
	Ingo Molnar, naresh kamboju, alexey kodanev, linux-api,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	wanglong-m92B/FuLcaEcWVvVuXF20w

On Mon, Sep 28, 2015 at 03:16:53AM +0000, Mathieu Desnoyers wrote:
> ----- On Sep 27, 2015, at 10:10 PM, Wang Long long.wanglong-hv44wF8Li93QT0dZR+AlfA@public.gmane.org wrote:
> 
> > Some test's Makefile using "$(RM)" while the other's
> > using "rm -f". It is better to use one of them in all
> > tests.
> 
> I agree that this disparity appears to be unwanted. We
> should settle on one or the other.
> 
> > 
> > "rm -f" is better, because it is less magic, and everyone
> > konws what is does.
> 
> "$(RM)" is clearly defined as a Makefile implicit variable
> which defaults to "rm -f".
> Ref. https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html
> 
> Leaving it as a variable is more flexible because then the
> default behavior can be overridden if need be, which is
> not the case of a hardcoded "rm -f".
> 
> Following your line of argumentation, we should then
> invoke "gcc" directly in every Makefile because it is
> less magic than "$(CC)". This makes no sense.

I don't think they can be compared so simply. Specifying a compiler is a common
use case. Customizing the rm command is not, in my experience anyway, and like
Michael, I would definately have to look up what RM means.

That said, I care more about consistency than which is used. Both are valid, but
$(RM), while more flexible, will cost more people time to look up what it does
as it isn't commonly used than any benefit we're likely to see from its use.

Meh. :-)

-- 
Darren Hart
Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH] kselftest: replace $(RM) with rm -f command
  2015-10-03  4:38               ` Darren Hart
  (?)
@ 2015-10-03 14:11               ` Mathieu Desnoyers
  2015-10-03 17:55                   ` Josh Triplett
  -1 siblings, 1 reply; 25+ messages in thread
From: Mathieu Desnoyers @ 2015-10-03 14:11 UTC (permalink / raw)
  To: dvhart
  Cc: Wang Long, shuahkh, Michael Ellerman, keescook, davem, luto, wad,
	Andrew Morton, gorcunov, cov, bobby prani, tyler baker, Tim Bird,
	josh, Andrea Arcangeli, andrej skvortzov, sjayaram, treding,
	Ingo Molnar, naresh kamboju, alexey kodanev, linux-api,
	linux-kernel, wanglong

----- On Oct 3, 2015, at 12:38 AM, dvhart dvhart@infradead.org wrote:

> On Mon, Sep 28, 2015 at 03:16:53AM +0000, Mathieu Desnoyers wrote:
>> ----- On Sep 27, 2015, at 10:10 PM, Wang Long long.wanglong@huawei.com wrote:
>> 
>> > Some test's Makefile using "$(RM)" while the other's
>> > using "rm -f". It is better to use one of them in all
>> > tests.
>> 
>> I agree that this disparity appears to be unwanted. We
>> should settle on one or the other.
>> 
>> > 
>> > "rm -f" is better, because it is less magic, and everyone
>> > konws what is does.
>> 
>> "$(RM)" is clearly defined as a Makefile implicit variable
>> which defaults to "rm -f".
>> Ref. https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html
>> 
>> Leaving it as a variable is more flexible because then the
>> default behavior can be overridden if need be, which is
>> not the case of a hardcoded "rm -f".
>> 
>> Following your line of argumentation, we should then
>> invoke "gcc" directly in every Makefile because it is
>> less magic than "$(CC)". This makes no sense.
> 
> I don't think they can be compared so simply. Specifying a compiler is a common
> use case. Customizing the rm command is not, in my experience anyway, and like
> Michael, I would definately have to look up what RM means.
> 
> That said, I care more about consistency than which is used. Both are valid, but
> $(RM), while more flexible, will cost more people time to look up what it does
> as it isn't commonly used than any benefit we're likely to see from its use.
> 
> Meh. :-)

An example is "grm" when you install the opencsw repository
packages on Solaris. In the unlikely example where someone
would have a Solaris machine to build Linux, overriding
various command names, including "rm", can be useful. This
is just one example, there are probably others.

Thanks,

Mathieu

> 
> --
> Darren Hart
> Intel Open Source Technology Center

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH] kselftest: replace $(RM) with rm -f command
@ 2015-10-03 17:55                   ` Josh Triplett
  0 siblings, 0 replies; 25+ messages in thread
From: Josh Triplett @ 2015-10-03 17:55 UTC (permalink / raw)
  To: Mathieu Desnoyers
  Cc: dvhart, Wang Long, shuahkh, Michael Ellerman, keescook, davem,
	luto, wad, Andrew Morton, gorcunov, cov, bobby prani,
	tyler baker, Tim Bird, Andrea Arcangeli, andrej skvortzov,
	sjayaram, treding, Ingo Molnar, naresh kamboju, alexey kodanev,
	linux-api, linux-kernel, wanglong

On Sat, Oct 03, 2015 at 02:11:57PM +0000, Mathieu Desnoyers wrote:
> ----- On Oct 3, 2015, at 12:38 AM, dvhart dvhart@infradead.org wrote:
> 
> > On Mon, Sep 28, 2015 at 03:16:53AM +0000, Mathieu Desnoyers wrote:
> >> ----- On Sep 27, 2015, at 10:10 PM, Wang Long long.wanglong@huawei.com wrote:
> >> 
> >> > Some test's Makefile using "$(RM)" while the other's
> >> > using "rm -f". It is better to use one of them in all
> >> > tests.
> >> 
> >> I agree that this disparity appears to be unwanted. We
> >> should settle on one or the other.
> >> 
> >> > 
> >> > "rm -f" is better, because it is less magic, and everyone
> >> > konws what is does.
> >> 
> >> "$(RM)" is clearly defined as a Makefile implicit variable
> >> which defaults to "rm -f".
> >> Ref. https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html
> >> 
> >> Leaving it as a variable is more flexible because then the
> >> default behavior can be overridden if need be, which is
> >> not the case of a hardcoded "rm -f".
> >> 
> >> Following your line of argumentation, we should then
> >> invoke "gcc" directly in every Makefile because it is
> >> less magic than "$(CC)". This makes no sense.
> > 
> > I don't think they can be compared so simply. Specifying a compiler is a common
> > use case. Customizing the rm command is not, in my experience anyway, and like
> > Michael, I would definately have to look up what RM means.
> > 
> > That said, I care more about consistency than which is used. Both are valid, but
> > $(RM), while more flexible, will cost more people time to look up what it does
> > as it isn't commonly used than any benefit we're likely to see from its use.
> > 
> > Meh. :-)
> 
> An example is "grm" when you install the opencsw repository
> packages on Solaris. In the unlikely example where someone
> would have a Solaris machine to build Linux, overriding
> various command names, including "rm", can be useful. This
> is just one example, there are probably others.

Does Solaris rm not support -f?

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH] kselftest: replace $(RM) with rm -f command
@ 2015-10-03 17:55                   ` Josh Triplett
  0 siblings, 0 replies; 25+ messages in thread
From: Josh Triplett @ 2015-10-03 17:55 UTC (permalink / raw)
  To: Mathieu Desnoyers
  Cc: dvhart, Wang Long, shuahkh-JPH+aEBZ4P+UEJcrhfAQsw,
	Michael Ellerman, keescook-F7+t8E8rja9g9hUCZPvPmw,
	davem-fT/PcQaiUtIeIZ0/mPfg9Q, luto-kltTT9wpgjJwATOyAt5JVQ,
	wad-F7+t8E8rja9g9hUCZPvPmw, Andrew Morton, gorcunov,
	cov-sgV2jX0FEOL9JmXXK+q4OQ, bobby prani, tyler baker, Tim Bird,
	Andrea Arcangeli, andrej skvortzov, sjayaram,
	treding-DDmLM1+adcrQT0dZR+AlfA, Ingo Molnar, naresh kamboju,
	alexey kodanev, linux-api, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	wanglong

On Sat, Oct 03, 2015 at 02:11:57PM +0000, Mathieu Desnoyers wrote:
> ----- On Oct 3, 2015, at 12:38 AM, dvhart dvhart-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org wrote:
> 
> > On Mon, Sep 28, 2015 at 03:16:53AM +0000, Mathieu Desnoyers wrote:
> >> ----- On Sep 27, 2015, at 10:10 PM, Wang Long long.wanglong-hv44wF8Li93QT0dZR+AlfA@public.gmane.org wrote:
> >> 
> >> > Some test's Makefile using "$(RM)" while the other's
> >> > using "rm -f". It is better to use one of them in all
> >> > tests.
> >> 
> >> I agree that this disparity appears to be unwanted. We
> >> should settle on one or the other.
> >> 
> >> > 
> >> > "rm -f" is better, because it is less magic, and everyone
> >> > konws what is does.
> >> 
> >> "$(RM)" is clearly defined as a Makefile implicit variable
> >> which defaults to "rm -f".
> >> Ref. https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html
> >> 
> >> Leaving it as a variable is more flexible because then the
> >> default behavior can be overridden if need be, which is
> >> not the case of a hardcoded "rm -f".
> >> 
> >> Following your line of argumentation, we should then
> >> invoke "gcc" directly in every Makefile because it is
> >> less magic than "$(CC)". This makes no sense.
> > 
> > I don't think they can be compared so simply. Specifying a compiler is a common
> > use case. Customizing the rm command is not, in my experience anyway, and like
> > Michael, I would definately have to look up what RM means.
> > 
> > That said, I care more about consistency than which is used. Both are valid, but
> > $(RM), while more flexible, will cost more people time to look up what it does
> > as it isn't commonly used than any benefit we're likely to see from its use.
> > 
> > Meh. :-)
> 
> An example is "grm" when you install the opencsw repository
> packages on Solaris. In the unlikely example where someone
> would have a Solaris machine to build Linux, overriding
> various command names, including "rm", can be useful. This
> is just one example, there are probably others.

Does Solaris rm not support -f?

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH] kselftest: replace $(RM) with rm -f command
  2015-10-03 17:55                   ` Josh Triplett
  (?)
@ 2015-10-03 18:05                   ` Mathieu Desnoyers
  -1 siblings, 0 replies; 25+ messages in thread
From: Mathieu Desnoyers @ 2015-10-03 18:05 UTC (permalink / raw)
  To: Josh Triplett
  Cc: dvhart, Wang Long, shuahkh, Michael Ellerman, keescook, davem,
	luto, wad, Andrew Morton, gorcunov, cov, bobby prani,
	tyler baker, Tim Bird, Andrea Arcangeli, andrej skvortzov,
	sjayaram, treding, Ingo Molnar, naresh kamboju, alexey kodanev,
	linux-api, linux-kernel, wanglong

----- On Oct 3, 2015, at 1:55 PM, Josh Triplett josh@joshtriplett.org wrote:

> On Sat, Oct 03, 2015 at 02:11:57PM +0000, Mathieu Desnoyers wrote:
>> ----- On Oct 3, 2015, at 12:38 AM, dvhart dvhart@infradead.org wrote:
>> 
>> > On Mon, Sep 28, 2015 at 03:16:53AM +0000, Mathieu Desnoyers wrote:
>> >> ----- On Sep 27, 2015, at 10:10 PM, Wang Long long.wanglong@huawei.com wrote:
>> >> 
>> >> > Some test's Makefile using "$(RM)" while the other's
>> >> > using "rm -f". It is better to use one of them in all
>> >> > tests.
>> >> 
>> >> I agree that this disparity appears to be unwanted. We
>> >> should settle on one or the other.
>> >> 
>> >> > 
>> >> > "rm -f" is better, because it is less magic, and everyone
>> >> > konws what is does.
>> >> 
>> >> "$(RM)" is clearly defined as a Makefile implicit variable
>> >> which defaults to "rm -f".
>> >> Ref. https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html
>> >> 
>> >> Leaving it as a variable is more flexible because then the
>> >> default behavior can be overridden if need be, which is
>> >> not the case of a hardcoded "rm -f".
>> >> 
>> >> Following your line of argumentation, we should then
>> >> invoke "gcc" directly in every Makefile because it is
>> >> less magic than "$(CC)". This makes no sense.
>> > 
>> > I don't think they can be compared so simply. Specifying a compiler is a common
>> > use case. Customizing the rm command is not, in my experience anyway, and like
>> > Michael, I would definately have to look up what RM means.
>> > 
>> > That said, I care more about consistency than which is used. Both are valid, but
>> > $(RM), while more flexible, will cost more people time to look up what it does
>> > as it isn't commonly used than any benefit we're likely to see from its use.
>> > 
>> > Meh. :-)
>> 
>> An example is "grm" when you install the opencsw repository
>> packages on Solaris. In the unlikely example where someone
>> would have a Solaris machine to build Linux, overriding
>> various command names, including "rm", can be useful. This
>> is just one example, there are probably others.
> 
> Does Solaris rm not support -f?

Yes, it does. I was merely showing this as an example where
it can be useful to override the command name, although I don't
expect anyone to have to use "grm" rather than "rm" on that
specific platform.

Thanks,

Mathieu

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2015-10-03 18:05 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-23  9:40 [PATCH] kselftest: using built-in rule when delete file Wang Long
2015-09-24  1:46 ` Michael Ellerman
2015-09-24  2:05   ` long.wanglong
2015-09-24  2:07     ` Michael Ellerman
2015-09-25 15:44       ` Darren Hart
2015-09-28  2:03         ` long.wanglong
2015-09-28  2:10         ` [PATCH] kselftest: replace $(RM) with rm -f command Wang Long
2015-09-28  2:10           ` Wang Long
2015-09-28  3:16           ` Mathieu Desnoyers
2015-09-28  3:16             ` Mathieu Desnoyers
2015-09-28  5:11             ` Cam Hutchison
2015-09-29  9:57             ` Michael Ellerman
2015-09-29  9:57               ` Michael Ellerman
2015-09-29 11:21               ` [PATCH] kselftest: replace rm -f command with $(RM) Wang Long
2015-09-29 11:21                 ` Wang Long
2015-09-29 17:45               ` [PATCH] kselftest: replace $(RM) with rm -f command Kees Cook
2015-09-29 17:45                 ` Kees Cook
2015-10-03  4:38             ` Darren Hart
2015-10-03  4:38               ` Darren Hart
2015-10-03 14:11               ` Mathieu Desnoyers
2015-10-03 17:55                 ` Josh Triplett
2015-10-03 17:55                   ` Josh Triplett
2015-10-03 18:05                   ` Mathieu Desnoyers
2015-09-28  7:26           ` Yuan Sun
2015-09-28  7:26             ` Yuan Sun

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.