public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix minor problems in checkpatch.pl-next
@ 2007-10-11 12:28 Mike D. Day
  2007-10-11 14:32 ` Andy Whitcroft
  0 siblings, 1 reply; 3+ messages in thread
From: Mike D. Day @ 2007-10-11 12:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andy Whitcroft, Erez Zadok, Ingo Molnar

When forming the prefix to output error msgs in gnu gcc format, the
lack of a type ($ or @) when referencing ARGV causes error messages.

When invoked to check source files, the linenumber was off by +3 in
the gcc format output.

Signed-off-by: Mike D. Day <ncmike@ncultra.org>

--- checkpatch.pl-next	2007-10-11 07:28:41.000000000 -0400
+++ /home/mdday/bin/checkpatch	2007-10-11 08:16:07.000000000 -0400
@@ -452,7 +452,6 @@
 
 		my $rawline = $line;
 
-		$prefix = "ARGV:$linenr: " if ($emacs);
 
 #extract the filename as it passes
 		if ($line=~/^\+\+\+\s+(\S+)/) {
@@ -517,6 +516,9 @@
 		my $herecurr = "$here\n$line\n";
 		my $hereprev = "$here\n$prevline\n$line\n";
 
+		$prefix = "@ARGV:$realline: " if ($emacs && $file);
+		$prefix = "@ARGV:$linenr: " if ($emacs && !$file);
+
 #check the patch for a signoff:
 		if ($line =~ /^\s*signed-off-by:/i) {
 			# This is a signoff, if ugly, so do not double report.

-- 
Mike Day
http://www.ncultra.org
AIM: ncmikeday |  Yahoo IM: ultra.runner
PGP key: http://www.ncultra.org/ncmike/pubkey.asc

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

* Re: [PATCH] fix minor problems in checkpatch.pl-next
  2007-10-11 12:28 [PATCH] fix minor problems in checkpatch.pl-next Mike D. Day
@ 2007-10-11 14:32 ` Andy Whitcroft
  2007-10-11 15:57   ` Mike D. Day
  0 siblings, 1 reply; 3+ messages in thread
From: Andy Whitcroft @ 2007-10-11 14:32 UTC (permalink / raw)
  To: Mike D. Day; +Cc: linux-kernel, Erez Zadok, Ingo Molnar

On Thu, Oct 11, 2007 at 08:28:00AM -0400, Mike D. Day wrote:
> When forming the prefix to output error msgs in gnu gcc format, the
> lack of a type ($ or @) when referencing ARGV causes error messages.
> 
> When invoked to check source files, the linenumber was off by +3 in
> the gcc format output.
> 
> Signed-off-by: Mike D. Day <ncmike@ncultra.org>
> 
> --- checkpatch.pl-next	2007-10-11 07:28:41.000000000 -0400
> +++ /home/mdday/bin/checkpatch	2007-10-11 08:16:07.000000000 -0400
> @@ -452,7 +452,6 @@
> 
> 		my $rawline = $line;
> 
> -		$prefix = "ARGV:$linenr: " if ($emacs);
> 
> #extract the filename as it passes
> 		if ($line=~/^\+\+\+\s+(\S+)/) {
> @@ -517,6 +516,9 @@
> 		my $herecurr = "$here\n$line\n";
> 		my $hereprev = "$here\n$prevline\n$line\n";
> 
> +		$prefix = "@ARGV:$realline: " if ($emacs && $file);
> +		$prefix = "@ARGV:$linenr: " if ($emacs && !$file);
> +
> #check the patch for a signoff:
> 		if ($line =~ /^\s*signed-off-by:/i) {
> 			# This is a signoff, if ugly, so do not double 
> 			report.

Hmmm, dunno how this one ever was visible?  Some error on my part.  That
line now shows $filename rather than ARGV.  

I see you have different line numbers depending on whether this is a
file or diff.  Would you ever pass in a plain diff in emacs mode, and
what would the line number mean.

-apw

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

* Re: fix minor problems in checkpatch.pl-next
  2007-10-11 14:32 ` Andy Whitcroft
@ 2007-10-11 15:57   ` Mike D. Day
  0 siblings, 0 replies; 3+ messages in thread
From: Mike D. Day @ 2007-10-11 15:57 UTC (permalink / raw)
  To: Andy Whitcroft; +Cc: linux-kernel, Erez Zadok, Ingo Molnar

On 11/10/07 15:32 +0100, Andy Whitcroft wrote:
>On Thu, Oct 11, 2007 at 08:28:00AM -0400, Mike D. Day wrote:
>> When forming the prefix to output error msgs in gnu gcc format, the
>> lack of a type ($ or @) when referencing ARGV causes error messages.
>> 
>> When invoked to check source files, the linenumber was off by +3 in
>> the gcc format output.
>> 
>> Signed-off-by: Mike D. Day <ncmike@ncultra.org>
>> 
>> --- checkpatch.pl-next	2007-10-11 07:28:41.000000000 -0400
>> +++ /home/mdday/bin/checkpatch	2007-10-11 08:16:07.000000000 -0400
>> @@ -452,7 +452,6 @@
>> 
>> 		my $rawline = $line;
>> 
>> -		$prefix = "ARGV:$linenr: " if ($emacs);
>> 
>> #extract the filename as it passes
>> 		if ($line=~/^\+\+\+\s+(\S+)/) {
>> @@ -517,6 +516,9 @@
>> 		my $herecurr = "$here\n$line\n";
>> 		my $hereprev = "$here\n$prevline\n$line\n";
>> 
>> +		$prefix = "@ARGV:$realline: " if ($emacs && $file);
>> +		$prefix = "@ARGV:$linenr: " if ($emacs && !$file);
>> +
>> #check the patch for a signoff:
>> 		if ($line =~ /^\s*signed-off-by:/i) {
>> 			# This is a signoff, if ugly, so do not double 
>> 			report.
>
>Hmmm, dunno how this one ever was visible?  Some error on my part.  That
>line now shows $filename rather than ARGV.  
>
>I see you have different line numbers depending on whether this is a
>file or diff.  Would you ever pass in a plain diff in emacs mode, and
>what would the line number mean.

Here is the message in my compile window as it is displayed by -next:

ARGV:148: ERROR: need a space before the open parenthesis '('
#148: FILE: home/mdday/src/slp-devel/src/cmd-utils/lslp-linux.c:145:
+  if(dieNow)

The filename is reported as ARGV and the line number is reported as
148. These should be FILE: #line:FILE: \basename\filename:line: 

Also, the line number is reported differently. The correct line number
is reported at the end of the second line.

I tested these patches with both sources and patches, from bash and from emacs and they seem to work ok.


Mike



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

-- 
Mike D. Day
IBM LTC
Cell: 919 412-3900
Sametime: ncmike@us.ibm.com AIM: ncmikeday  Yahoo: ultra.runner
PGP key: http://www.ncultra.org/ncmike/pubkey.asc

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

end of thread, other threads:[~2007-10-11 15:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-11 12:28 [PATCH] fix minor problems in checkpatch.pl-next Mike D. Day
2007-10-11 14:32 ` Andy Whitcroft
2007-10-11 15:57   ` Mike D. Day

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox