Re: [PATCH] kselftest: replace $(RM) with rm -f command

2015-10-03 Thread Mathieu Desnoyers
- On Oct 3, 2015, at 1:55 PM, Josh Triplett j...@joshtriplett.org wrote:

> On Sat, Oct 03, 2015 at 02:11:57PM +, Mathieu Desnoyers wrote:
>> - On Oct 3, 2015, at 12:38 AM, dvhart dvh...@infradead.org wrote:
>> 
>> > On Mon, Sep 28, 2015 at 03:16:53AM +, Mathieu Desnoyers wrote:
>> >> - On Sep 27, 2015, at 10:10 PM, Wang Long long.wangl...@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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] kselftest: replace $(RM) with rm -f command

2015-10-03 Thread Josh Triplett
On Sat, Oct 03, 2015 at 02:11:57PM +, Mathieu Desnoyers wrote:
> - On Oct 3, 2015, at 12:38 AM, dvhart dvh...@infradead.org wrote:
> 
> > On Mon, Sep 28, 2015 at 03:16:53AM +, Mathieu Desnoyers wrote:
> >> - On Sep 27, 2015, at 10:10 PM, Wang Long long.wangl...@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?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] kselftest: replace $(RM) with rm -f command

2015-10-03 Thread Mathieu Desnoyers
- On Oct 3, 2015, at 12:38 AM, dvhart dvh...@infradead.org wrote:

> On Mon, Sep 28, 2015 at 03:16:53AM +, Mathieu Desnoyers wrote:
>> - On Sep 27, 2015, at 10:10 PM, Wang Long long.wangl...@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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] kselftest: replace $(RM) with rm -f command

2015-10-03 Thread Mathieu Desnoyers
- On Oct 3, 2015, at 12:38 AM, dvhart dvh...@infradead.org wrote:

> On Mon, Sep 28, 2015 at 03:16:53AM +, Mathieu Desnoyers wrote:
>> - On Sep 27, 2015, at 10:10 PM, Wang Long long.wangl...@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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] kselftest: replace $(RM) with rm -f command

2015-10-03 Thread Josh Triplett
On Sat, Oct 03, 2015 at 02:11:57PM +, Mathieu Desnoyers wrote:
> - On Oct 3, 2015, at 12:38 AM, dvhart dvh...@infradead.org wrote:
> 
> > On Mon, Sep 28, 2015 at 03:16:53AM +, Mathieu Desnoyers wrote:
> >> - On Sep 27, 2015, at 10:10 PM, Wang Long long.wangl...@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?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] kselftest: replace $(RM) with rm -f command

2015-10-03 Thread Mathieu Desnoyers
- On Oct 3, 2015, at 1:55 PM, Josh Triplett j...@joshtriplett.org wrote:

> On Sat, Oct 03, 2015 at 02:11:57PM +, Mathieu Desnoyers wrote:
>> - On Oct 3, 2015, at 12:38 AM, dvhart dvh...@infradead.org wrote:
>> 
>> > On Mon, Sep 28, 2015 at 03:16:53AM +, Mathieu Desnoyers wrote:
>> >> - On Sep 27, 2015, at 10:10 PM, Wang Long long.wangl...@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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] kselftest: replace $(RM) with rm -f command

2015-10-02 Thread Darren Hart
On Mon, Sep 28, 2015 at 03:16:53AM +, Mathieu Desnoyers wrote:
> - On Sep 27, 2015, at 10:10 PM, Wang Long long.wangl...@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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] kselftest: replace $(RM) with rm -f command

2015-10-02 Thread Darren Hart
On Mon, Sep 28, 2015 at 03:16:53AM +, Mathieu Desnoyers wrote:
> - On Sep 27, 2015, at 10:10 PM, Wang Long long.wangl...@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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] kselftest: replace $(RM) with rm -f command

2015-09-29 Thread Kees Cook
On Tue, Sep 29, 2015 at 2:57 AM, Michael Ellerman  wrote:
> On Mon, 2015-09-28 at 03:16 +, Mathieu Desnoyers wrote:
>> - On Sep 27, 2015, at 10:10 PM, Wang Long long.wangl...@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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] kselftest: replace $(RM) with rm -f command

2015-09-29 Thread Michael Ellerman
On Mon, 2015-09-28 at 03:16 +, Mathieu Desnoyers wrote:
> - On Sep 27, 2015, at 10:10 PM, Wang Long long.wangl...@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


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


Re: [PATCH] kselftest: replace $(RM) with rm -f command

2015-09-29 Thread Michael Ellerman
On Mon, 2015-09-28 at 03:16 +, Mathieu Desnoyers wrote:
> - On Sep 27, 2015, at 10:10 PM, Wang Long long.wangl...@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


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


Re: [PATCH] kselftest: replace $(RM) with rm -f command

2015-09-29 Thread Kees Cook
On Tue, Sep 29, 2015 at 2:57 AM, Michael Ellerman  wrote:
> On Mon, 2015-09-28 at 03:16 +, Mathieu Desnoyers wrote:
>> - On Sep 27, 2015, at 10:10 PM, Wang Long long.wangl...@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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] kselftest: replace $(RM) with rm -f command

2015-09-28 Thread Yuan Sun

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 
---
  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


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


Re: [PATCH] kselftest: replace $(RM) with rm -f command

2015-09-28 Thread Yuan Sun

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 
---
  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


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


Re: [PATCH] kselftest: replace $(RM) with rm -f command

2015-09-27 Thread Cam Hutchison
Mathieu Desnoyers  writes:

>- On Sep 27, 2015, at 10:10 PM, Wang Long long.wangl...@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 
>> ---
>> 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)
>> 

Re: [PATCH] kselftest: replace $(RM) with rm -f command

2015-09-27 Thread Mathieu Desnoyers
- On Sep 27, 2015, at 10:10 PM, Wang Long long.wangl...@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 
> ---
> 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) $^ 

Re: [PATCH] kselftest: replace $(RM) with rm -f command

2015-09-27 Thread Mathieu Desnoyers
- On Sep 27, 2015, at 10:10 PM, Wang Long long.wangl...@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 
> ---
> 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 $@ 

Re: [PATCH] kselftest: replace $(RM) with rm -f command

2015-09-27 Thread Cam Hutchison
Mathieu Desnoyers  writes:

>- On Sep 27, 2015, at 10:10 PM, Wang Long long.wangl...@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 
>> ---
>> 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
>> +++