ALSA: hda: patch_realtek: fix empty macro usage in if block
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Sat, 11 Jan 2020 21:47:35 +0000 (15:47 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 May 2020 15:46:37 +0000 (17:46 +0200)
commit1efaaf74528cebe261da423a22af6f3f3ebe8109
tree99c0a3211046f92bb8905c84ff30dc8b199e004a
parent749e58bd2b09a0f04c6bbbe312b95dcbe4049f38
ALSA: hda: patch_realtek: fix empty macro usage in if block

[ Upstream commit 8a71821f12a010d7100f9cc1f7b218aff0313c4a ]

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>
sound/pci/hda/patch_realtek.c