2008-01-14 22:31:12

by Paolo Ciarrocchi

[permalink] [raw]
Subject: [PATCH] Change a WARN message in checkpatch

Hi Andy,
When I started using checkpatch I was confused by the following WARN message:

no space between function name and open parenthesis

I thought the problem was that a space was missing while the truth is the opposite.

How about the following patch?


--- checkpatch.pl.old 2008-01-04 13:37:51.000000000 +0100
+++ checkpatch.pl 2008-01-04 13:37:24.000000000 +0100
@@ -1117,7 +1117,7 @@
while ($line =~ /($Ident)\s+\(/g) {
if ($1 !~ /^(?:if|for|while|switch|return|volatile|__volatile__|__attribute__|format|__extension__|Copyright|case)$/ &&
$line !~ /$Type\s+\(/ && $line !~ /^.\#\s*define\b/) {
- WARN("no space between function name and open parenthesis '('\n" . $herecurr);
+ WARN("don't put a space between function name and open parenthesis '('\n" . $herecurr);
}
}
# Check operator spacing.


2008-01-28 14:55:23

by Andy Whitcroft

[permalink] [raw]
Subject: Re: [PATCH] Change a WARN message in checkpatch

On Mon, Jan 14, 2008 at 11:29:13PM +0100, Paolo Ciarrocchi wrote:
> Hi Andy,
> When I started using checkpatch I was confused by the following WARN message:
>
> no space between function name and open parenthesis
>
> I thought the problem was that a space was missing while the truth is the opposite.
>
> How about the following patch?

I can see how that language would be confusing. Your patch makes the
english clearer, but somehow seems clumsy. There must be a better way
to say this. I will think on it and see what I can come up with.

-apw

2008-01-28 15:13:48

by Paolo Ciarrocchi

[permalink] [raw]
Subject: Re: [PATCH] Change a WARN message in checkpatch

On Jan 28, 2008 3:56 PM, Andy Whitcroft <[email protected]> wrote:
> On Mon, Jan 14, 2008 at 11:29:13PM +0100, Paolo Ciarrocchi wrote:
> > Hi Andy,
> > When I started using checkpatch I was confused by the following WARN message:
> >
> > no space between function name and open parenthesis
> >
> > I thought the problem was that a space was missing while the truth is the opposite.
> >
> > How about the following patch?
>
> I can see how that language would be confusing. Your patch makes the
> english clearer, but somehow seems clumsy. There must be a better way
> to say this. I will think on it and see what I can come up with.

Fair enought, I'm not English mother tongue and I'm sure you can come
up with a better
sentence :-)

BTW, is there a public repo I can track to look at all the new patches?

Thanks.

Ciao,
--
Paolo
http://paolo.ciarrocchi.googlepages.com/

2008-02-23 13:38:30

by Paolo Ciarrocchi

[permalink] [raw]
Subject: Re: [PATCH] Change a WARN message in checkpatch

On Mon, Jan 28, 2008 at 4:13 PM, Paolo Ciarrocchi
<[email protected]> wrote:
>
> On Jan 28, 2008 3:56 PM, Andy Whitcroft <[email protected]> wrote:
> > On Mon, Jan 14, 2008 at 11:29:13PM +0100, Paolo Ciarrocchi wrote:
> > > Hi Andy,
> > > When I started using checkpatch I was confused by the following WARN message:
> > >
> > > no space between function name and open parenthesis
> > >
> > > I thought the problem was that a space was missing while the truth is the opposite.
> > >
> > > How about the following patch?
> >
> > I can see how that language would be confusing. Your patch makes the
> > english clearer, but somehow seems clumsy. There must be a better way
> > to say this. I will think on it and see what I can come up with.
>
> Fair enought, I'm not English mother tongue and I'm sure you can come
> up with a better
> sentence :-)

AFAICS the problem is still present.

Ciao,
--
Paolo
http://paolo.ciarrocchi.googlepages.com/

2008-02-24 15:18:22

by Benny Halevy

[permalink] [raw]
Subject: Re: [PATCH] Change a WARN message in checkpatch

On Feb. 23, 2008, 5:38 -0800, "Paolo Ciarrocchi" <[email protected]> wrote:
> On Mon, Jan 28, 2008 at 4:13 PM, Paolo Ciarrocchi
> <[email protected]> wrote:
>> On Jan 28, 2008 3:56 PM, Andy Whitcroft <[email protected]> wrote:
>> > On Mon, Jan 14, 2008 at 11:29:13PM +0100, Paolo Ciarrocchi wrote:
>> > > Hi Andy,
>> > > When I started using checkpatch I was confused by the following WARN message:
>> > >
>> > > no space between function name and open parenthesis
>> > >
>> > > I thought the problem was that a space was missing while the truth is the opposite.
>> > >
>> > > How about the following patch?
>> >
>> > I can see how that language would be confusing. Your patch makes the
>> > english clearer, but somehow seems clumsy. There must be a better way
>> > to say this. I will think on it and see what I can come up with.
>>
>> Fair enought, I'm not English mother tongue and I'm sure you can come
>> up with a better
>> sentence :-)
>
> AFAICS the problem is still present.
>
> Ciao,

How about:
- WARN("no space between function name and open parenthesis '('\n" . $herecurr);
+ WARN("there should be no space between function name and open parenthesis '('\n" . $herecurr);

The original phrasing can be interpreted like "there is no space between ..." and the correct
interpretation should be "there should be no space between ..."

Benny

2008-02-24 18:14:25

by Paolo Ciarrocchi

[permalink] [raw]
Subject: Re: [PATCH] Change a WARN message in checkpatch

On Sun, Feb 24, 2008 at 4:18 PM, Benny Halevy <[email protected]> wrote:
[...]
> How about:
> - WARN("no space between function name and open parenthesis '('\n" . $herecurr);
> + WARN("there should be no space between function name and open parenthesis '('\n" . $herecurr);

I originally suggested:
+ WARN("don't put a space between
function name and open parenthesis '('\n" . $herecurr);
but I really prefer your version.

> The original phrasing can be interpreted like "there is no space between ..." and the correct
> interpretation should be "there should be no space between ..."

Indeed.

Ciao,
--
Paolo
http://paolo.ciarrocchi.googlepages.com/

2008-02-25 03:28:49

by Andy Whitcroft

[permalink] [raw]
Subject: Re: [PATCH] Change a WARN message in checkpatch

On Sun, Feb 24, 2008 at 07:14:13PM +0100, Paolo Ciarrocchi wrote:
> On Sun, Feb 24, 2008 at 4:18 PM, Benny Halevy <[email protected]> wrote:
> [...]
> > How about:
> > - WARN("no space between function name and open parenthesis '('\n" . $herecurr);
> > + WARN("there should be no space between function name and open parenthesis '('\n" . $herecurr);
>
> I originally suggested:
> + WARN("don't put a space between
> function name and open parenthesis '('\n" . $herecurr);
> but I really prefer your version.
>
> > The original phrasing can be interpreted like "there is no space between ..." and the correct
> > interpretation should be "there should be no space between ..."
>
> Indeed.

As we want the messages to be as short as possible, I am leaning towards
standardising on:

spaces prohibited <where>
spaces required <where>

-apw

2008-02-25 05:48:15

by Benny Halevy

[permalink] [raw]
Subject: Re: [PATCH] Change a WARN message in checkpatch

On Feb. 24, 2008, 19:29 -0800, Andy Whitcroft <[email protected]> wrote:
> On Sun, Feb 24, 2008 at 07:14:13PM +0100, Paolo Ciarrocchi wrote:
>> On Sun, Feb 24, 2008 at 4:18 PM, Benny Halevy <[email protected]> wrote:
>> [...]
>>> How about:
>>> - WARN("no space between function name and open parenthesis '('\n" . $herecurr);
>>> + WARN("there should be no space between function name and open parenthesis '('\n" . $herecurr);
>> I originally suggested:
>> + WARN("don't put a space between
>> function name and open parenthesis '('\n" . $herecurr);
>> but I really prefer your version.
>>
>>> The original phrasing can be interpreted like "there is no space between ..." and the correct
>>> interpretation should be "there should be no space between ..."
>> Indeed.
>
> As we want the messages to be as short as possible, I am leaning towards
> standardising on:
>
> spaces prohibited <where>
> spaces required <where>

Sounds good to me.

Benny

>
> -apw

2008-02-25 06:51:18

by Paolo Ciarrocchi

[permalink] [raw]
Subject: Re: [PATCH] Change a WARN message in checkpatch

On 2/25/08, Andy Whitcroft
> As we want the messages to be as short as possible, I am leaning towards
> standardising on:
>
> spaces prohibited <where>
> spaces required <where>
>
in that case i would prefer:
space not required <where>
space required <where>

ciao,
--
Paolo
http://paolo.ciarrocchi.googlepages.com/

2008-02-25 10:52:14

by Andy Whitcroft

[permalink] [raw]
Subject: Re: [PATCH] Change a WARN message in checkpatch

On Mon, Feb 25, 2008 at 10:21:01AM +0330, Paolo Ciarrocchi wrote:
> On 2/25/08, Andy Whitcroft
> > As we want the messages to be as short as possible, I am leaning towards
> > standardising on:
> >
> > spaces prohibited <where>
> > spaces required <where>
> >
> in that case i would prefer:
> space not required <where>
> space required <where>

"not required" implies that you don't have to have the space, but you
can can have it if you want. So I don't think thats quite right either.

-apw