From: Joe Perches Date: Wed, 6 Aug 2014 23:11:27 +0000 (-0700) Subject: checkpatch: fix false positives for --strict "space after cast" test X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=308cc8d8f0deab2c5a5162316277ced556acc71f;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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: Joe Perches Reported-by: Hartley Sweeten Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index a0880ede3db9..9f14bf928cc7 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -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", "No space is necessary after a cast\n" . $herecurr) && $fix) {