Commit bb26e0c6 authored by Hariprasad Kelam's avatar Hariprasad Kelam Committed by Takashi Iwai

ALSA: asihpi: Remove unneeded variable change

this patch fixes below issue reported by coccicheck
sound/pci/asihpi/asihpi.c:1558:5-11: Unneeded variable: "change". Return
"1" on line 1564
Signed-off-by: default avatarHariprasad Kelam <hariprasad.kelam@gmail.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent ca95c7bf
...@@ -1532,7 +1532,6 @@ static int snd_asihpi_volume_get(struct snd_kcontrol *kcontrol, ...@@ -1532,7 +1532,6 @@ static int snd_asihpi_volume_get(struct snd_kcontrol *kcontrol,
static int snd_asihpi_volume_put(struct snd_kcontrol *kcontrol, static int snd_asihpi_volume_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) struct snd_ctl_elem_value *ucontrol)
{ {
int change;
u32 h_control = kcontrol->private_value; u32 h_control = kcontrol->private_value;
short an_gain_mB[HPI_MAX_CHANNELS]; short an_gain_mB[HPI_MAX_CHANNELS];
...@@ -1543,9 +1542,8 @@ static int snd_asihpi_volume_put(struct snd_kcontrol *kcontrol, ...@@ -1543,9 +1542,8 @@ static int snd_asihpi_volume_put(struct snd_kcontrol *kcontrol,
/* change = asihpi->mixer_volume[addr][0] != left || /* change = asihpi->mixer_volume[addr][0] != left ||
asihpi->mixer_volume[addr][1] != right; asihpi->mixer_volume[addr][1] != right;
*/ */
change = 1;
hpi_handle_error(hpi_volume_set_gain(h_control, an_gain_mB)); hpi_handle_error(hpi_volume_set_gain(h_control, an_gain_mB));
return change; return 1;
} }
static const DECLARE_TLV_DB_SCALE(db_scale_100, -10000, VOL_STEP_mB, 0); static const DECLARE_TLV_DB_SCALE(db_scale_100, -10000, VOL_STEP_mB, 0);
...@@ -1568,13 +1566,12 @@ static int snd_asihpi_volume_mute_put(struct snd_kcontrol *kcontrol, ...@@ -1568,13 +1566,12 @@ static int snd_asihpi_volume_mute_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) struct snd_ctl_elem_value *ucontrol)
{ {
u32 h_control = kcontrol->private_value; u32 h_control = kcontrol->private_value;
int change = 1;
/* HPI currently only supports all or none muting of multichannel volume /* HPI currently only supports all or none muting of multichannel volume
ALSA Switch element has opposite sense to HPI mute: on==unmuted, off=muted ALSA Switch element has opposite sense to HPI mute: on==unmuted, off=muted
*/ */
int mute = ucontrol->value.integer.value[0] ? 0 : HPI_BITMASK_ALL_CHANNELS; int mute = ucontrol->value.integer.value[0] ? 0 : HPI_BITMASK_ALL_CHANNELS;
hpi_handle_error(hpi_volume_set_mute(h_control, mute)); hpi_handle_error(hpi_volume_set_mute(h_control, mute));
return change; return 1;
} }
static int snd_asihpi_volume_add(struct snd_card_asihpi *asihpi, static int snd_asihpi_volume_add(struct snd_card_asihpi *asihpi,
......
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