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>
This commit is contained in:
parent
619a908aa3
commit
04941aa774
1 changed files with 2 additions and 1 deletions
|
@ -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",
|
if (CHK("SPACING",
|
||||||
"No space is necessary after a cast\n" . $herecurr) &&
|
"No space is necessary after a cast\n" . $herecurr) &&
|
||||||
$fix) {
|
$fix) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue