mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 21:10:51 +07:00
[ALSA] sound: ali5451.c fix shadowed variable warnings
enable is used to test for whether or not spdif should be enabled, change to spdif_enable. sound/pci/ali5451/ali5451.c:1812:15: warning: symbol 'enable' shadows an earlier one sound/pci/ali5451/ali5451.c:63:12: originally declared here sound/pci/ali5451/ali5451.c:1840:27: warning: symbol 'enable' shadows an earlier one sound/pci/ali5451/ali5451.c:63:12: originally declared here Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
608b10bad3
commit
c74056d437
@ -1809,26 +1809,26 @@ static int snd_ali5451_spdif_get(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
struct snd_ali *codec = kcontrol->private_data;
|
||||
unsigned int enable;
|
||||
unsigned int spdif_enable;
|
||||
|
||||
enable = ucontrol->value.integer.value[0] ? 1 : 0;
|
||||
spdif_enable = ucontrol->value.integer.value[0] ? 1 : 0;
|
||||
|
||||
spin_lock_irq(&codec->reg_lock);
|
||||
switch (kcontrol->private_value) {
|
||||
case 0:
|
||||
enable = (codec->spdif_mask & 0x02) ? 1 : 0;
|
||||
spdif_enable = (codec->spdif_mask & 0x02) ? 1 : 0;
|
||||
break;
|
||||
case 1:
|
||||
enable = ((codec->spdif_mask & 0x02) &&
|
||||
spdif_enable = ((codec->spdif_mask & 0x02) &&
|
||||
(codec->spdif_mask & 0x04)) ? 1 : 0;
|
||||
break;
|
||||
case 2:
|
||||
enable = (codec->spdif_mask & 0x01) ? 1 : 0;
|
||||
spdif_enable = (codec->spdif_mask & 0x01) ? 1 : 0;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
ucontrol->value.integer.value[0] = enable;
|
||||
ucontrol->value.integer.value[0] = spdif_enable;
|
||||
spin_unlock_irq(&codec->reg_lock);
|
||||
return 0;
|
||||
}
|
||||
@ -1837,17 +1837,17 @@ static int snd_ali5451_spdif_put(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
struct snd_ali *codec = kcontrol->private_data;
|
||||
unsigned int change = 0, enable = 0;
|
||||
unsigned int change = 0, spdif_enable = 0;
|
||||
|
||||
enable = ucontrol->value.integer.value[0] ? 1 : 0;
|
||||
spdif_enable = ucontrol->value.integer.value[0] ? 1 : 0;
|
||||
|
||||
spin_lock_irq(&codec->reg_lock);
|
||||
switch (kcontrol->private_value) {
|
||||
case 0:
|
||||
change = (codec->spdif_mask & 0x02) ? 1 : 0;
|
||||
change = change ^ enable;
|
||||
change = change ^ spdif_enable;
|
||||
if (change) {
|
||||
if (enable) {
|
||||
if (spdif_enable) {
|
||||
codec->spdif_mask |= 0x02;
|
||||
snd_ali_enable_spdif_out(codec);
|
||||
} else {
|
||||
@ -1859,9 +1859,9 @@ static int snd_ali5451_spdif_put(struct snd_kcontrol *kcontrol,
|
||||
break;
|
||||
case 1:
|
||||
change = (codec->spdif_mask & 0x04) ? 1 : 0;
|
||||
change = change ^ enable;
|
||||
change = change ^ spdif_enable;
|
||||
if (change && (codec->spdif_mask & 0x02)) {
|
||||
if (enable) {
|
||||
if (spdif_enable) {
|
||||
codec->spdif_mask |= 0x04;
|
||||
snd_ali_enable_spdif_chnout(codec);
|
||||
} else {
|
||||
@ -1872,9 +1872,9 @@ static int snd_ali5451_spdif_put(struct snd_kcontrol *kcontrol,
|
||||
break;
|
||||
case 2:
|
||||
change = (codec->spdif_mask & 0x01) ? 1 : 0;
|
||||
change = change ^ enable;
|
||||
change = change ^ spdif_enable;
|
||||
if (change) {
|
||||
if (enable) {
|
||||
if (spdif_enable) {
|
||||
codec->spdif_mask |= 0x01;
|
||||
snd_ali_enable_spdif_in(codec);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user