diff options
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. | |||
168 | if (condition) | 168 | if (condition) |
169 | action(); | 169 | action(); |
170 | 170 | ||
171 | and | ||
172 | |||
173 | if (condition) | ||
174 | do_this(); | ||
175 | else | ||
176 | do_that(); | ||
177 | |||
171 | This does not apply if one branch of a conditional statement is a single | 178 | This does not apply if one branch of a conditional statement is a single |
172 | statement. Use braces in both branches. | 179 | statement. Use braces in both branches. |
173 | 180 | ||
@@ -659,7 +666,7 @@ There are a number of driver model diagnostic macros in <linux/device.h> | |||
659 | which you should use to make sure messages are matched to the right device | 666 | which you should use to make sure messages are matched to the right device |
660 | and driver, and are tagged with the right level: dev_err(), dev_warn(), | 667 | and driver, and are tagged with the right level: dev_err(), dev_warn(), |
661 | dev_info(), and so forth. For messages that aren't associated with a | 668 | dev_info(), and so forth. For messages that aren't associated with a |
662 | particular device, <linux/kernel.h> defines pr_debug() and pr_info(). | 669 | particular device, <linux/printk.h> defines pr_debug() and pr_info(). |
663 | 670 | ||
664 | Coming up with good debugging messages can be quite a challenge; and once | 671 | Coming up with good debugging messages can be quite a challenge; and once |
665 | you have them, they can be a huge help for remote troubleshooting. Such | 672 | 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/ | |||
819 | Kernel CodingStyle, by greg@kroah.com at OLS 2002: | 826 | Kernel CodingStyle, by greg@kroah.com at OLS 2002: |
820 | http://www.kroah.com/linux/talks/ols_2002_kernel_codingstyle_talk/html/ | 827 | http://www.kroah.com/linux/talks/ols_2002_kernel_codingstyle_talk/html/ |
821 | 828 | ||
822 | -- | ||
823 | Last updated on 2007-July-13. | ||
824 | |||