Thread (6 messages) 6 messages, 3 authors, 2018-03-26

Re: [PATCH v2] Documentation/CodingStyle: Add an example for braces

From: Jonathan Corbet <corbet@lwn.net>
Date: 2018-03-21 15:17:06
Also in: lkml

On Thu, 15 Mar 2018 15:04:02 -0500
Gary R Hook [off-list ref] wrote:
+Do use braces when a body is more complex than a single simple statement:
+
+.. code-block:: c
+
+	if (condition) {
+		if (another_condition)
+			do_something();
+	}
Somebody is sure to complain at some point that this should really be:

	if (condition && another_condition)
		do_something();

To head that off, I think I'll apply your first version instead, sorry
Jani.

In general I'm pretty reluctant to apply coding-style patches for the
simple reason that I sure don't want to be the arbitrator of proper kernel
style.  This one seems to fit well within the accepted norms, though.

Thanks,

jon
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help