Re: [PATCH 05/10] ASoC: wm8958-dsp2: rename local 'control' arrays

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

 



On Wed, Mar 10, 2021 at 06:43:27PM -0600, Pierre-Louis Bossart wrote:
> cppcheck complains about shadowed variables:
> 
> sound/soc/codecs/wm8958-dsp2.c:926:27: style: Local variable 'control'
> shadows outer variable [shadowVariable]
> 
>   struct snd_kcontrol_new control[] = {
>                           ^
> sound/soc/codecs/wm8958-dsp2.c:900:17: note: Shadowed declaration
>  struct wm8994 *control = wm8994->wm8994;
>                 ^
> sound/soc/codecs/wm8958-dsp2.c:926:27: note: Shadow variable
>   struct snd_kcontrol_new control[] = {
>                           ^
> sound/soc/codecs/wm8958-dsp2.c:952:27: style: Local variable 'control'
> shadows outer variable [shadowVariable]
>   struct snd_kcontrol_new control[] = {
>                           ^
> sound/soc/codecs/wm8958-dsp2.c:900:17: note: Shadowed declaration
>  struct wm8994 *control = wm8994->wm8994;
>                 ^
> sound/soc/codecs/wm8958-dsp2.c:952:27: note: Shadow variable
>   struct snd_kcontrol_new control[] = {
>                           ^
> sound/soc/codecs/wm8958-dsp2.c:978:27: style: Local variable 'control'
> shadows outer variable [shadowVariable]
>   struct snd_kcontrol_new control[] = {
>                           ^
> sound/soc/codecs/wm8958-dsp2.c:900:17: note: Shadowed declaration
>  struct wm8994 *control = wm8994->wm8994;
>                 ^
> sound/soc/codecs/wm8958-dsp2.c:978:27: note: Shadow variable
>   struct snd_kcontrol_new control[] = {
>                           ^
> sound/soc/codecs/wm8958-dsp2.c:1006:27: style: Local variable
> 'control' shadows outer variable [shadowVariable]
>   struct snd_kcontrol_new control[] = {
>                           ^
> sound/soc/codecs/wm8958-dsp2.c:900:17: note: Shadowed declaration
>  struct wm8994 *control = wm8994->wm8994;
>                 ^
> sound/soc/codecs/wm8958-dsp2.c:1006:27: note: Shadow variable
>   struct snd_kcontrol_new control[] = {
>                           ^
> 
> fix by adding a prefix related to each control.
> 
> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@xxxxxxxxxxxxxxx>
> ---

Acked-by: Charles Keepax <ckeepax@xxxxxxxxxxxxxxxxxxxxx>

Thanks,
Charles



[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