Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1733520

Re: [PATCH] printk: simplify no_printk()

From Joe Perches <joe@perches.com>
Newsgroups linux.kernel
Subject Re: [PATCH] printk: simplify no_printk()
Date 2017-09-17 20:40 +0200
Message-ID <uqME1-39T-3@gated-at.bofh.it> (permalink)
References <uqJmN-19W-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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;						\
>  })

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] printk: simplify no_printk() Masahiro Yamada <yamada.masahiro@socionext.com> - 2017-09-17 17:10 +0200
  Re: [PATCH] printk: simplify no_printk() Joe Perches <joe@perches.com> - 2017-09-17 20:40 +0200
  Re: [PATCH] printk: simplify no_printk() Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2017-09-26 08:50 +0200

csiph-web