Skip to content

Commit

Permalink
ALSA: pcm: use "do {} while (0)" for empty macro
Browse files Browse the repository at this point in the history
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: 58f30d6 ("ALSA: pcm: Build pcm notifier code conditionally")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
arndb authored and tiwai committed May 18, 2017
1 parent b46fe5d commit 9aee03f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/core/pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9aee03f

Please sign in to comment.