From: Andy Whitcroft Date: Thu, 16 Oct 2008 05:02:33 +0000 (-0700) Subject: checkpatch: complex macros checks miss square brackets X-Git-Tag: v2.6.28-rc1~466 X-Git-Url: http://www.pilppa.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=bf30d6ede099c2a31b13bbd05b1022dc0da684d5;p=linux-2.6-omap-h63xx.git 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index c479bdefc77..54dfa2b543d 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{