Messages in this thread Patch in this message | | | Subject | [PATCH] checkpatch: Fix false positives for --strict "space after cast" test | From | Joe Perches <> | Date | Tue, 22 Jul 2014 21:31:18 -0700 |
| |
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.
Reported-by: Hartley Sweeten <HartleyS@visionengravers.com> Signed-off-by: Joe Perches <joe@perches.com> --- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index dc72a9b..7dcfc75 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2418,7 +2418,7 @@ sub process { } } - if ($line =~ /^\+.*\(\s*$Type\s*\)[ \t]+(?!$Assignment|$Arithmetic)/) { + if ($line =~ /^\+.*\(\s*$Type\s*\)[ \t]+(?!$Assignment|$Arithmetic|{)/) { if (CHK("SPACING", "No space is necessary after a cast\n" . $herecurr) && $fix) {
| |