[PATCH 4/8] ASoC: sh: rcar: core: rename shadowing variables

Pierre-Louis Bossart pierre-louis.bossart at linux.intel.com
Mon Feb 22 16:41:11 CET 2021



On 2/21/21 5:27 PM, Kuninori Morimoto wrote:
> 
> Hi Pierre-Louis
> 
>> sound/soc/sh/rcar/core.c:1369:22: style: Local variable 'rdai' shadows
>> outer variable [shadowVariable]
>>      struct rsnd_dai *rdai = rsnd_rdai_get(priv, dai_i);
>>                       ^
> 
> I'm not 100% sure about this warning,
> but this path is overkill. Maybe below is enough ?

Hi Morimoto-san,
It might be better if we drop this patch from the series and have you 
send the proper fix with my Reported-by tag.
Would that work for you?
Thanks!

> ---------
> diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
> index 8533aa696183..cae9639c0ef9 100644
> --- a/sound/soc/sh/rcar/core.c
> +++ b/sound/soc/sh/rcar/core.c
> @@ -1382,7 +1382,7 @@ static int rsnd_dai_probe(struct rsnd_priv *priv)
>   		for_each_endpoint_of_node(dai_node, dai_np) {
>   			__rsnd_dai_probe(priv, dai_np, dai_i);
>   			if (rsnd_is_gen3(priv)) {
> -				struct rsnd_dai *rdai = rsnd_rdai_get(priv, dai_i);
> +				rdai = rsnd_rdai_get(priv, dai_i);
>   
>   				rsnd_parse_connect_graph(priv, &rdai->playback, dai_np);
>   				rsnd_parse_connect_graph(priv, &rdai->capture,  dai_np);
> @@ -1393,7 +1393,7 @@ static int rsnd_dai_probe(struct rsnd_priv *priv)
>   		for_each_child_of_node(dai_node, dai_np) {
>   			__rsnd_dai_probe(priv, dai_np, dai_i);
>   			if (rsnd_is_gen3(priv)) {
> -				struct rsnd_dai *rdai = rsnd_rdai_get(priv, dai_i);
> +				rdai = rsnd_rdai_get(priv, dai_i);
>   
>   				rsnd_parse_connect_simple(priv, &rdai->playback, dai_np);
>   				rsnd_parse_connect_simple(priv, &rdai->capture,  dai_np);
> ----
> 
> Thank you for your help !!
> 
> Best regards
> ---
> Kuninori Morimoto
> 


More information about the Alsa-devel mailing list