linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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: Re: CodingStyle vs checkpatch for block comments
Date: Tue, 3 Apr 2012 14:08:11 -0400	[thread overview]
Message-ID: <4F7B3C8B.9010609@tilera.com> (raw)
In-Reply-To: <1333474907.26079.57.camel@joe2Laptop>

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.  Is it trying to ensure that multi-line block comments are
never preceded by a blank line?  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.

>> 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.
> Or just remove it or add a test for the patched file
> to be in net/... or drivers/net... or something.

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.

-- 
Chris Metcalf, Tilera Corp.
http://www.tilera.com


  reply	other threads:[~2012-04-03 18:08 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 [this message]
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=4F7B3C8B.9010609@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).