public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Check patch reports multiple var with a function assignment
@ 2007-07-31  2:45 Jason Wessel
  2007-07-31 12:46 ` Andy Whitcroft
  0 siblings, 1 reply; 2+ messages in thread
From: Jason Wessel @ 2007-07-31  2:45 UTC (permalink / raw)
  To: lkml; +Cc: apw, rdunlap, jschopp

Running checkpatch.pl products an warning when it should not.  I believe 
it can be fixed by adding to the regular expression, but feel free to 
fix it another way as I may not know all the cases this is trying to catch.

-- check patch output --
WARNING: declaring multiple variables together should be avoided
#451: FILE: drivers/serial/8250.c:1685:
+       unsigned char lsr = serial_inp(up, UART_LSR);

-- end check patch output --

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 73751ab..32c6d74 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -825,8 +825,8 @@ sub process {
 
 # check for multiple declarations, allowing for a function declaration
 # continuation.
-               if ($line =~ 
/^.\s*$Type\s+$Ident(?:\s*=[^,{]*)?\s*,\s*$Ident.*/ &&
-                   $line !~ 
/^.\s*$Type\s+$Ident(?:\s*=[^,{]*)?\s*,\s*$Type\s*$Ident.*/) {
+               if ($line =~ 
/^.\s*$Type\s+$Ident(?:\s*=[^,{\(]*)?\s*,\s*$Ident.*/ &&
+                   $line !~ 
/^.\s*$Type\s+$Ident(?:\s*=[^,{\(]*)?\s*,\s*$Type\s*$Ident.*/) {
                        WARN("declaring multiple variables together 
should be avoided\n" . $herecurr);
                }


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

* Re: [PATCH] Check patch reports multiple var with a function assignment
  2007-07-31  2:45 [PATCH] Check patch reports multiple var with a function assignment Jason Wessel
@ 2007-07-31 12:46 ` Andy Whitcroft
  0 siblings, 0 replies; 2+ messages in thread
From: Andy Whitcroft @ 2007-07-31 12:46 UTC (permalink / raw)
  To: Jason Wessel; +Cc: lkml, rdunlap, jschopp

Jason Wessel wrote:
> Running checkpatch.pl products an warning when it should not.  I believe
> it can be fixed by adding to the regular expression, but feel free to
> fix it another way as I may not know all the cases this is trying to catch.

Thanks for the patch.  We had already caught this one and the test
itself now is likely to be shelved, a new release with this update in is
iminent.

-apw

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

end of thread, other threads:[~2007-07-31 12:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-31  2:45 [PATCH] Check patch reports multiple var with a function assignment Jason Wessel
2007-07-31 12:46 ` Andy Whitcroft

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