* [PATCH] checkpatch: Improve "no space after cast" test
@ 2014-07-01 18:09 Joe Perches
0 siblings, 0 replies; only message in thread
From: Joe Perches @ 2014-07-01 18:09 UTC (permalink / raw)
To: Andrew Morton; +Cc: Andy Whitcroft, LKML
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>
---
scripts/checkpatch.pl | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 182be0f..0a3c759 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2256,12 +2256,12 @@ sub process {
}
}
- if ($line =~ /^\+.*\*[ \t]*\)[ \t]+(?!$Assignment|$Arithmetic)/) {
+ if ($line =~ /^\+.*\(\s*$Type\s*\)[ \t]+(?!$Assignment|$Arithmetic)/) {
if (CHK("SPACING",
- "No space is necessary after a cast\n" . $hereprev) &&
+ "No space is necessary after a cast\n" . $herecurr) &&
$fix) {
$fixed[$linenr - 1] =~
- s/^(\+.*\*[ \t]*\))[ \t]+/$1/;
+ s/(\(\s*$Type\s*\))[ \t]+/$1/;
}
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-07-01 18:09 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-01 18:09 [PATCH] checkpatch: Improve "no space after cast" test Joe Perches
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®