diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2021-08-03 14:00:37 +0900 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2021-08-03 18:27:11 +0100 |
commit | 58f42dfd7977599b060996491412fcec688d025d (patch) | |
tree | 408fc699942f1828b6a5d2a229ae7eb20a891a90 /sound/soc/soc-ops.c | |
parent | b189dde9d3e54b607791e9cdf28c7881eac8a37e (diff) |
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>
Diffstat (limited to 'sound/soc/soc-ops.c')
-rw-r--r-- | sound/soc/soc-ops.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sound/soc/soc-ops.c b/sound/soc/soc-ops.c index 58527247df83..9742e3c345b6 100644 --- a/sound/soc/soc-ops.c +++ b/sound/soc/soc-ops.c @@ -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; |