dect
/
linux-2.6
Archived
13
0
Fork 0

CodingStyle: start flamewar about use of braces

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>
This commit is contained in:
Oliver Neukum 2007-05-08 00:30:34 -07:00 committed by Linus Torvalds
parent 28be5abb40
commit e659ba4a0d
1 changed files with 15 additions and 0 deletions

View File

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