aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/CodingStyle
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/CodingStyle')
-rw-r--r--Documentation/CodingStyle12
1 files changed, 8 insertions, 4 deletions
diff --git a/Documentation/CodingStyle b/Documentation/CodingStyle
index 8bb37237ebd2..58b0bf917834 100644
--- a/Documentation/CodingStyle
+++ b/Documentation/CodingStyle
@@ -168,6 +168,13 @@ Do not unnecessarily use braces where a single statement will do.
168if (condition) 168if (condition)
169 action(); 169 action();
170 170
171and
172
173if (condition)
174 do_this();
175else
176 do_that();
177
171This does not apply if one branch of a conditional statement is a single 178This does not apply if one branch of a conditional statement is a single
172statement. Use braces in both branches. 179statement. Use braces in both branches.
173 180
@@ -659,7 +666,7 @@ There are a number of driver model diagnostic macros in <linux/device.h>
659which you should use to make sure messages are matched to the right device 666which you should use to make sure messages are matched to the right device
660and driver, and are tagged with the right level: dev_err(), dev_warn(), 667and driver, and are tagged with the right level: dev_err(), dev_warn(),
661dev_info(), and so forth. For messages that aren't associated with a 668dev_info(), and so forth. For messages that aren't associated with a
662particular device, <linux/kernel.h> defines pr_debug() and pr_info(). 669particular device, <linux/printk.h> defines pr_debug() and pr_info().
663 670
664Coming up with good debugging messages can be quite a challenge; and once 671Coming up with good debugging messages can be quite a challenge; and once
665you have them, they can be a huge help for remote troubleshooting. Such 672you have them, they can be a huge help for remote troubleshooting. Such
@@ -819,6 +826,3 @@ language C, URL: http://www.open-std.org/JTC1/SC22/WG14/
819Kernel CodingStyle, by greg@kroah.com at OLS 2002: 826Kernel CodingStyle, by greg@kroah.com at OLS 2002:
820http://www.kroah.com/linux/talks/ols_2002_kernel_codingstyle_talk/html/ 827http://www.kroah.com/linux/talks/ols_2002_kernel_codingstyle_talk/html/
821 828
822--
823Last updated on 2007-July-13.
824