From: Chris Metcalf <cmetcalf@tilera.com>
To: Joe Perches <joe@perches.com>
Cc: Kautuk Consul <consul.kautuk@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: CodingStyle vs checkpatch for block comments
Date: Tue, 3 Apr 2012 13:25:52 -0400 [thread overview]
Message-ID: <4F7B32A0.1020009@tilera.com> (raw)
In-Reply-To: <1333472391.26079.47.camel@joe2Laptop>
(Adding linux-kernel to the cc's and restating the question...)
I accepted a patch from Kautuk Consul and adjusted his comment style, but
he pointed out that he had changed his comment style based on a warning
from checkpatch.
The Documentation/CodingStyle file says:
The preferred style for long (multi-line) comments is:
/*
* This is the preferred style for multi-line
* comments in the Linux kernel source code.
* Please use it consistently.
*
* Description: A column of asterisks on the left side,
* with beginning and ending almost-blank lines.
*/
However, a new change to "checkpatch --strict" by Joe Perches, commit
aad4f61498, causes this construct to be flagged as a warning if (and only
if) it is preceded by a blank line. Joe said the change was to support
David Miller's preferred style, but that he didn't much care one way or
another.
The relevant code in checkpatch.pl is:
if ($rawline =~ /^\+[ \t]*\/\*[ \t]*$/ &&
$prevrawline =~ /^\+[ \t]*$/) {
CHK("BLOCK_COMMENT_STYLE",
"Don't begin block comments with only a /*
line, use /* comment...\n" . $hereprev);
}
So, my questions -
1. I'm not sure what the regexps are really trying to avoid. Presumably a
blank line followed by a block comment is OK? Certainly the kernel sources
are full of this construct.
2. The actual warning message emitted seems to directly contradict the
CodingStyle document, so presumably we should either clarify the message,
or update CodingStyle if we're really trying to change the style.
--
Chris Metcalf, Tilera Corp.
http://www.tilera.com
next prev parent reply other threads:[~2012-04-03 17:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-31 12:05 [PATCH 15/19 v2] tile/mm/fault.c: Port OOM changes to handle_page_fault Kautuk Consul
2012-04-03 16:11 ` Chris Metcalf
[not found] ` <CAFPAmTTfYKT39gdoKT3P4G2O0xkTSS8g62kKudeLcnpdipzJqg@mail.gmail.com>
[not found] ` <4F7B21FB.3040609@tilera.com>
[not found] ` <CAFPAmTS_2H7BzGndcceBxdnJroy82u++sduCPO2+qxG6-WA=nw@mail.gmail.com>
[not found] ` <4F7B2766.9080208@tilera.com>
[not found] ` <1333471474.26079.43.camel@joe2Laptop>
[not found] ` <4F7B2AA7.5010906@tilera.com>
[not found] ` <1333472391.26079.47.camel@joe2Laptop>
2012-04-03 17:25 ` Chris Metcalf [this message]
2012-04-03 17:41 ` CodingStyle vs checkpatch for block comments Joe Perches
2012-04-03 18:08 ` Chris Metcalf
2012-04-03 18:16 ` Joe Perches
2012-04-03 18:27 ` Chris Metcalf
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=4F7B32A0.1020009@tilera.com \
--to=cmetcalf@tilera.com \
--cc=consul.kautuk@gmail.com \
--cc=davem@davemloft.net \
--cc=joe@perches.com \
--cc=linux-kernel@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;
as well as URLs for NNTP newsgroup(s).