From: michi1@michaelblizek.twilightparadox.com (michi1 at michaelblizek.twilightparadox.com)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Submitted a first patch and no reply
Date: Fri, 9 Jan 2015 17:55:53 +0100 [thread overview]
Message-ID: <20150109165552.GA4687@grml> (raw)
In-Reply-To: <CAG77vrowzc04Z4_zZfCEwhF-kx=RnAnyXa0afsYL5dGsr2=Tng@mail.gmail.com>
Hi!
On 12:00 Thu 08 Jan , shirish gajera wrote:
> This patch fixes the checkpatch.pl warning:
>
> WARNING: Single statement macros should not use a do {} while (0) loop
>
> I have added single statement in curly braces, because it was giving
> me "WARNING: macros should not use a trailing semicolon".
...
> -#define R256(p0, p1, p2, p3, ROT, r_num) \
> -do { \
> - ROUND256(p0, p1, p2, p3, ROT, r_num); \
> -} while (0)
> +#define R256(p0, p1, p2, p3, ROT, r_num) \
> +{ \
> + ROUND256(p0, p1, p2, p3, ROT, r_num); \
> +}
This is wrong. Take a look at the reason of the do...while:
http://gcc.gnu.org/onlinedocs/cpp/Swallowing-the-Semicolon.html
You probably want to replace it with something like this:
#define R256(p0, p1, p2, p3, ROT, r_num) ROUND256(p0, p1, p2, p3, ROT, r_num)
or maybe even convert it to an inline function.
-Michi
--
programing a layer 3+4 network protocol for mesh networks
see http://michaelblizek.twilightparadox.com
prev parent reply other threads:[~2015-01-09 16:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-08 20:00 Submitted a first patch and no reply shirish gajera
2015-01-08 20:32 ` Valdis.Kletnieks at vt.edu
2015-01-08 20:37 ` shirish gajera
2015-01-08 20:49 ` Valdis.Kletnieks at vt.edu
2015-01-08 21:14 ` Joe Perches
2015-01-08 21:25 ` shirish gajera
2015-01-08 21:31 ` [PATCH] checkpatch: Allow comments in macros tested for single statements Joe Perches
2015-01-09 16:55 ` michi1 at michaelblizek.twilightparadox.com [this message]
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=20150109165552.GA4687@grml \
--to=michi1@michaelblizek.twilightparadox.com \
--cc=kernelnewbies@lists.kernelnewbies.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;
as well as URLs for NNTP newsgroup(s).