Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -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
***********