1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00

ASoC: soc-ops: cleanup cppcheck warning at snd_soc_put_xr_sx()

This patch cleanups below cppcheck warning.

sound/soc/soc-ops.c:859:18: style: The scope of the variable 'regval' can be reduced. [variableScope]
 unsigned int i, regval, regmask;
                 ^
sound/soc/soc-ops.c:859:26: style: The scope of the variable 'regmask' can be reduced. [variableScope]
 unsigned int i, regval, regmask;
                         ^
sound/soc/soc-ops.c:860:6: style: The scope of the variable 'err' can be reduced. [variableScope]
 int err;
     ^

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87zgtzunoz.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Kuninori Morimoto 2021-08-03 14:01:00 +09:00 committed by Mark Brown
parent b1ebecb90b
commit b285b51018
No known key found for this signature in database
GPG key ID: 24D68B725D5487D0

View file

@ -856,17 +856,16 @@ int snd_soc_put_xr_sx(struct snd_kcontrol *kcontrol,
unsigned long mask = (1UL<<mc->nbits)-1; unsigned long mask = (1UL<<mc->nbits)-1;
long max = mc->max; long max = mc->max;
long val = ucontrol->value.integer.value[0]; long val = ucontrol->value.integer.value[0];
unsigned int i, regval, regmask; unsigned int i;
int err;
if (invert) if (invert)
val = max - val; val = max - val;
val &= mask; val &= mask;
for (i = 0; i < regcount; i++) { for (i = 0; i < regcount; i++) {
regval = (val >> (regwshift*(regcount-i-1))) & regwmask; unsigned int regval = (val >> (regwshift*(regcount-i-1))) & regwmask;
regmask = (mask >> (regwshift*(regcount-i-1))) & regwmask; unsigned int regmask = (mask >> (regwshift*(regcount-i-1))) & regwmask;
err = snd_soc_component_update_bits(component, regbase+i, int err = snd_soc_component_update_bits(component, regbase+i,
regmask, regval); regmask, regval);
if (err < 0) if (err < 0)
return err; return err;
} }