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] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LNX.2.00.1201280037080.13952@swampdragon.chaosbits.net>
Date:	Sat, 28 Jan 2012 00:43:39 +0100 (CET)
From:	Jesper Juhl <jj@...osbits.net>
To:	Dan Carpenter <dan.carpenter@...cle.com>
cc:	Greg Kroah-Hartman <gregkh@...e.de>, devel@...verdev.osuosl.org,
	Lucas De Marchi <lucas.demarchi@...fusion.mobi>,
	Ilia Mirkin <imirkin@...m.mit.edu>,
	linux-kernel@...r.kernel.org,
	"Justin P. Mattock" <justinmattock@...il.com>
Subject: Re: [PATCH 1/2] Staging; bcm/CmHost.c: Style cleanup

On Wed, 25 Jan 2012, Dan Carpenter wrote:

> This is probably going to need to be redone on top of the other bcm
> cleanup patches anyway.
> 
If that turns out to be so, well, so be it. I was not aware of other 
patches, so my bad...

> On Tue, Jan 24, 2012 at 11:46:31PM +0100, Jesper Juhl wrote:
> > +		pstClassifierEntry->ucDestPortRangeLength
> > +			= psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRangeLength/4;
> 
> Put the equals on the first line when you break something up like
> this. Also the real fix here is to choose shorter and better names
> than "cCPacketClassificationRule.u8ProtocolDestPortRangeLength".
> 
> If you're breaking up a condition normally the && or || go on the
> first line as well.
> 	if (foo &&
> 	    bar &&
> 	    baz) { ...
> 
> Although that's not in CodingStyle so it's not a "redo the patch"
> situation.
> 
As you say, "not in CodingStyle", so I guess it's down to your personal 
preference vs my personal preference vs what's most common in the kernel 
vs maintainers preference.

I did it the way I did for a reason.
I personally find that if one puts the '=', '==', '&&', '||', '+', 
<whatever> at the end of each line on a multi-line statement, then they 
are easy to overlook when just reading the code casually. If, however, one 
puts them at the start of each line, they stand out and are easier to see 
(harder to miss). That's why I did as I did. You may not agree, but at 
least now you know my reason for doing it the way I did.


-- 
Jesper Juhl <jj@...osbits.net>       http://www.chaosbits.net/
Don't top-post http://www.catb.org/jargon/html/T/top-post.html
Plain text mails only, please.

--
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