diff options
author | Antonio Ospite <ospite@studenti.unina.it> | 2011-11-04 14:22:19 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-04 15:01:47 -0400 |
commit | b218ab0a5af943441e1daa7dc811874ecd409229 (patch) | |
tree | 32140ce0a2a8ec1882326b2e43a3153f00378a19 /Documentation/CodingStyle | |
parent | d83fe6b6c54749a9b2d3198d62ec981024459425 (diff) |
Documentation: update CodingStyle use of braces
After commit 38829dc9d7b4 ("Documentation/CodingStyle: flesh out if-else
examples") highlight that if _only_one_ branch of a conditional
statement is a single statement, then braces are to be used on both
branches.
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation/CodingStyle')
-rw-r--r-- | Documentation/CodingStyle | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Documentation/CodingStyle b/Documentation/CodingStyle index c940239d9678..2b90d328b3ba 100644 --- a/Documentation/CodingStyle +++ b/Documentation/CodingStyle | |||
@@ -166,8 +166,8 @@ if (condition) | |||
166 | else | 166 | else |
167 | do_that(); | 167 | do_that(); |
168 | 168 | ||
169 | This does not apply if one branch of a conditional statement is a single | 169 | This does not apply if only one branch of a conditional statement is a single |
170 | statement. Use braces in both branches. | 170 | statement; in the latter case use braces in both branches: |
171 | 171 | ||
172 | if (condition) { | 172 | if (condition) { |
173 | do_this(); | 173 | do_this(); |