Commit b218ab0a authored by Antonio Ospite's avatar Antonio Ospite Committed by Linus Torvalds

Documentation: update CodingStyle use of braces

After commit 38829dc9 ("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: default avatarAntonio Ospite <ospite@studenti.unina.it>
Signed-off-by: default avatarRandy Dunlap <rdunlap@xenotime.net>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent d83fe6b6
...@@ -166,8 +166,8 @@ if (condition) ...@@ -166,8 +166,8 @@ if (condition)
else else
do_that(); do_that();
This does not apply if one branch of a conditional statement is a single This does not apply if only one branch of a conditional statement is a single
statement. Use braces in both branches. statement; in the latter case use braces in both branches:
if (condition) { if (condition) {
do_this(); do_this();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment