Commit 04941aa7 authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds

checkpatch: improve test for no space after cast

sizeof(foo) is not a cast, allow a space after it.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Tested-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 619a908a
......@@ -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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment