ALSA: Kill snd_assert() in other places
Kill snd_assert() in other places, either removed or replaced with if () with snd_BUG_ON(). Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:

committato da
Jaroslav Kysela

parent
da3cec35dd
commit
5e246b850d
@@ -319,7 +319,8 @@ static void awacs_amp_set_master(struct awacs_amp *amp, int vol)
|
||||
static void awacs_amp_free(struct snd_pmac *chip)
|
||||
{
|
||||
struct awacs_amp *amp = chip->mixer_data;
|
||||
snd_assert(amp, return);
|
||||
if (!amp)
|
||||
return;
|
||||
kfree(amp);
|
||||
chip->mixer_data = NULL;
|
||||
chip->mixer_free = NULL;
|
||||
@@ -345,8 +346,7 @@ static int snd_pmac_awacs_get_volume_amp(struct snd_kcontrol *kcontrol,
|
||||
struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
|
||||
int index = kcontrol->private_value;
|
||||
struct awacs_amp *amp = chip->mixer_data;
|
||||
snd_assert(amp, return -EINVAL);
|
||||
snd_assert(index >= 0 && index <= 1, return -EINVAL);
|
||||
|
||||
ucontrol->value.integer.value[0] = 31 - (amp->amp_vol[index][0] & 31);
|
||||
ucontrol->value.integer.value[1] = 31 - (amp->amp_vol[index][1] & 31);
|
||||
return 0;
|
||||
@@ -359,8 +359,6 @@ static int snd_pmac_awacs_put_volume_amp(struct snd_kcontrol *kcontrol,
|
||||
int index = kcontrol->private_value;
|
||||
int vol[2];
|
||||
struct awacs_amp *amp = chip->mixer_data;
|
||||
snd_assert(amp, return -EINVAL);
|
||||
snd_assert(index >= 0 && index <= 1, return -EINVAL);
|
||||
|
||||
vol[0] = (31 - (ucontrol->value.integer.value[0] & 31))
|
||||
| (amp->amp_vol[index][0] & 32);
|
||||
@@ -375,8 +373,7 @@ static int snd_pmac_awacs_get_switch_amp(struct snd_kcontrol *kcontrol,
|
||||
struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
|
||||
int index = kcontrol->private_value;
|
||||
struct awacs_amp *amp = chip->mixer_data;
|
||||
snd_assert(amp, return -EINVAL);
|
||||
snd_assert(index >= 0 && index <= 1, return -EINVAL);
|
||||
|
||||
ucontrol->value.integer.value[0] = (amp->amp_vol[index][0] & 32)
|
||||
? 0 : 1;
|
||||
ucontrol->value.integer.value[1] = (amp->amp_vol[index][1] & 32)
|
||||
@@ -391,8 +388,6 @@ static int snd_pmac_awacs_put_switch_amp(struct snd_kcontrol *kcontrol,
|
||||
int index = kcontrol->private_value;
|
||||
int vol[2];
|
||||
struct awacs_amp *amp = chip->mixer_data;
|
||||
snd_assert(amp, return -EINVAL);
|
||||
snd_assert(index >= 0 && index <= 1, return -EINVAL);
|
||||
|
||||
vol[0] = (ucontrol->value.integer.value[0] ? 0 : 32)
|
||||
| (amp->amp_vol[index][0] & 31);
|
||||
@@ -417,8 +412,7 @@ static int snd_pmac_awacs_get_tone_amp(struct snd_kcontrol *kcontrol,
|
||||
struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
|
||||
int index = kcontrol->private_value;
|
||||
struct awacs_amp *amp = chip->mixer_data;
|
||||
snd_assert(amp, return -EINVAL);
|
||||
snd_assert(index >= 0 && index <= 1, return -EINVAL);
|
||||
|
||||
ucontrol->value.integer.value[0] = amp->amp_tone[index];
|
||||
return 0;
|
||||
}
|
||||
@@ -430,8 +424,7 @@ static int snd_pmac_awacs_put_tone_amp(struct snd_kcontrol *kcontrol,
|
||||
int index = kcontrol->private_value;
|
||||
struct awacs_amp *amp = chip->mixer_data;
|
||||
unsigned int val;
|
||||
snd_assert(amp, return -EINVAL);
|
||||
snd_assert(index >= 0 && index <= 1, return -EINVAL);
|
||||
|
||||
val = ucontrol->value.integer.value[0];
|
||||
if (val > 14)
|
||||
return -EINVAL;
|
||||
@@ -458,7 +451,7 @@ static int snd_pmac_awacs_get_master_amp(struct snd_kcontrol *kcontrol,
|
||||
{
|
||||
struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
|
||||
struct awacs_amp *amp = chip->mixer_data;
|
||||
snd_assert(amp, return -EINVAL);
|
||||
|
||||
ucontrol->value.integer.value[0] = amp->amp_master;
|
||||
return 0;
|
||||
}
|
||||
@@ -469,7 +462,7 @@ static int snd_pmac_awacs_put_master_amp(struct snd_kcontrol *kcontrol,
|
||||
struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
|
||||
struct awacs_amp *amp = chip->mixer_data;
|
||||
unsigned int val;
|
||||
snd_assert(amp, return -EINVAL);
|
||||
|
||||
val = ucontrol->value.integer.value[0];
|
||||
if (val > 99)
|
||||
return -EINVAL;
|
||||
|
Fai riferimento in un nuovo problema
Block a user