mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Randy Dunlap <randy.dunlap@oracle.com>
To: linux-kernel@vger.kernel.org
Cc: akpm@linux-foundation.org, mm-commits@vger.kernel.org,
	oliver@neukum.org, oneukum@suse.de, tilman@imap.cc
Subject: Re: + codingstyle-start-flamewar-about-use-of-braces.patch added to -mm tree
Date: Wed, 25 Apr 2007 08:15:25 -0700	[thread overview]
Message-ID: <20070425081525.9e9b1e57.randy.dunlap@oracle.com> (raw)
In-Reply-To: <200704201802.l3KI2Nlh020621@shell0.pdx.osdl.net>

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

           reply	other threads:[~2007-04-25 15:12 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <200704201802.l3KI2Nlh020621@shell0.pdx.osdl.net>]

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=20070425081525.9e9b1e57.randy.dunlap@oracle.com \
    --to=randy.dunlap@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mm-commits@vger.kernel.org \
    --cc=oliver@neukum.org \
    --cc=oneukum@suse.de \
    --cc=tilman@imap.cc \
    /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

all inboxes | Powered by JetHome®