Messages in this thread | | | Date | Wed, 25 Apr 2007 08:15:25 -0700 | From | Randy Dunlap <> | Subject | Re: + codingstyle-start-flamewar-about-use-of-braces.patch added to -mm tree |
| |
On Fri, 20 Apr 2007 11:02:23 -0700 akpm@linux-foundation.org wrote:
> > The patch titled > CodingStyle: start flamewar about use of braces > has been added to the -mm tree. Its filename is > codingstyle-start-flamewar-about-use-of-braces.patch > > *** Remember to use Documentation/SubmitChecklist when testing your code *** > > See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find > out what to do about this > > ------------------------------------------------------ > Subject: CodingStyle: start flamewar about use of braces > From: Oliver Neukum <oliver@neukum.org> > > Signed-off-by: Oliver Neukum <oneukum@suse.de> > Cc: Tilman Schmidt <tilman@imap.cc> > Signed-off-by: Andrew Morton <akpm@linux-foundation.org> > ---
Was this on lkml? I couldn't find it anywhere.
I won't add an ack to it. No flames.
> Documentation/CodingStyle | 15 +++++++++++++++ > 1 files changed, 15 insertions(+) > > diff -puN Documentation/CodingStyle~codingstyle-start-flamewar-about-use-of-braces Documentation/CodingStyle > --- a/Documentation/CodingStyle~codingstyle-start-flamewar-about-use-of-braces > +++ a/Documentation/CodingStyle > @@ -160,6 +160,21 @@ supply of new-lines on your screen is no > 25-line terminal screens here), you have more empty lines to put > comments on. > > +Do not unnecessarily use braces where a single statement will do. > + > +if (condition) > + action(); > + > +This does not apply if one branch of a conditional statement is a single > +statement. Use braces in both branches. > + > +if (condition) { > + do_this(); > + do_that(); > +} else { > + otherwise(); > +} > + > 3.1: Spaces > > Linux kernel style for use of spaces depends (mostly) on
--- ~Randy *** Remember to use Documentation/SubmitChecklist when testing your code *** - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |