Commit e659ba4a authored by Oliver Neukum's avatar Oliver Neukum Committed by Linus Torvalds

CodingStyle: start flamewar about use of braces

Signed-off-by: default avatarOliver Neukum <oneukum@suse.de>
Cc: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 28be5abb
...@@ -160,6 +160,21 @@ supply of new-lines on your screen is not a renewable resource (think ...@@ -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 25-line terminal screens here), you have more empty lines to put
comments on. 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 3.1: Spaces
Linux kernel style for use of spaces depends (mostly) on Linux kernel style for use of spaces depends (mostly) on
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment