aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/gus
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2008-08-08 11:11:45 -0400
committerJaroslav Kysela <perex@perex.cz>2008-08-13 05:46:36 -0400
commit622207dc31895b4e82c39100db8635d885c795e2 (patch)
treecbfd03ebe9caa2564924c76f2ca28bc348a68c87 /sound/isa/gus
parent7eaa943c8ed8e91e05d0f5d0dc7a18e3319b45cf (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')
-rw-r--r--sound/isa/gus/gus_main.c6
-rw-r--r--sound/isa/gus/gus_mixer.c6
-rw-r--r--sound/isa/gus/gus_pcm.c12
3 files changed, 16 insertions, 8 deletions
diff --git a/sound/isa/gus/gus_main.c b/sound/isa/gus/gus_main.c
index cccc16c8113f..12eb98f2f931 100644
--- a/sound/isa/gus/gus_main.c
+++ b/sound/isa/gus/gus_main.c
@@ -276,9 +276,11 @@ static int snd_gus_init_dma_irq(struct snd_gus_card * gus, int latches)
276 static unsigned char dmas[8] = 276 static unsigned char dmas[8] =
277 {6, 1, 0, 2, 0, 3, 4, 5}; 277 {6, 1, 0, 2, 0, 3, 4, 5};
278 278
279 snd_assert(gus != NULL, return -EINVAL); 279 if (snd_BUG_ON(!gus))
280 return -EINVAL;
280 card = gus->card; 281 card = gus->card;
281 snd_assert(card != NULL, return -EINVAL); 282 if (snd_BUG_ON(!card))
283 return -EINVAL;
282 284
283 gus->mix_cntrl_reg &= 0xf8; 285 gus->mix_cntrl_reg &= 0xf8;
284 gus->mix_cntrl_reg |= 0x01; /* disable MIC, LINE IN, enable LINE OUT */ 286 gus->mix_cntrl_reg |= 0x01; /* disable MIC, LINE IN, enable LINE OUT */
diff --git a/sound/isa/gus/gus_mixer.c b/sound/isa/gus/gus_mixer.c
index ebdb33469306..0dd43414016e 100644
--- a/sound/isa/gus/gus_mixer.c
+++ b/sound/isa/gus/gus_mixer.c
@@ -161,9 +161,11 @@ int snd_gf1_new_mixer(struct snd_gus_card * gus)
161 unsigned int idx, max; 161 unsigned int idx, max;
162 int err; 162 int err;
163 163
164 snd_assert(gus != NULL, return -EINVAL); 164 if (snd_BUG_ON(!gus))
165 return -EINVAL;
165 card = gus->card; 166 card = gus->card;
166 snd_assert(card != NULL, return -EINVAL); 167 if (snd_BUG_ON(!card))
168 return -EINVAL;
167 169
168 if (gus->ics_flag) 170 if (gus->ics_flag)
169 snd_component_add(card, "ICS2101"); 171 snd_component_add(card, "ICS2101");
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);