aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2014-08-06 19:10:52 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-08-06 21:01:28 -0400
commitf27c95db1176b41c6c87d9d3480d15efbca8f3ff (patch)
treecee0d9465e848c59d8b290b70a9b16e39d5d3b4c /scripts
parent1574a29f8e769998fe3e55eb6030dc61e3d09ccd (diff)
checkpatch: improve "no space after cast" test
This --strict test previously worked only for what appeared to be cast to pointer types. Make it work for all casts. Also, there's no reason to show the previous line for this type of message, so don't. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/checkpatch.pl6
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 57a11d7ee841..b351805149a5 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2260,12 +2260,12 @@ sub process {
2260 } 2260 }
2261 } 2261 }
2262 2262
2263 if ($line =~ /^\+.*\*[ \t]*\)[ \t]+(?!$Assignment|$Arithmetic)/) { 2263 if ($line =~ /^\+.*\(\s*$Type\s*\)[ \t]+(?!$Assignment|$Arithmetic)/) {
2264 if (CHK("SPACING", 2264 if (CHK("SPACING",
2265 "No space is necessary after a cast\n" . $hereprev) && 2265 "No space is necessary after a cast\n" . $herecurr) &&
2266 $fix) { 2266 $fix) {
2267 $fixed[$linenr - 1] =~ 2267 $fixed[$linenr - 1] =~
2268 s/^(\+.*\*[ \t]*\))[ \t]+/$1/; 2268 s/(\(\s*$Type\s*\))[ \t]+/$1/;
2269 } 2269 }
2270 } 2270 }
2271 2271