aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/checkpatch.pl
diff options
context:
space:
mode:
authorAndy Whitcroft <apw@canonical.com>2009-01-15 16:51:06 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-15 19:39:38 -0500
commit63f17f8973ccdb8260e59ce5b1b4e2b2ee0401f0 (patch)
treed37e5333ccb5ea5467f6d98d2efd4c1daf681364 /scripts/checkpatch.pl
parentf9a0b3d17a01fe1ba24ce1e9c18666a52052e011 (diff)
checkpatch: allow parentheses on return handle array values
When we allow return to have surrounding parentheses when containing comparison operators we are not correctly handling the case where the values contain array sufffixes. Squash them. Signed-off-by: Andy Whitcroft <apw@canonical.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-xscripts/checkpatch.pl6
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 1d7924ad3a34..696196e194f5 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2016,7 +2016,11 @@ sub process {
2016 2016
2017 # Flatten any parentheses 2017 # Flatten any parentheses
2018 $value =~ s/\)\(/\) \(/g; 2018 $value =~ s/\)\(/\) \(/g;
2019 while ($value !~ /(?:$Ident|-?$Constant)\s*$Compare\s*(?:$Ident|-?$Constant)/ && $value =~ s/\([^\(\)]*\)/1/) { 2019 while ($value =~ s/\[[^\{\}]*\]/1/ ||
2020 $value !~ /(?:$Ident|-?$Constant)\s*
2021 $Compare\s*
2022 (?:$Ident|-?$Constant)/x &&
2023 $value =~ s/\([^\(\)]*\)/1/) {
2020 } 2024 }
2021 2025
2022 if ($value =~ /^(?:$Ident|-?$Constant)$/) { 2026 if ($value =~ /^(?:$Ident|-?$Constant)$/) {