]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
checkpatch: return is not a function -- parentheses for casts are ok too
authorAndy Whitcroft <apw@shadowen.org>
Thu, 24 Jul 2008 04:28:56 +0000 (21:28 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 24 Jul 2008 17:47:25 +0000 (10:47 -0700)
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>
scripts/checkpatch.pl

index 66f060ecb81fab6e8ce5240954a1f5224f7d7ca3..83ae37b3862121ad68980138fe71df96180d85cf 100755 (executable)
@@ -1670,6 +1670,7 @@ sub process {
                        my $value = $2;
 
                        # Flatten any parentheses and braces
+                       $value =~ s/\)\(/\) \(/g;
                        while ($value =~ s/\([^\(\)]*\)/1/) {
                        }