提交 04941aa7 编写于 作者: J Joe Perches 提交者: Linus Torvalds

checkpatch: improve test for no space after cast

sizeof(foo) is not a cast, allow a space after it.
Signed-off-by: NJoe Perches <joe@perches.com>
Tested-by: NKalle Valo <kvalo@qca.qualcomm.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册