diff options
author | Takashi Iwai <tiwai@suse.de> | 2008-08-08 11:11:45 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2008-08-13 05:46:36 -0400 |
commit | 622207dc31895b4e82c39100db8635d885c795e2 (patch) | |
tree | cbfd03ebe9caa2564924c76f2ca28bc348a68c87 /sound/isa/gus/gus_pcm.c | |
parent | 7eaa943c8ed8e91e05d0f5d0dc7a18e3319b45cf (diff) |
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>
Diffstat (limited to 'sound/isa/gus/gus_pcm.c')
-rw-r--r-- | sound/isa/gus/gus_pcm.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sound/isa/gus/gus_pcm.c b/sound/isa/gus/gus_pcm.c index 99731dc97325..38510aeb21c6 100644 --- a/sound/isa/gus/gus_pcm.c +++ b/sound/isa/gus/gus_pcm.c | |||
@@ -352,8 +352,10 @@ static int snd_gf1_pcm_playback_copy(struct snd_pcm_substream *substream, | |||
352 | 352 | ||
353 | bpos = samples_to_bytes(runtime, pos) + (voice * (pcmp->dma_size / 2)); | 353 | bpos = samples_to_bytes(runtime, pos) + (voice * (pcmp->dma_size / 2)); |
354 | len = samples_to_bytes(runtime, count); | 354 | len = samples_to_bytes(runtime, count); |
355 | snd_assert(bpos <= pcmp->dma_size, return -EIO); | 355 | if (snd_BUG_ON(bpos > pcmp->dma_size)) |
356 | snd_assert(bpos + len <= pcmp->dma_size, return -EIO); | 356 | return -EIO; |
357 | if (snd_BUG_ON(bpos + len > pcmp->dma_size)) | ||
358 | return -EIO; | ||
357 | if (copy_from_user(runtime->dma_area + bpos, src, len)) | 359 | if (copy_from_user(runtime->dma_area + bpos, src, len)) |
358 | return -EFAULT; | 360 | return -EFAULT; |
359 | if (snd_gf1_pcm_use_dma && len > 32) { | 361 | if (snd_gf1_pcm_use_dma && len > 32) { |
@@ -381,8 +383,10 @@ static int snd_gf1_pcm_playback_silence(struct snd_pcm_substream *substream, | |||
381 | 383 | ||
382 | bpos = samples_to_bytes(runtime, pos) + (voice * (pcmp->dma_size / 2)); | 384 | bpos = samples_to_bytes(runtime, pos) + (voice * (pcmp->dma_size / 2)); |
383 | len = samples_to_bytes(runtime, count); | 385 | len = samples_to_bytes(runtime, count); |
384 | snd_assert(bpos <= pcmp->dma_size, return -EIO); | 386 | if (snd_BUG_ON(bpos > pcmp->dma_size)) |
385 | snd_assert(bpos + len <= pcmp->dma_size, return -EIO); | 387 | return -EIO; |
388 | if (snd_BUG_ON(bpos + len > pcmp->dma_size)) | ||
389 | return -EIO; | ||
386 | snd_pcm_format_set_silence(runtime->format, runtime->dma_area + bpos, count); | 390 | snd_pcm_format_set_silence(runtime->format, runtime->dma_area + bpos, count); |
387 | if (snd_gf1_pcm_use_dma && len > 32) { | 391 | if (snd_gf1_pcm_use_dma && len > 32) { |
388 | return snd_gf1_pcm_block_change(substream, bpos, pcmp->memory + bpos, len); | 392 | return snd_gf1_pcm_block_change(substream, bpos, pcmp->memory + bpos, len); |