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: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
caac1d5fdd
commit
43f7fe52a8
@ -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) &&
|
||||
|
||||
Loading…
Reference in New Issue
Block a user