]> git.karo-electronics.de Git - karo-tx-linux.git/commit
checkpatch: improve "return is not a function" test
authorJoe Perches <joe@perches.com>
Tue, 5 Nov 2013 05:56:57 +0000 (16:56 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 5 Nov 2013 05:56:57 +0000 (16:56 +1100)
commit1d263d5cea3360eeee11b9556c63c51cee51068e
tree71cdfd9cb972168bc6cb27504a95c80a917561db
parenta6aa32ce72296147713ab576cf2ceb8c3f7e85be
checkpatch: improve "return is not a function" test

Find a few more cases where parentheses are used around the value of a
return statement.

This now uses the "$balanced_parens" test and also makes the test depend
on perl v5.10 and higher.

This now finds return with parenthesis uses the old code did not find
like:

ERROR: return is not a function, parentheses are not required
#211: FILE: arch/m68k/include/asm/sun3xflop.h:211:
+ return ((error == 0) ? 0 : -1);

Signed-off-by: Joe Perches <joe@perches.com>
Tested-by: David Cohen <david.a.cohen@linux.intel.com>
Acked-by: David Cohen <david.a.cohen@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
scripts/checkpatch.pl