Submitted a first patch and no reply

michi1 at michaelblizek.twilightparadox.com michi1 at michaelblizek.twilightparadox.com
Fri Jan 9 11:55:53 EST 2015


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



More information about the Kernelnewbies mailing list