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:27:21 -0400	[thread overview]
Message-ID: <4F7B4109.9030008@tilera.com> (raw)
In-Reply-To: <1333477010.26079.65.camel@joe2Laptop>



On 4/3/2012 2:16 PM, Joe Perches wrote:
> 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();
>
> [....]
> It's suggesting that a multi line comment block
> starting with only a /* wastes space on vertically
> challenged terminals.

So I suggest we drop the check from checkpatch, then, since it appears to
conflict with Documentation/CodingStyle.
-- 
Chris Metcalf, Tilera Corp.
http://www.tilera.com


      reply	other threads:[~2012-04-03 18:27 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
2012-04-03 18:27                         ` Chris Metcalf [this message]

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=4F7B4109.9030008@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).