dect
/
linux-2.6
Archived
13
0
Fork 0

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>
This commit is contained in:
Andy Whitcroft 2012-01-10 15:10:08 -08:00 committed by Linus Torvalds
parent 72f115f94d
commit e01886ada2
1 changed files with 1 additions and 1 deletions

View File

@ -2609,7 +2609,7 @@ sub process {
# Flatten any parentheses
$value =~ s/\(/ \(/g;
$value =~ s/\)/\) /g;
while ($value =~ s/\[[^\{\}]*\]/1/ ||
while ($value =~ s/\[[^\[\]]*\]/1/ ||
$value !~ /(?:$Ident|-?$Constant)\s*
$Compare\s*
(?:$Ident|-?$Constant)/x &&