Unverified Commit 29155bba authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown
Browse files

ASoC: soc-dapm: cleanup cppcheck warning at dapm_set_mixer_path_status()



This patch cleanups below cppcheck warning, and its related code.

 unsigned int val;
              ^

sound/soc/soc-dapm.c:789:15: style: The scope of the variable 'val' can be reduced. [variableScope]
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87v94ku252.wl-kuninori.morimoto.gx@renesas.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent af6b57ab
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -782,14 +782,14 @@ static void dapm_set_mixer_path_status(struct snd_soc_dapm_path *p, int i,
	struct soc_mixer_control *mc = (struct soc_mixer_control *)
		p->sink->kcontrol_news[i].private_value;
	unsigned int reg = mc->reg;
	unsigned int invert = mc->invert;

	if (reg != SND_SOC_NOPM) {
		unsigned int shift = mc->shift;
		unsigned int max = mc->max;
		unsigned int mask = (1 << fls(max)) - 1;
	unsigned int invert = mc->invert;
	unsigned int val;
		unsigned int val = soc_dapm_read(p->sink->dapm, reg);

	if (reg != SND_SOC_NOPM) {
		val = soc_dapm_read(p->sink->dapm, reg);
		/*
		 * The nth_path argument allows this function to know
		 * which path of a kcontrol it is setting the initial