Skip to content

Commit

Permalink
CodingStyle: start flamewar about use of braces
Browse files Browse the repository at this point in the history
Signed-off-by: Oliver Neukum <oneukum@suse.de>
Cc: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Oliver Neukum authored and Linus Torvalds committed May 8, 2007
1 parent 28be5ab commit e659ba4
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Documentation/CodingStyle
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,21 @@ supply of new-lines on your screen is not a renewable resource (think
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
Expand Down

0 comments on commit e659ba4

Please sign in to comment.