Skip to contentSkip to conversation

ASoC: Fix typo in snd_soc_dapm_put_volsw

PATCH In review Stephen Warren 3 participants 5 messages Jan 27, 2011 – Jan 28, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: Fix typo in snd_soc_dapm_put_volsw

This fixes a regression introduced by:
97404f2e0386ac147cec00fc5d89ea475b04bd78
ASoC: Do DAPM control updates in the middle of DAPM sequences

---
 sound/soc/soc-dapm.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
sound/soc/soc-dapm.c +3 -3
index 0f94fd0..d0342aa 100644
@@ -1779,7 +1779,7 @@ int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol,
 	int max = mc->max;
 	unsigned int mask = (1 << fls(max)) - 1;
 	unsigned int invert = mc->invert;
-	unsigned int val, val_mask;
+	unsigned int val;
 	int connect, change;
 	struct snd_soc_dapm_update update;
 
@@ -1787,13 +1787,13 @@ int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol,
 
 	if (invert)
 		val = max - val;
-	val_mask = mask << shift;
+	mask = mask << shift;
 	val = val << shift;
 
 	mutex_lock(&widget->codec->mutex);
 	widget->value = val;
 
-	change = snd_soc_test_bits(widget->codec, reg, val_mask, val);
+	change = snd_soc_test_bits(widget->codec, reg, mask, val);
 	if (change) {
 		if (val)
 			/* new connection */
Signature · 1 line
1.7.1
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Stephen Warren

This fixes a regression introduced by:
97404f2e0386ac147cec00fc5d89ea475b04bd78
ASoC: Do DAPM control updates in the middle of DAPM sequences

---

Signature · 3 lines
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk
#2 lore raw
In reply to Stephen Warren
Quoted 3 lines · Stephen Warren

This fixes a regression introduced by:
97404f2e0386ac147cec00fc5d89ea475b04bd78
ASoC: Do DAPM control updates in the middle of DAPM sequences

This would be *much* easier to review if you'd mentioned what the issue you're fixing is... I think the changelog should be something along the lines of:

snd_soc_dapm_put_volsw() has variables for both the unshifted and shifted mask for updates commit 97404f (ASoC: Do DAPM control updates in the middle of DAPM sequences) got confused between the two of these. Since there's no need to keep a copy of the unshifted mask fix this and simplify the code by using only one mask variable.

#3 lore raw
Quoted 5 lines · Mark Brown

snd_soc_dapm_put_volsw() has variables for both the unshifted and shifted mask for updates commit 97404f (ASoC: Do DAPM control updates in the middle of DAPM sequences) got confused between the two of these. Since there's no need to keep a copy of the unshifted mask fix this and simplify the code by using only one mask variable.

Applied with the changelog rewritten to the above - good spot, thanks!

#4 lore raw

Mark Brown wrote at: Friday, January 28, 2011 6:21 AM:

Quoted 10 lines · Mark Brown
Quoted 6 lines

snd_soc_dapm_put_volsw() has variables for both the unshifted and shifted mask for updates commit 97404f (ASoC: Do DAPM control updates in the middle of DAPM sequences) got confused between the two of these. Since there's no need to keep a copy of the unshifted mask fix this and simplify the code by using only one mask variable.

Applied with the changelog rewritten to the above - good spot, thanks!

Yeah sorry, the original patch was:

- update.mask = mask;
+ update.mask = val_mask;

But once that was done, there was an unused variable which I ended up removing, but completely forgot that I should rewrite the commit description. I realized this last night and was going to correct it today.

Sorry.

Signature · 1 line
nvpublic