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]>
diff --git a/Documentation/CodingStyle b/Documentation/CodingStyle index 9069189..e7f5fc6 100644 --- a/Documentation/CodingStyle +++ b/Documentation/CodingStyle
@@ -160,6 +160,21 @@ 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