[PATCH 08/13] checkpatch: complex macros checks miss square brackets

From: Andy Whitcroft
Date: Fri Oct 03 2008 - 11:28:40 EST


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@xxxxxxxxxxxx>
---
scripts/checkpatch.pl | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index c479bde..54dfa2b 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{
--
1.6.0.1.451.gc8d31

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/