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

Charles Keepax ckeepax at opensource.cirrus.com
Thu Mar 11 10:29:38 CET 2021


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 at linux.intel.com>
> ---

Acked-by: Charles Keepax <ckeepax at opensource.cirrus.com>

Thanks,
Charles


More information about the Alsa-devel mailing list