diff options
author | Andy Whitcroft <apw@canonical.com> | 2012-01-10 18:10:08 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-10 19:30:51 -0500 |
commit | e01886ada28741d7cb2cfb3224e9caccfbc1a2d5 (patch) | |
tree | ba401dddad6fffc2dc079e1449f20c2091195a41 /scripts/checkpatch.pl | |
parent | 72f115f94d500fc72f78c5df8104a98f8b9cc273 (diff) |
checkpatch: fix 'return is not a function' square bracket handling
We are incorrectly matching square brackets '[' and ']' leading to false
positives on more complex functions as below:
return (dt3155_fbuffer[m]->ready_head -
dt3155_fbuffer[m]->ready_len +
dt3155_fbuffer[m]->nbuffers)%
(dt3155_fbuffer[m]->nbuffers);
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-x | scripts/checkpatch.pl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index ca6d0fb229f2..5e3f4191f959 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -2609,7 +2609,7 @@ sub process { | |||
2609 | # Flatten any parentheses | 2609 | # Flatten any parentheses |
2610 | $value =~ s/\(/ \(/g; | 2610 | $value =~ s/\(/ \(/g; |
2611 | $value =~ s/\)/\) /g; | 2611 | $value =~ s/\)/\) /g; |
2612 | while ($value =~ s/\[[^\{\}]*\]/1/ || | 2612 | while ($value =~ s/\[[^\[\]]*\]/1/ || |
2613 | $value !~ /(?:$Ident|-?$Constant)\s* | 2613 | $value !~ /(?:$Ident|-?$Constant)\s* |
2614 | $Compare\s* | 2614 | $Compare\s* |
2615 | (?:$Ident|-?$Constant)/x && | 2615 | (?:$Ident|-?$Constant)/x && |