ALSA: Kill snd_assert() in sound/isa/*
Kill snd_assert() in sound/isa/*, 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>
此提交包含在:
@@ -276,9 +276,11 @@ static int snd_gus_init_dma_irq(struct snd_gus_card * gus, int latches)
|
||||
static unsigned char dmas[8] =
|
||||
{6, 1, 0, 2, 0, 3, 4, 5};
|
||||
|
||||
snd_assert(gus != NULL, return -EINVAL);
|
||||
if (snd_BUG_ON(!gus))
|
||||
return -EINVAL;
|
||||
card = gus->card;
|
||||
snd_assert(card != NULL, return -EINVAL);
|
||||
if (snd_BUG_ON(!card))
|
||||
return -EINVAL;
|
||||
|
||||
gus->mix_cntrl_reg &= 0xf8;
|
||||
gus->mix_cntrl_reg |= 0x01; /* disable MIC, LINE IN, enable LINE OUT */
|
||||
|
@@ -161,9 +161,11 @@ int snd_gf1_new_mixer(struct snd_gus_card * gus)
|
||||
unsigned int idx, max;
|
||||
int err;
|
||||
|
||||
snd_assert(gus != NULL, return -EINVAL);
|
||||
if (snd_BUG_ON(!gus))
|
||||
return -EINVAL;
|
||||
card = gus->card;
|
||||
snd_assert(card != NULL, return -EINVAL);
|
||||
if (snd_BUG_ON(!card))
|
||||
return -EINVAL;
|
||||
|
||||
if (gus->ics_flag)
|
||||
snd_component_add(card, "ICS2101");
|
||||
|
@@ -352,8 +352,10 @@ static int snd_gf1_pcm_playback_copy(struct snd_pcm_substream *substream,
|
||||
|
||||
bpos = samples_to_bytes(runtime, pos) + (voice * (pcmp->dma_size / 2));
|
||||
len = samples_to_bytes(runtime, count);
|
||||
snd_assert(bpos <= pcmp->dma_size, return -EIO);
|
||||
snd_assert(bpos + len <= pcmp->dma_size, return -EIO);
|
||||
if (snd_BUG_ON(bpos > pcmp->dma_size))
|
||||
return -EIO;
|
||||
if (snd_BUG_ON(bpos + len > pcmp->dma_size))
|
||||
return -EIO;
|
||||
if (copy_from_user(runtime->dma_area + bpos, src, len))
|
||||
return -EFAULT;
|
||||
if (snd_gf1_pcm_use_dma && len > 32) {
|
||||
@@ -381,8 +383,10 @@ static int snd_gf1_pcm_playback_silence(struct snd_pcm_substream *substream,
|
||||
|
||||
bpos = samples_to_bytes(runtime, pos) + (voice * (pcmp->dma_size / 2));
|
||||
len = samples_to_bytes(runtime, count);
|
||||
snd_assert(bpos <= pcmp->dma_size, return -EIO);
|
||||
snd_assert(bpos + len <= pcmp->dma_size, return -EIO);
|
||||
if (snd_BUG_ON(bpos > pcmp->dma_size))
|
||||
return -EIO;
|
||||
if (snd_BUG_ON(bpos + len > pcmp->dma_size))
|
||||
return -EIO;
|
||||
snd_pcm_format_set_silence(runtime->format, runtime->dma_area + bpos, count);
|
||||
if (snd_gf1_pcm_use_dma && len > 32) {
|
||||
return snd_gf1_pcm_block_change(substream, bpos, pcmp->memory + bpos, len);
|
||||
|
新增問題並參考
封鎖使用者