Messages in this thread Patch in this message | | | From | Andy Whitcroft <> | Subject | [PATCH 3/6] checkpatch: allow parentheses on return handle array values | Date | Mon, 12 Jan 2009 12:45:01 +0000 |
| |
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> --- scripts/checkpatch.pl | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 1d7924a..696196e 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2016,7 +2016,11 @@ sub process { # Flatten any parentheses $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)$/) { -- 1.6.0.4.911.gc990
| |