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


Groups > linux.kernel > #1439877

Re: [tip:x86/debug] printk: Make the printk*once() variants return a value

From Joe Perches <joe@perches.com>
Newsgroups linux.kernel
Subject Re: [tip:x86/debug] printk: Make the printk*once() variants return a value
Date 2016-07-09 04:50 +0200
Message-ID <rSQv7-5aV-3@gated-at.bofh.it> (permalink)
References <rRkGZ-2Z3-3@gated-at.bofh.it> <rSCLw-4Br-57@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, 2016-07-08 at 05:08 -0700, tip-bot for Borislav Petkov wrote:
> printk: Make the printk*once() variants return a value
[]
> diff --git a/include/linux/printk.h b/include/linux/printk.h
[]
> @@ -108,11 +108,14 @@ struct va_format {
>   * Dummy printk for disabled debugging statements to use whilst maintaining
>   * gcc's format checking.
>   */
> -#define no_printk(fmt, ...)			\
> -do {						\
> -	if (0)					\
> -		printk(fmt, ##__VA_ARGS__);	\
> -} while (0)
> +#define no_printk(fmt, ...)				\
> +({							\
> +	do {						\
> +		if (0)					\
> +			printk(fmt, ##__VA_ARGS__);	\
> +	} while (0);					\
> +	0;						\
> +})

This change isn't described in the commit message and there
doesn't seem to be a need to change this.

And as statement expressions these no longer need
"do { <foo> } while (0)" this could have been be simplified to

#define no_printk(fmt, ...)
({
	if (0)
		printk(fmt, ##__VA_ARGS__);
})

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


Thread

[PATCH -v2 2/3] printk: Make the printk*once() variants return a value Borislav Petkov <bp@alien8.de> - 2016-07-05 00:40 +0200
  [tip:x86/debug] printk: Make the printk*once() variants return a  value tip-bot for Borislav Petkov <tipbot@zytor.com> - 2016-07-08 14:10 +0200
    Re: [tip:x86/debug] printk: Make the printk*once() variants return  a value Joe Perches <joe@perches.com> - 2016-07-09 04:50 +0200
      Re: [tip:x86/debug] printk: Make the printk*once() variants return a  value Borislav Petkov <bp@alien8.de> - 2016-07-09 10:00 +0200
        Re: [tip:x86/debug] printk: Make the printk*once() variants return  a value Joe Perches <joe@perches.com> - 2016-07-09 20:00 +0200
          Re: [tip:x86/debug] printk: Make the printk*once() variants return a  value Borislav Petkov <bp@alien8.de> - 2016-07-10 09:00 +0200
            Re: [tip:x86/debug] printk: Make the printk*once() variants return  a value Joe Perches <joe@perches.com> - 2016-07-10 10:30 +0200
              Re: [tip:x86/debug] printk: Make the printk*once() variants return a  value Borislav Petkov <bp@alien8.de> - 2016-07-10 14:10 +0200
                Re: [tip:x86/debug] printk: Make the printk*once() variants return  a value Joe Perches <joe@perches.com> - 2016-07-10 14:40 +0200

csiph-web