Commit:     e659ba4a0d2d471c0d73590f78e1a1b5a1eede48
Parent:     28be5abb400e5e082f5225105fdc69337ec0c0b4
Author:     Oliver Neukum <[EMAIL PROTECTED]>
AuthorDate: Tue May 8 00:30:34 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue May 8 11:15:12 2007 -0700

    CodingStyle: start flamewar about use of braces
    Signed-off-by: Oliver Neukum <[EMAIL PROTECTED]>
    Cc: Tilman Schmidt <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
 Documentation/CodingStyle |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/Documentation/CodingStyle b/Documentation/CodingStyle
index 9069189..e7f5fc6 100644
--- a/Documentation/CodingStyle
+++ b/Documentation/CodingStyle
@@ -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
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to