diff options
author | Takashi Iwai <tiwai@suse.de> | 2008-08-08 11:09:09 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2008-08-13 05:46:35 -0400 |
commit | 7eaa943c8ed8e91e05d0f5d0dc7a18e3319b45cf (patch) | |
tree | 51d86a4cb01cf5735b18c36ca62471f8c759a041 /sound/core/pcm_memory.c | |
parent | 5ef03460a6ffc1d3ee6b6f2abc6765d3e224cf89 (diff) |
ALSA: Kill snd_assert() in sound/core/*
Kill snd_assert() in sound/core/*, 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/core/pcm_memory.c')
-rw-r--r-- | sound/core/pcm_memory.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sound/core/pcm_memory.c b/sound/core/pcm_memory.c index ff07b4a9992e..859b1185e69a 100644 --- a/sound/core/pcm_memory.c +++ b/sound/core/pcm_memory.c | |||
@@ -50,8 +50,6 @@ static int preallocate_pcm_pages(struct snd_pcm_substream *substream, size_t siz | |||
50 | struct snd_dma_buffer *dmab = &substream->dma_buffer; | 50 | struct snd_dma_buffer *dmab = &substream->dma_buffer; |
51 | int err; | 51 | int err; |
52 | 52 | ||
53 | snd_assert(size > 0, return -EINVAL); | ||
54 | |||
55 | /* already reserved? */ | 53 | /* already reserved? */ |
56 | if (snd_dma_get_reserved_buf(dmab, substream->dma_buf_id) > 0) { | 54 | if (snd_dma_get_reserved_buf(dmab, substream->dma_buf_id) > 0) { |
57 | if (dmab->bytes >= size) | 55 | if (dmab->bytes >= size) |
@@ -342,10 +340,12 @@ int snd_pcm_lib_malloc_pages(struct snd_pcm_substream *substream, size_t size) | |||
342 | struct snd_pcm_runtime *runtime; | 340 | struct snd_pcm_runtime *runtime; |
343 | struct snd_dma_buffer *dmab = NULL; | 341 | struct snd_dma_buffer *dmab = NULL; |
344 | 342 | ||
345 | snd_assert(substream->dma_buffer.dev.type != SNDRV_DMA_TYPE_UNKNOWN, return -EINVAL); | 343 | if (PCM_RUNTIME_CHECK(substream)) |
346 | snd_assert(substream != NULL, return -EINVAL); | 344 | return -EINVAL; |
345 | if (snd_BUG_ON(substream->dma_buffer.dev.type == | ||
346 | SNDRV_DMA_TYPE_UNKNOWN)) | ||
347 | return -EINVAL; | ||
347 | runtime = substream->runtime; | 348 | runtime = substream->runtime; |
348 | snd_assert(runtime != NULL, return -EINVAL); | ||
349 | 349 | ||
350 | if (runtime->dma_buffer_p) { | 350 | if (runtime->dma_buffer_p) { |
351 | /* perphaps, we might free the large DMA memory region | 351 | /* perphaps, we might free the large DMA memory region |
@@ -391,9 +391,9 @@ int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream) | |||
391 | { | 391 | { |
392 | struct snd_pcm_runtime *runtime; | 392 | struct snd_pcm_runtime *runtime; |
393 | 393 | ||
394 | snd_assert(substream != NULL, return -EINVAL); | 394 | if (PCM_RUNTIME_CHECK(substream)) |
395 | return -EINVAL; | ||
395 | runtime = substream->runtime; | 396 | runtime = substream->runtime; |
396 | snd_assert(runtime != NULL, return -EINVAL); | ||
397 | if (runtime->dma_area == NULL) | 397 | if (runtime->dma_area == NULL) |
398 | return 0; | 398 | return 0; |
399 | if (runtime->dma_buffer_p != &substream->dma_buffer) { | 399 | if (runtime->dma_buffer_p != &substream->dma_buffer) { |