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
2016 2016
2017 # Flatten any parentheses2017 # 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)$/) {