public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [bug report] checkpatch: if statement does not need to be enclosed in parentheses
@ 2017-04-08 16:07 Alfonso Lima
  2017-04-08 17:33 ` Joe Perches
  0 siblings, 1 reply; 8+ messages in thread
From: Alfonso Lima @ 2017-04-08 16:07 UTC (permalink / raw)
  To: apw, joe; +Cc: linux-kernel

Hi,

In current linux-next, if you run the script on this piece of
code:

#define FOO(a)				\
	if (a) {			\
		something();		\
		something_else();	\
	}

You should get:

ERROR: Macros with complex values should be enclosed in parentheses
#1: FILE: foo.c:1:
+#define FOO(a)				\
+	if (a) {			\
+		something();		\
+		something_else();	\
+	}

We could silence checkpatch.pl using "do {} while ()" around the
if statement. However, the "if () {}" statement should be
enough. If someone could confirm this, I'll go and fix it.

Thanks,
Alfonso

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-04-10  0:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-08 16:07 [bug report] checkpatch: if statement does not need to be enclosed in parentheses Alfonso Lima
2017-04-08 17:33 ` Joe Perches
2017-04-09  8:55   ` Andreas Mohr
2017-04-09 17:45     ` [PATCH 1/2] checkpatch: Clarify the EMBEDDED_FUNCTION_NAME message Joe Perches
2017-04-09 17:45       ` [PATCH 2/2] checkpatch: Improve MULTISTATEMENT_MACRO_USE_DO_WHILE test Joe Perches
2017-04-09 17:46         ` Joe Perches
2017-04-09 17:59         ` [PATCH V2] " Joe Perches
2017-04-10  0:28           ` [PATCH V3] " Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox