Skip to content

Commit

Permalink
ASoC: wm2000: a couple harmless underflows
Browse files Browse the repository at this point in the history
We want these to be zero or one, but by mistake we also accept negative
values.  It's harmless but we should still clean it up.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Dan Carpenter authored and Mark Brown committed Oct 22, 2015
1 parent 6ff33f3 commit 8444f59
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sound/soc/codecs/wm2000.c
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ static int wm2000_anc_mode_put(struct snd_kcontrol *kcontrol,
{
struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev);
int anc_active = ucontrol->value.integer.value[0];
unsigned int anc_active = ucontrol->value.integer.value[0];
int ret;

if (anc_active > 1)
Expand Down Expand Up @@ -653,7 +653,7 @@ static int wm2000_speaker_put(struct snd_kcontrol *kcontrol,
{
struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev);
int val = ucontrol->value.integer.value[0];
unsigned int val = ucontrol->value.integer.value[0];
int ret;

if (val > 1)
Expand Down

0 comments on commit 8444f59

Please sign in to comment.