All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: Fix typo in snd_soc_dapm_put_volsw
@ 2011-01-27 21:54 Stephen Warren
  2011-01-28 13:04 ` Liam Girdwood
  2011-01-28 13:12 ` Mark Brown
  0 siblings, 2 replies; 5+ messages in thread
From: Stephen Warren @ 2011-01-27 21:54 UTC (permalink / raw)
  To: broonie, lrg; +Cc: alsa-devel, Stephen Warren

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

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
 sound/soc/soc-dapm.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 0f94fd0..d0342aa 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -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 */
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] ASoC: Fix typo in snd_soc_dapm_put_volsw
  2011-01-27 21:54 [PATCH] ASoC: Fix typo in snd_soc_dapm_put_volsw Stephen Warren
@ 2011-01-28 13:04 ` Liam Girdwood
  2011-01-28 13:12 ` Mark Brown
  1 sibling, 0 replies; 5+ messages in thread
From: Liam Girdwood @ 2011-01-28 13:04 UTC (permalink / raw)
  To: Stephen Warren; +Cc: alsa-devel, broonie

On Thu, 2011-01-27 at 14:54 -0700, Stephen Warren wrote:
> This fixes a regression introduced by:
> 97404f2e0386ac147cec00fc5d89ea475b04bd78
> ASoC: Do DAPM control updates in the middle of DAPM sequences
> 
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> ---

Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
-- 
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ASoC: Fix typo in snd_soc_dapm_put_volsw
  2011-01-27 21:54 [PATCH] ASoC: Fix typo in snd_soc_dapm_put_volsw Stephen Warren
  2011-01-28 13:04 ` Liam Girdwood
@ 2011-01-28 13:12 ` Mark Brown
  2011-01-28 13:21   ` Mark Brown
  1 sibling, 1 reply; 5+ messages in thread
From: Mark Brown @ 2011-01-28 13:12 UTC (permalink / raw)
  To: Stephen Warren; +Cc: alsa-devel, lrg

On Thu, Jan 27, 2011 at 02:54:05PM -0700, Stephen Warren wrote:
> 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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ASoC: Fix typo in snd_soc_dapm_put_volsw
  2011-01-28 13:12 ` Mark Brown
@ 2011-01-28 13:21   ` Mark Brown
  2011-01-28 16:16     ` Stephen Warren
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2011-01-28 13:21 UTC (permalink / raw)
  To: Stephen Warren; +Cc: alsa-devel, lrg

On Fri, Jan 28, 2011 at 01:12:43PM +0000, Mark Brown wrote:

> 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!

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ASoC: Fix typo in snd_soc_dapm_put_volsw
  2011-01-28 13:21   ` Mark Brown
@ 2011-01-28 16:16     ` Stephen Warren
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Warren @ 2011-01-28 16:16 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel, lrg

Mark Brown wrote at: Friday, January 28, 2011 6:21 AM:
> 
> On Fri, Jan 28, 2011 at 01:12:43PM +0000, Mark Brown wrote:
> 
> > 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.

-- 
nvpublic

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-01-28 16:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-27 21:54 [PATCH] ASoC: Fix typo in snd_soc_dapm_put_volsw Stephen Warren
2011-01-28 13:04 ` Liam Girdwood
2011-01-28 13:12 ` Mark Brown
2011-01-28 13:21   ` Mark Brown
2011-01-28 16:16     ` Stephen Warren

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.