From bf30d6ede099c2a31b13bbd05b1022dc0da684d5 Mon Sep 17 00:00:00 2001 From: Andy Whitcroft Date: Wed, 15 Oct 2008 22:02:33 -0700 Subject: 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 --- scripts/checkpatch.pl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'scripts') 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{ -- cgit v1.2.3