[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <46AEA245.9090300@windriver.com>
Date: Mon, 30 Jul 2007 21:45:25 -0500
From: Jason Wessel <jason.wessel@...driver.com>
To: lkml <linux-kernel@...r.kernel.org>
CC: apw@...dowen.org, rdunlap@...otime.net, jschopp@...tin.ibm.com
Subject: [PATCH] Check patch reports multiple var with a function assignment
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@...driver.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);
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists