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

Commit 43f7fe52 authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds
Browse files

checkpatch: improve "no space necessary after cast" test



Code like:
	if (a < sizeof(<type>) &&
and
	{ .len = sizeof(<type>) },

incorrectly emits that warning, so add more exceptions to avoid
the warning.

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent caac1d5f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2541,7 +2541,7 @@ sub process {
			}
		}

		if ($line =~ /^\+.*(\w+\s*)?\(\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) &&