Skip to content

Commit

Permalink
checkpatch: return is not a function -- parentheses for casts are ok too
Browse files Browse the repository at this point in the history
Casts require parentheses so it is possible to have something like this:

	return (int)(*a);

This miss trips the complexity function.  Ensure that the two separate
parenthesised sections are not coelesced.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Andy Whitcroft authored and Linus Torvalds committed Jul 24, 2008
1 parent 6cbb2e7 commit fee61c4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions scripts/checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1670,6 +1670,7 @@ sub process {
my $value = $2;

# Flatten any parentheses and braces
$value =~ s/\)\(/\) \(/g;
while ($value =~ s/\([^\(\)]*\)/1/) {
}

Expand Down

0 comments on commit fee61c4

Please sign in to comment.