lkml.org 
[lkml]   [2007]   [Apr]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: + 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/

\
 
 \ /
  Last update: 2007-04-25 17:15    [W:0.055 / U:0.388 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site