summaryrefslogtreecommitdiffstats
path: root/scripts/checkpatch.pl
diff options
context:
space:
mode:
authorAndy Whitcroft2008-10-16 07:02:33 +0200
committerLinus Torvalds2008-10-16 20:21:37 +0200
commitbf30d6ede099c2a31b13bbd05b1022dc0da684d5 (patch)
tree54bf58e8077d06b7430b08044241cc230d5f5fca /scripts/checkpatch.pl
parentcheckpatch: suspect code indent must stop at #else/#elif (diff)
downloadkernel-qcow2-linux-bf30d6ede099c2a31b13bbd05b1022dc0da684d5.tar.gz
kernel-qcow2-linux-bf30d6ede099c2a31b13bbd05b1022dc0da684d5.tar.xz
kernel-qcow2-linux-bf30d6ede099c2a31b13bbd05b1022dc0da684d5.zip
checkpatch: complex macros checks miss square brackets
We are missing 'simple' values which include square brackets. Refactor to ensure we handle nesting correctly and detect these simple forms. Signed-off-by: Andy Whitcroft <apw@shadowen.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-xscripts/checkpatch.pl7
1 files changed, 4 insertions, 3 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index c479bdefc779..54dfa2b543dd 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2142,9 +2142,10 @@ sub process {
$dstat =~ s/\s*$//s;
# Flatten any parentheses and braces
- while ($dstat =~ s/\([^\(\)]*\)/1/) {
- }
- while ($dstat =~ s/\{[^\{\}]*\}/1/) {
+ while ($dstat =~ s/\([^\(\)]*\)/1/ ||
+ $dstat =~ s/\{[^\{\}]*\}/1/ ||
+ $dstat =~ s/\[[^\{\}]*\]/1/)
+ {
}
my $exceptions = qr{