From: Joe Perches <joe@perches.com>
To: Chris Metcalf <cmetcalf@tilera.com>
Cc: Kautuk Consul <consul.kautuk@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: CodingStyle vs checkpatch for block comments
Date: Tue, 03 Apr 2012 11:16:50 -0700 [thread overview]
Message-ID: <1333477010.26079.65.camel@joe2Laptop> (raw)
In-Reply-To: <4F7B3C8B.9010609@tilera.com>
On Tue, 2012-04-03 at 14:08 -0400, Chris Metcalf wrote:
> On 4/3/2012 1:41 PM, Joe Perches wrote:
> > On Tue, 2012-04-03 at 13:25 -0400, Chris Metcalf wrote:
> >> 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.
> > It emits a check message on
> > <blank line>
> > /*
> >
> > but not
> > <blank line>
> > /* some actual comment
>
> Right, I understand what the regexps do, I'm just not clear on what the
> rationale is.
Fewer vertical lines for block comments.
This block comment uses a lot of lines:
some_code();
}
/*
* Some multiline
* block comment
*/
some_more_code();
This is 1 fewer line
some_code();
}
/* Some multline
* block comment
*/
some_more_code();
> Is it trying to ensure that multi-line block comments are
> never preceded by a blank line?
No.
> Is it trying to change the format of block
> comments such that they either are preceded by a blank line, or a
> standalone "/*", but not both? Confusing.
It's suggesting that a multi line comment block
starting with only a /* wastes space on vertically
challenged terminals.
Some of my friends are also vertically challenged,
so I understand the desire to be efficient.
> Obviously removing it would be an easy fix. :-) I don't know if it makes
> sense to advocate for different kernel comment styles in different subtrees.
<shrug> I don't care much either way.
The content of the comment is more important.
next prev parent reply other threads:[~2012-04-03 18:16 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 ` CodingStyle vs checkpatch for block comments Chris Metcalf
2012-04-03 17:41 ` Joe Perches
2012-04-03 18:08 ` Chris Metcalf
2012-04-03 18:16 ` Joe Perches [this message]
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=1333477010.26079.65.camel@joe2Laptop \
--to=joe@perches.com \
--cc=cmetcalf@tilera.com \
--cc=consul.kautuk@gmail.com \
--cc=davem@davemloft.net \
--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
Powered by JetHome