summaryrefslogtreecommitdiff
path: root/sound/soc/soc-dapm.c
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2021-08-05 04:11:00 +0300
committerMark Brown <broonie@kernel.org>2021-08-05 17:37:29 +0300
commitaf6b57ab7fdd88e1b251376ee92fd335abd2241e (patch)
treee357f74b40e9131dc193ceba95e1deb09b3f0c04 /sound/soc/soc-dapm.c
parent7453d6d45d5587d3d4d4fdaec746db74ac5f7429 (diff)
downloadlinux-af6b57ab7fdd88e1b251376ee92fd335abd2241e.tar.xz
ASoC: soc-dapm: cleanup cppcheck warning at dapm_connect_mux()
This patch cleanups below cppcheck warning. sound/soc/soc-dapm.c:751:15: style: The scope of the variable 'val' can be reduced. [variableScope] unsigned int val, item; ^ Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87wnp0u257.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r--sound/soc/soc-dapm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 92193e9e1084..1c0457715008 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -747,10 +747,11 @@ static int dapm_connect_mux(struct snd_soc_dapm_context *dapm,
{
const struct snd_kcontrol_new *kcontrol = &w->kcontrol_news[0];
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
- unsigned int val, item;
+ unsigned int item;
int i;
if (e->reg != SND_SOC_NOPM) {
+ unsigned int val;
val = soc_dapm_read(dapm, e->reg);
val = (val >> e->shift_l) & e->mask;
item = snd_soc_enum_val_to_item(e, val);