1
0
Fork 0

ALSA: hda: patch_realtek: fix empty macro usage in if block

[ Upstream commit 8a71821f12 ]

GCC reports the following warning with W=1

sound/pci/hda/patch_realtek.c: In function ‘alc269_suspend’:
sound/pci/hda/patch_realtek.c:3616:29: warning: suggest braces around
empty body in an ‘if’ statement [-Wempty-body]
 3616 |   alc5505_dsp_suspend(codec);
      |                             ^

sound/pci/hda/patch_realtek.c: In function ‘alc269_resume’:
sound/pci/hda/patch_realtek.c:3651:28: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
 3651 |   alc5505_dsp_resume(codec);
      |                            ^

This is a classic macro problem and can indeed lead to bad program
flows.

Fix by using the usual "do { } while (0)" pattern

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200111214736.3002-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
5.4-rM2-2.2.x-imx-squashed
Pierre-Louis Bossart 2020-01-11 15:47:35 -06:00 committed by Greg Kroah-Hartman
parent 749e58bd2b
commit 1efaaf7452
1 changed files with 2 additions and 2 deletions

View File

@ -3719,8 +3719,8 @@ static void alc5505_dsp_init(struct hda_codec *codec)
}
#ifdef HALT_REALTEK_ALC5505
#define alc5505_dsp_suspend(codec) /* NOP */
#define alc5505_dsp_resume(codec) /* NOP */
#define alc5505_dsp_suspend(codec) do { } while (0) /* NOP */
#define alc5505_dsp_resume(codec) do { } while (0) /* NOP */
#else
#define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec)
#define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec)