[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1404238152.14624.13.camel@joe-AO725>
Date: Tue, 01 Jul 2014 11:09:12 -0700
From: Joe Perches <joe@...ches.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Andy Whitcroft <apw@...onical.com>,
LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH] 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@...ches.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/;
}
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists