Skip to content

Commit b218ab0

Browse files
Antonio Ospitetorvalds
authored andcommitted
Documentation: update CodingStyle use of braces
After commit 38829dc ("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>
1 parent d83fe6b commit b218ab0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎Documentation/CodingStyle‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ if (condition)
166166
else
167167
do_that();
168168

169-
This does not apply if one branch of a conditional statement is a single
170-
statement. Use braces in both branches.
169+
This does not apply if only one branch of a conditional statement is a single
170+
statement; in the latter case use braces in both branches:
171171

172172
if (condition) {
173173
do_this();

0 commit comments

Comments
 (0)