From: Alfonso Lima <alfonsolimaastor@gmail.com>
To: apw@canonical.com, joe@perches.com
Cc: linux-kernel@vger.kernel.org
Subject: [bug report] checkpatch: if statement does not need to be enclosed in parentheses
Date: Sat, 8 Apr 2017 17:07:17 +0100 [thread overview]
Message-ID: <20170408160717.GA7337@alima-W65-67SF> (raw)
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
next reply other threads:[~2017-04-08 16:07 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-08 16:07 Alfonso Lima [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170408160717.GA7337@alima-W65-67SF \
--to=alfonsolimaastor@gmail.com \
--cc=apw@canonical.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®