Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e01886ad authored by Andy Whitcroft's avatar Andy Whitcroft Committed by Linus Torvalds
Browse files

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: default avatarAndy Whitcroft <apw@canonical.com>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 72f115f9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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 &&