[PATCH v2 6/6] ASoC: samsung: tm2_wm5510: remove shadowed variable

Krzysztof Kozlowski krzk at kernel.org
Tue Feb 23 19:29:15 CET 2021


On Tue, 23 Feb 2021 at 19:20, Pierre-Louis Bossart
<pierre-louis.bossart at linux.intel.com> wrote:
>
>
>
> On 2/23/21 5:25 AM, Sylwester Nawrocki wrote:
> > On 22.02.2021 22:33, Pierre-Louis Bossart wrote:
> >> Move the top-level variable to the lower scope where it's needed.
> >
> > Actually I like your original patch better as there is really no need
> > for multiple lower scope declarations in that fairly small function.
>
> I have no opinion, just let me know what the consensus is.

I proposed to have both variables local scope, to reduce the size of
function-scope variables. Their number tends to grow in probe() a lot,
so when a variable can be localized more, it makes the code easier to
understand. No need to figure out who/where/when uses the variable.
Local scope makes it much easier.

Best regards,
Krzysztof


More information about the Alsa-devel mailing list