aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/checkpatch.pl5
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index b953c76be369..5c7fd1a4f930 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -127,6 +127,7 @@ our $Lval = qr{$Ident(?:$Member)*};
127 127
128our $Constant = qr{(?:[0-9]+|0x[0-9a-fA-F]+)[UL]*}; 128our $Constant = qr{(?:[0-9]+|0x[0-9a-fA-F]+)[UL]*};
129our $Assignment = qr{(?:\*\=|/=|%=|\+=|-=|<<=|>>=|&=|\^=|\|=|=)}; 129our $Assignment = qr{(?:\*\=|/=|%=|\+=|-=|<<=|>>=|&=|\^=|\|=|=)};
130our $Compare = qr{<=|>=|==|!=|<|>};
130our $Operators = qr{ 131our $Operators = qr{
131 <=|>=|==|!=| 132 <=|>=|==|!=|
132 =>|->|<<|>>|<|>|!|~| 133 =>|->|<<|>>|<|>|!|~|
@@ -1983,9 +1984,9 @@ sub process {
1983 my $spacing = $1; 1984 my $spacing = $1;
1984 my $value = $2; 1985 my $value = $2;
1985 1986
1986 # Flatten any parentheses and braces 1987 # Flatten any parentheses
1987 $value =~ s/\)\(/\) \(/g; 1988 $value =~ s/\)\(/\) \(/g;
1988 while ($value =~ s/\([^\(\)]*\)/1/) { 1989 while ($value !~ /(?:$Ident|-?$Constant)\s*$Compare\s*(?:$Ident|-?$Constant)/ && $value =~ s/\([^\(\)]*\)/1/) {
1989 } 1990 }
1990 1991
1991 if ($value =~ /^(?:$Ident|-?$Constant)$/) { 1992 if ($value =~ /^(?:$Ident|-?$Constant)$/) {