Re: [PATCH 1/2] ALSA: HDA: patch_realtek: fix empty macro usage in if block

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 11 Jan 2020 22:47:35 +0100,
Pierre-Louis Bossart wrote:
> 
> 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@xxxxxxxxxxxxxxx>

Thanks, applied now.


Takashi
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel




[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux