Commit 58fee775 authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Mark Brown

ASoC: dapm: Remove unnecessary loop

The condition 'i == item' is only true when, well, 'i' equals 'item'.
So just use 'item' directly as the index into the array.
Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 6b75bf0c
...@@ -363,11 +363,10 @@ static void dapm_set_path_status(struct snd_soc_dapm_widget *w, ...@@ -363,11 +363,10 @@ static void dapm_set_path_status(struct snd_soc_dapm_widget *w,
val = soc_widget_read(w, e->reg); val = soc_widget_read(w, e->reg);
item = (val >> e->shift_l) & e->mask; item = (val >> e->shift_l) & e->mask;
p->connect = 0; if (item < e->max && !strcmp(p->name, e->texts[item]))
for (i = 0; i < e->max; i++) { p->connect = 1;
if (!(strcmp(p->name, e->texts[i])) && item == i) else
p->connect = 1; p->connect = 0;
}
} }
break; break;
case snd_soc_dapm_virt_mux: { case snd_soc_dapm_virt_mux: {
...@@ -397,11 +396,10 @@ static void dapm_set_path_status(struct snd_soc_dapm_widget *w, ...@@ -397,11 +396,10 @@ static void dapm_set_path_status(struct snd_soc_dapm_widget *w,
break; break;
} }
p->connect = 0; if (item < e->max && !strcmp(p->name, e->texts[item]))
for (i = 0; i < e->max; i++) { p->connect = 1;
if (!(strcmp(p->name, e->texts[i])) && item == i) else
p->connect = 1; p->connect = 0;
}
} }
break; break;
/* does not affect routing - always connected */ /* does not affect routing - always connected */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment