diff options
| author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-05-24 00:06:26 -0700 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-05-24 00:06:26 -0700 |
| commit | b73077eb03f510a84b102fb97640e595a958403c (patch) | |
| tree | 8b639000418e2756bf6baece4e00e07d2534bccc /Documentation/CodingStyle | |
| parent | 28350e330cfab46b60a1dbf763b678d859f9f3d9 (diff) | |
| parent | 9d2e173644bb5c42ff1b280fbdda3f195a7cf1f7 (diff) | |
Merge branch 'next' into for-linus
Diffstat (limited to 'Documentation/CodingStyle')
| -rw-r--r-- | Documentation/CodingStyle | 12 |
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. if (condition) action(); +and + +if (condition) + do_this(); +else + do_that(); + This does not apply if one branch of a conditional statement is a single statement. Use braces in both branches. @@ -659,7 +666,7 @@ There are a number of driver model diagnostic macros in <linux/device.h> which you should use to make sure messages are matched to the right device and driver, and are tagged with the right level: dev_err(), dev_warn(), dev_info(), and so forth. For messages that aren't associated with a -particular device, <linux/kernel.h> defines pr_debug() and pr_info(). +particular device, <linux/printk.h> defines pr_debug() and pr_info(). Coming up with good debugging messages can be quite a challenge; and once you 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/ Kernel CodingStyle, by greg@kroah.com at OLS 2002: http://www.kroah.com/linux/talks/ols_2002_kernel_codingstyle_talk/html/ --- -Last updated on 2007-July-13. - |
