summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2014-12-11 00:51:37 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-11 02:41:11 +0100
commit04941aa774320eb0118339c8cd11d7f1321e74d3 (patch)
tree18b686448c7595550bf5736032b2ab480f68dc7e /scripts
parentcheckpatch: add error on use of attribute((weak)) or __weak declarations (diff)
downloadlinux-04941aa774320eb0118339c8cd11d7f1321e74d3.tar.xz
linux-04941aa774320eb0118339c8cd11d7f1321e74d3.zip
checkpatch: improve test for no space after cast
sizeof(foo) is not a cast, allow a space after it. Signed-off-by: Joe Perches <joe@perches.com> Tested-by: Kalle Valo <kvalo@qca.qualcomm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/checkpatch.pl3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 8a577aa03bc6..d94f5d879fb1 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2515,7 +2515,8 @@ sub process {
}
}
- if ($line =~ /^\+.*\(\s*$Type\s*\)[ \t]+(?!$Assignment|$Arithmetic|{)/) {
+ if ($line =~ /^\+.*(\w+\s*)?\(\s*$Type\s*\)[ \t]+(?!$Assignment|$Arithmetic|[,;\({\[\<\>])/ &&
+ (!defined($1) || $1 !~ /sizeof\s*/)) {
if (CHK("SPACING",
"No space is necessary after a cast\n" . $herecurr) &&
$fix) {