ASoC: soc-ops: cleanup cppcheck warning at snd_soc_put_volsw_sx()
This patch cleanups below cppcheck warning. sound/soc/soc-ops.c:410:30: style: The scope of the variable 'val2' can be reduced. [variableScope] unsigned int val, val_mask, val2 = 0; ^ Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/874kc7w2a2.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
b189dde9d3
commit
58f42dfd79
@ -407,7 +407,7 @@ int snd_soc_put_volsw_sx(struct snd_kcontrol *kcontrol,
|
||||
int min = mc->min;
|
||||
unsigned int mask = (1U << (fls(min + max) - 1)) - 1;
|
||||
int err = 0;
|
||||
unsigned int val, val_mask, val2;
|
||||
unsigned int val, val_mask;
|
||||
|
||||
val_mask = mask << shift;
|
||||
val = (ucontrol->value.integer.value[0] + min) & mask;
|
||||
@ -418,6 +418,8 @@ int snd_soc_put_volsw_sx(struct snd_kcontrol *kcontrol,
|
||||
return err;
|
||||
|
||||
if (snd_soc_volsw_is_stereo(mc)) {
|
||||
unsigned int val2;
|
||||
|
||||
val_mask = mask << rshift;
|
||||
val2 = (ucontrol->value.integer.value[1] + min) & mask;
|
||||
val2 = val2 << rshift;
|
||||
|
Loading…
Reference in New Issue
Block a user