Commit 1dbba2cf authored by Gary R Hook's avatar Gary R Hook Committed by Jonathan Corbet

Documentation/CodingStyle: Add an example for braces

Add another example of required braces when using a compound statement in
a loop.
Signed-off-by: default avatarGary R Hook <gary.hook@amd.com>
Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
parent 5a5d1a77
......@@ -200,6 +200,15 @@ statement; in the latter case use braces in both branches:
otherwise();
}
Also, use braces when a loop contains more than a single simple statement:
.. code-block:: c
while (condition) {
if (test)
do_something();
}
3.1) Spaces
***********
......
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