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>
This commit is contained in:
parent
f9a0b3d17a
commit
63f17f8973
1 changed files with 5 additions and 1 deletions
|
@ -2016,7 +2016,11 @@ sub process {
|
||||||
|
|
||||||
# Flatten any parentheses
|
# Flatten any parentheses
|
||||||
$value =~ s/\)\(/\) \(/g;
|
$value =~ s/\)\(/\) \(/g;
|
||||||
while ($value !~ /(?:$Ident|-?$Constant)\s*$Compare\s*(?:$Ident|-?$Constant)/ && $value =~ s/\([^\(\)]*\)/1/) {
|
while ($value =~ s/\[[^\{\}]*\]/1/ ||
|
||||||
|
$value !~ /(?:$Ident|-?$Constant)\s*
|
||||||
|
$Compare\s*
|
||||||
|
(?:$Ident|-?$Constant)/x &&
|
||||||
|
$value =~ s/\([^\(\)]*\)/1/) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($value =~ /^(?:$Ident|-?$Constant)$/) {
|
if ($value =~ /^(?:$Ident|-?$Constant)$/) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue