提交 308cc8d8 编写于 作者: J Joe Perches 提交者: Linus Torvalds

checkpatch: fix false positives for --strict "space after cast" test

Commit 89da401f6cff ("checkpatch: improve "no space after cast" test")
in -next improved the cast test for non pointer types, but also
introduced false positives for some types of static inlines.

Add a test for an open brace to the exclusions to avoid these false
positives.
Signed-off-by: NJoe Perches <joe@perches.com>
Reported-by: NHartley Sweeten <HartleyS@visionengravers.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 e81f239b
...@@ -2456,7 +2456,7 @@ sub process { ...@@ -2456,7 +2456,7 @@ sub process {
} }
} }
if ($line =~ /^\+.*\(\s*$Type\s*\)[ \t]+(?!$Assignment|$Arithmetic)/) { if ($line =~ /^\+.*\(\s*$Type\s*\)[ \t]+(?!$Assignment|$Arithmetic|{)/) {
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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册