lkml.org 
[lkml]   [2009]   [Jan]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/6] checkpatch: allow parentheses on return handle array values
Date
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


\
 
 \ /
  Last update: 2009-01-12 13:49    [W:0.113 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site