lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 3 Apr 2012 14:27:21 -0400
From:	Chris Metcalf <cmetcalf@...era.com>
To:	Joe Perches <joe@...ches.com>
CC:	Kautuk Consul <consul.kautuk@...il.com>,
	"David S. Miller" <davem@...emloft.net>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: CodingStyle vs checkpatch for block comments



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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ