Check patch reports multiple var with a function assignment
PATCH 1/1 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 --
scripts/checkpatch.pl +0 -0
@@ -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);
}Quoted 3 lines · Jason Wessel
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