Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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) {