diff options
| -rwxr-xr-x | scripts/checkpatch.pl | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 32d6a236570d..8d010ac0efe1 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
| @@ -2183,15 +2183,16 @@ sub process { | |||
| 2183 | my $value = $2; | 2183 | my $value = $2; |
| 2184 | 2184 | ||
| 2185 | # Flatten any parentheses | 2185 | # Flatten any parentheses |
| 2186 | $value =~ s/\)\(/\) \(/g; | 2186 | $value =~ s/\(/ \(/g; |
| 2187 | $value =~ s/\)/\) /g; | ||
| 2187 | while ($value =~ s/\[[^\{\}]*\]/1/ || | 2188 | while ($value =~ s/\[[^\{\}]*\]/1/ || |
| 2188 | $value !~ /(?:$Ident|-?$Constant)\s* | 2189 | $value !~ /(?:$Ident|-?$Constant)\s* |
| 2189 | $Compare\s* | 2190 | $Compare\s* |
| 2190 | (?:$Ident|-?$Constant)/x && | 2191 | (?:$Ident|-?$Constant)/x && |
| 2191 | $value =~ s/\([^\(\)]*\)/1/) { | 2192 | $value =~ s/\([^\(\)]*\)/1/) { |
| 2192 | } | 2193 | } |
| 2193 | 2194 | #print "value<$value>\n"; | |
| 2194 | if ($value =~ /^(?:$Ident|-?$Constant)$/) { | 2195 | if ($value =~ /^\s*(?:$Ident|-?$Constant)\s*$/) { |
| 2195 | ERROR("return is not a function, parentheses are not required\n" . $herecurr); | 2196 | ERROR("return is not a function, parentheses are not required\n" . $herecurr); |
| 2196 | 2197 | ||
| 2197 | } elsif ($spacing !~ /\s+/) { | 2198 | } elsif ($spacing !~ /\s+/) { |
