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: <20070430100917.439ebfc8.akpm@linux-foundation.org>
Date:	Mon, 30 Apr 2007 10:09:17 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Christoph Hellwig <hch@...radead.org>
Cc:	Roland McGrath <roland@...hat.com>, Christoph Hellwig <hch@....de>,
	linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org
Subject: Re: condingstyle, was Re: utrace comments

On Mon, 30 Apr 2007 10:11:21 +0100 Christoph Hellwig <hch@...radead.org> wrote:

> I've separated this out under a new subject because some style issues
> that so far aren't documented explicitly are in doubt here, and Roland
> wants and Answer from Andrew.
> 
> We also should put clauses on this into CodingStyle.
> 
> 
> On Sun, Apr 29, 2007 at 09:02:13PM -0700, Roland McGrath wrote:
> > > 	The coding style here is wrong.  The else should be on the line
> > > 	of the closing brace.  
> > 
> > I can ordinarily ignore syntax, but this is an abomination in the sight
> > of the Lord and always will be.  Fortunately, it's far from being 100%
> > consistently used in the kernel already.  People are welcome to change
> > the code after I submit it, but I just can't make myself write it that
> > way, sorry.

I'm a bit lost here.  Are we referring to

	if (expr) {
		...
	} else {
		...
	}

versus

	if (expr) {
		...
	}
	else {
		...
	}

?

If so the former is usual style.  People do add code which does the latter,
but it tends to get fixed up later on when someone else does some work on
the same code.

> > > 	This doesn't follow kernel coding style at all, we always
> > > 	put the && or || operators at the end of the closing line.
> > 
> > I could swear I've been "corrected" in the opposite direction on this one.
> > It is not mentioned in Documentation/CodingStyle, and the existing kernel
> > code is far from consistent on it.  I really don't care which way it is,
> > but I'd like clear authoritative direction from Linus and Andrew before I
> > bother with it.

This is

	if (expr1 &&
		expr2)

versus

	if (expr1
		&& expr2)

the former is more common and is, IMO, more readable.

The latter can be handy sometimes to prevent an 80-col overflow in the
first line.

-
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