History

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.

Andy Whitcroft committed 17 years ago

Commit 63f17f81 parent f9a0b3d1 file · +5 −1Browse files

Showing the changes to scripts/checkpatch.pl (1 of 1 file). Show all

Unified · Split

scripts/checkpatch.pl+5−1
@@ -2016,7 +2016,11 @@ sub process { · 2015 unmodified lines
20162016
20172017 # Flatten any parentheses
20182018 $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/) {
20202024 }
20212025
20222026 if ($value =~ /^(?:$Ident|-?$Constant)$/) {