mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: "Arnd Bergmann" <arnd@arndb.de>
Cc: <alsa-devel@alsa-project.org>, "Jaroslav Kysela" <perex@perex.cz>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] ALSA: pcm: use "do {} while (0)" for empty macro
Date: Thu, 18 May 2017 16:39:33 +0200	[thread overview]
Message-ID: <s5hvaoy8c0q.wl-tiwai@suse.de> (raw)
In-Reply-To: <20170518133610.1914235-1-arnd@arndb.de>

On Thu, 18 May 2017 15:35:54 +0200,
Arnd Bergmann wrote:
> 
> Recent compilers produce a harmless warning for the new pcm_call_notify()
> macro when CONFIG_SND_PCM_OSS is disabled:
> 
> sound/core/pcm.c: In function 'snd_pcm_free':
> sound/core/pcm.c:905:37: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
> 
> This turns the empty macro into a 'do {} while (0)' statement to avoid
> the warning.
> 
> Fixes: 58f30d650c7f ("ALSA: pcm: Build pcm notifier code conditionally")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Thanks, applied both patches now.


Takashi

> ---
>  sound/core/pcm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sound/core/pcm.c b/sound/core/pcm.c
> index 24acbfb5c531..d30dba0ee688 100644
> --- a/sound/core/pcm.c
> +++ b/sound/core/pcm.c
> @@ -894,7 +894,7 @@ static void snd_pcm_free_stream(struct snd_pcm_str * pstr)
>  			_notify->call(pcm);				\
>  	} while (0)
>  #else
> -#define pcm_call_notify(pcm, call) /* NOP */
> +#define pcm_call_notify(pcm, call) do {} while (0)
>  #endif
>  
>  static int snd_pcm_free(struct snd_pcm *pcm)
> -- 
> 2.9.0
> 
> 

      parent reply	other threads:[~2017-05-18 14:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-18 13:35 Arnd Bergmann
2017-05-18 13:35 ` [PATCH 2/2] ALSA: pcm/oss: mark snd_pcm_plug_slave_format arg as const Arnd Bergmann
2017-05-18 14:08   ` Takashi Sakamoto
2017-05-18 14:39 ` Takashi Iwai [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=s5hvaoy8c0q.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    /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

all inboxes | Powered by JetHome®