Skip to contentSkip to conversation

Change a WARN message in checkpatch

PATCH In review Paolo Ciarrocchi 3 participants 10 messages Jan 14, 2008 – Feb 25, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 renamed from checkpatch.pl.old +1 -1
@@ -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.
#1 lore raw
Quoted 8 lines · Paolo Ciarrocchi

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

#2 lore raw
Quoted 6 lines · Andy Whitcroft
Quoted 5 lines · Paolo Ciarrocchi

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

no space between function name and open parenthesis

Quoted 7 lines
Quoted 3 lines

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,

Signature · 2 lines
Paolo
http://paolo.ciarrocchi.googlepages.com/
#3 lore raw
Quoted 12 lines · Paolo Ciarrocchi
Quoted 10 lines · Andy Whitcroft
Quoted 8 lines · Paolo Ciarrocchi

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?

Quoted 7 lines
Quoted 3 lines

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,

Signature · 2 lines
Paolo
http://paolo.ciarrocchi.googlepages.com/
#4 lore raw
Quoted 17 lines · Paolo Ciarrocchi
Quoted 15 lines · Paolo Ciarrocchi
Quoted 13 lines · Andy Whitcroft
Quoted 8 lines · Paolo Ciarrocchi

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.

Quoted 7 lines
Quoted 3 lines

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

#5 lore raw

On Sun, Feb 24, 2008 at 4:18 PM, Benny Halevy <[email protected]> wrote:
[...]

Quoted 3 lines

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.

Quoted 2 lines

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,

Signature · 2 lines
Paolo
http://paolo.ciarrocchi.googlepages.com/
#6 lore raw
Quoted 11 lines · Paolo Ciarrocchi

On Sun, Feb 24, 2008 at 4:18 PM, Benny Halevy <[email protected]> wrote:
[...]

Quoted 3 lines

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.

Quoted 4 lines
Quoted 2 lines

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

#7 lore raw
Quoted 13 lines · Andy Whitcroft
Quoted 12 lines · Paolo Ciarrocchi

On Sun, Feb 24, 2008 at 4:18 PM, Benny Halevy <[email protected]> wrote:
[...]

Quoted 3 lines

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.

Quoted 2 lines

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

Quoted 7 lines
Quoted 1 line

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

Quoted 2 lines

-apw

#9 lore raw
Quoted 10 lines · Paolo Ciarrocchi

On 2/25/08, Andy Whitcroft

Quoted 6 lines

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