]> git.baikalelectronics.ru Git - kernel.git/commit
checkpatch: improve "return is not a function" test
authorJoe Perches <joe@perches.com>
Tue, 12 Nov 2013 23:10:13 +0000 (15:10 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 13 Nov 2013 03:09:25 +0000 (12:09 +0900)
commit21585acf5df8cb2d7507e9e02c094ea6046d8d13
treec31ed1d6e0fa1686ac3738aea997a82fc524bade
parent4b43f9ce18b2615270e0f839189a70beadc3d75c
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>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
scripts/checkpatch.pl