From: akpm@linux-foundation.org
To: joe@perches.com, charlemagnelasse@gmail.com, mm-commits@vger.kernel.org
Subject: [merged] checkpatch-improve-the-block-comment-alignment-test.patch removed from -mm tree
Date: Wed, 12 Oct 2016 12:23:18 -0700 [thread overview]
Message-ID: <57fe8da6.snrOb8tKqFl8aDat%akpm@linux-foundation.org> (raw)
The patch titled
Subject: checkpatch: improve the block comment * alignment test
has been removed from the -mm tree. Its filename was
checkpatch-improve-the-block-comment-alignment-test.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
From: Joe Perches <joe@perches.com>
Subject: checkpatch: improve the block comment * alignment test
An "uninitialized value" is emitted when a block comment starts on
the same line as a statement.
Fix this and make the test use a little fewer cpu cycles too.
Link: http://lkml.kernel.org/r/3c9993320c2182d37f53ac540878cfef59c3f62d.1473365956.git.joe@perches.com
Signed-off-by: Joe Perches <joe@perches.com>
Reported-by: Charlemagne Lasse <charlemagnelasse@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
scripts/checkpatch.pl | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff -puN scripts/checkpatch.pl~checkpatch-improve-the-block-comment-alignment-test scripts/checkpatch.pl
--- a/scripts/checkpatch.pl~checkpatch-improve-the-block-comment-alignment-test
+++ a/scripts/checkpatch.pl
@@ -3005,18 +3005,23 @@ sub process {
# Block comment * alignment
if ($prevline =~ /$;[ \t]*$/ && #ends in comment
- (($prevrawline =~ /^\+.*?\/\*/ && #starting /*
+ $line =~ /^\+[ \t]*$;/ && #leading comment
+ $rawline =~ /^\+[ \t]*\*/ && #leading *
+ (($prevrawline =~ /^\+.*?\/\*/ && #leading /*
$prevrawline !~ /\*\/[ \t]*$/) || #no trailing */
- $prevrawline =~ /^\+[ \t]*\*/) && #starting *
- $rawline =~ /^\+[ \t]*\*/) { #rawline *
+ $prevrawline =~ /^\+[ \t]*\*/)) { #leading *
+ my $oldindent;
$prevrawline =~ m@^\+([ \t]*/?)\*@;
- my $oldindent = expand_tabs($1);
+ if (defined($1)) {
+ $oldindent = expand_tabs($1);
+ } else {
+ $prevrawline =~ m@^\+(.*/?)\*@;
+ $oldindent = expand_tabs($1);
+ }
$rawline =~ m@^\+([ \t]*)\*@;
my $newindent = $1;
- my $test_comment = '^\\+' . "$;" x (length($newindent) + 1);
$newindent = expand_tabs($newindent);
- if ($line =~ /$test_comment/ &&
- length($oldindent) ne length($newindent)) {
+ if (length($oldindent) ne length($newindent)) {
WARN("BLOCK_COMMENT_STYLE",
"Block comments should align the * on each line\n" . $hereprev);
}
_
Patches currently in -mm which might be from joe@perches.com are
reply other threads:[~2016-10-12 19:24 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=57fe8da6.snrOb8tKqFl8aDat%akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=charlemagnelasse@gmail.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mm-commits@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox