Re: [PATCH] printk: simplify no_printk()
From: Joe Perches
Date: Sun Sep 17 2017 - 14:32:44 EST
On Mon, 2017-09-18 at 00:01 +0900, Masahiro Yamada wrote:
> Commit 069f0cd00df0 ("printk: Make the printk*once() variants return
> a value") surrounded the macro implementation with ({ ... }).
>
> Now, the inner do { ... } while (0); is redundant.
thanks.
> diff --git a/include/linux/printk.h b/include/linux/printk.h
[]
> @@ -131,10 +131,8 @@ struct va_format {
> */
> #define no_printk(fmt, ...) \
> ({ \
> - do { \
> - if (0) \
> - printk(fmt, ##__VA_ARGS__); \
> - } while (0); \
> + if (0) \
> + printk(fmt, ##__VA_ARGS__); \
> 0; \
> })