aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/sb
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/sb
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/sb')
-rw-r--r--sound/isa/sb/emu8000.c3
-rw-r--r--sound/isa/sb/emu8000_patch.c3
-rw-r--r--sound/isa/sb/sb16_csp.c9
-rw-r--r--sound/isa/sb/sb16_main.c3
-rw-r--r--sound/isa/sb/sb8_main.c8
-rw-r--r--sound/isa/sb/sb_common.c3
-rw-r--r--sound/isa/sb/sb_mixer.c9
7 files changed, 26 insertions, 12 deletions
diff --git a/sound/isa/sb/emu8000.c b/sound/isa/sb/emu8000.c
index b35be7d9a9fa..96678d5d3834 100644
--- a/sound/isa/sb/emu8000.c
+++ b/sound/isa/sb/emu8000.c
@@ -1023,7 +1023,8 @@ snd_emu8000_create_mixer(struct snd_card *card, struct snd_emu8000 *emu)
1023{ 1023{
1024 int i, err = 0; 1024 int i, err = 0;
1025 1025
1026 snd_assert(emu != NULL && card != NULL, return -EINVAL); 1026 if (snd_BUG_ON(!emu || !card))
1027 return -EINVAL;
1027 1028
1028 spin_lock_init(&emu->control_lock); 1029 spin_lock_init(&emu->control_lock);
1029 1030
diff --git a/sound/isa/sb/emu8000_patch.c b/sound/isa/sb/emu8000_patch.c
index 1be16c9700f0..c99c6078be33 100644
--- a/sound/isa/sb/emu8000_patch.c
+++ b/sound/isa/sb/emu8000_patch.c
@@ -156,7 +156,8 @@ snd_emu8000_sample_new(struct snd_emux *rec, struct snd_sf_sample *sp,
156 struct snd_emu8000 *emu; 156 struct snd_emu8000 *emu;
157 157
158 emu = rec->hw; 158 emu = rec->hw;
159 snd_assert(sp != NULL, return -EINVAL); 159 if (snd_BUG_ON(!sp))
160 return -EINVAL;
160 161
161 if (sp->v.size == 0) 162 if (sp->v.size == 0)
162 return 0; 163 return 0;
diff --git a/sound/isa/sb/sb16_csp.c b/sound/isa/sb/sb16_csp.c
index 35f3d7b16536..49037d074c71 100644
--- a/sound/isa/sb/sb16_csp.c
+++ b/sound/isa/sb/sb16_csp.c
@@ -198,7 +198,8 @@ static int snd_sb_csp_ioctl(struct snd_hwdep * hw, struct file *file, unsigned i
198 struct snd_sb_csp_start start_info; 198 struct snd_sb_csp_start start_info;
199 int err; 199 int err;
200 200
201 snd_assert(p != NULL, return -EINVAL); 201 if (snd_BUG_ON(!p))
202 return -EINVAL;
202 203
203 if (snd_sb_csp_check_version(p)) 204 if (snd_sb_csp_check_version(p))
204 return -ENODEV; 205 return -ENODEV;
@@ -1046,7 +1047,8 @@ static int snd_sb_qsound_build(struct snd_sb_csp * p)
1046 struct snd_card *card; 1047 struct snd_card *card;
1047 int err; 1048 int err;
1048 1049
1049 snd_assert(p != NULL, return -EINVAL); 1050 if (snd_BUG_ON(!p))
1051 return -EINVAL;
1050 1052
1051 card = p->chip->card; 1053 card = p->chip->card;
1052 p->qpos_left = p->qpos_right = SNDRV_SB_CSP_QSOUND_MAX_RIGHT / 2; 1054 p->qpos_left = p->qpos_right = SNDRV_SB_CSP_QSOUND_MAX_RIGHT / 2;
@@ -1071,7 +1073,8 @@ static void snd_sb_qsound_destroy(struct snd_sb_csp * p)
1071 struct snd_card *card; 1073 struct snd_card *card;
1072 unsigned long flags; 1074 unsigned long flags;
1073 1075
1074 snd_assert(p != NULL, return); 1076 if (snd_BUG_ON(!p))
1077 return;
1075 1078
1076 card = p->chip->card; 1079 card = p->chip->card;
1077 1080
diff --git a/sound/isa/sb/sb16_main.c b/sound/isa/sb/sb16_main.c
index f7e8192270ae..2a6cc1cfe945 100644
--- a/sound/isa/sb/sb16_main.c
+++ b/sound/isa/sb/sb16_main.c
@@ -669,7 +669,8 @@ static int snd_sb16_capture_close(struct snd_pcm_substream *substream)
669static int snd_sb16_set_dma_mode(struct snd_sb *chip, int what) 669static int snd_sb16_set_dma_mode(struct snd_sb *chip, int what)
670{ 670{
671 if (chip->dma8 < 0 || chip->dma16 < 0) { 671 if (chip->dma8 < 0 || chip->dma16 < 0) {
672 snd_assert(what == 0, return -EINVAL); 672 if (snd_BUG_ON(what))
673 return -EINVAL;
673 return 0; 674 return 0;
674 } 675 }
675 if (what == 0) { 676 if (what == 0) {
diff --git a/sound/isa/sb/sb8_main.c b/sound/isa/sb/sb8_main.c
index fe03bb820532..658d55769c9c 100644
--- a/sound/isa/sb/sb8_main.c
+++ b/sound/isa/sb/sb8_main.c
@@ -111,7 +111,9 @@ static int snd_sb8_playback_prepare(struct snd_pcm_substream *substream)
111 switch (chip->hardware) { 111 switch (chip->hardware) {
112 case SB_HW_PRO: 112 case SB_HW_PRO:
113 if (runtime->channels > 1) { 113 if (runtime->channels > 1) {
114 snd_assert(rate == SB8_RATE(11025) || rate == SB8_RATE(22050), return -EINVAL); 114 if (snd_BUG_ON(rate != SB8_RATE(11025) &&
115 rate != SB8_RATE(22050)))
116 return -EINVAL;
115 chip->playback_format = SB_DSP_HI_OUTPUT_AUTO; 117 chip->playback_format = SB_DSP_HI_OUTPUT_AUTO;
116 break; 118 break;
117 } 119 }
@@ -237,7 +239,9 @@ static int snd_sb8_capture_prepare(struct snd_pcm_substream *substream)
237 switch (chip->hardware) { 239 switch (chip->hardware) {
238 case SB_HW_PRO: 240 case SB_HW_PRO:
239 if (runtime->channels > 1) { 241 if (runtime->channels > 1) {
240 snd_assert(rate == SB8_RATE(11025) || rate == SB8_RATE(22050), return -EINVAL); 242 if (snd_BUG_ON(rate != SB8_RATE(11025) &&
243 rate != SB8_RATE(22050)))
244 return -EINVAL;
241 chip->capture_format = SB_DSP_HI_INPUT_AUTO; 245 chip->capture_format = SB_DSP_HI_INPUT_AUTO;
242 break; 246 break;
243 } 247 }
diff --git a/sound/isa/sb/sb_common.c b/sound/isa/sb/sb_common.c
index b432d9ae874b..27a651502251 100644
--- a/sound/isa/sb/sb_common.c
+++ b/sound/isa/sb/sb_common.c
@@ -219,7 +219,8 @@ int snd_sbdsp_create(struct snd_card *card,
219 .dev_free = snd_sbdsp_dev_free, 219 .dev_free = snd_sbdsp_dev_free,
220 }; 220 };
221 221
222 snd_assert(r_chip != NULL, return -EINVAL); 222 if (snd_BUG_ON(!r_chip))
223 return -EINVAL;
223 *r_chip = NULL; 224 *r_chip = NULL;
224 chip = kzalloc(sizeof(*chip), GFP_KERNEL); 225 chip = kzalloc(sizeof(*chip), GFP_KERNEL);
225 if (chip == NULL) 226 if (chip == NULL)
diff --git a/sound/isa/sb/sb_mixer.c b/sound/isa/sb/sb_mixer.c
index 73d4572d136b..406a431af91e 100644
--- a/sound/isa/sb/sb_mixer.c
+++ b/sound/isa/sb/sb_mixer.c
@@ -792,7 +792,8 @@ int snd_sbmixer_new(struct snd_sb *chip)
792 struct snd_card *card; 792 struct snd_card *card;
793 int err; 793 int err;
794 794
795 snd_assert(chip != NULL && chip->card != NULL, return -EINVAL); 795 if (snd_BUG_ON(!chip || !chip->card))
796 return -EINVAL;
796 797
797 card = chip->card; 798 card = chip->card;
798 799
@@ -925,7 +926,8 @@ static unsigned char als4000_saved_regs[] = {
925static void save_mixer(struct snd_sb *chip, unsigned char *regs, int num_regs) 926static void save_mixer(struct snd_sb *chip, unsigned char *regs, int num_regs)
926{ 927{
927 unsigned char *val = chip->saved_regs; 928 unsigned char *val = chip->saved_regs;
928 snd_assert(num_regs <= ARRAY_SIZE(chip->saved_regs), return); 929 if (snd_BUG_ON(num_regs > ARRAY_SIZE(chip->saved_regs)))
930 return;
929 for (; num_regs; num_regs--) 931 for (; num_regs; num_regs--)
930 *val++ = snd_sbmixer_read(chip, *regs++); 932 *val++ = snd_sbmixer_read(chip, *regs++);
931} 933}
@@ -933,7 +935,8 @@ static void save_mixer(struct snd_sb *chip, unsigned char *regs, int num_regs)
933static void restore_mixer(struct snd_sb *chip, unsigned char *regs, int num_regs) 935static void restore_mixer(struct snd_sb *chip, unsigned char *regs, int num_regs)
934{ 936{
935 unsigned char *val = chip->saved_regs; 937 unsigned char *val = chip->saved_regs;
936 snd_assert(num_regs <= ARRAY_SIZE(chip->saved_regs), return); 938 if (snd_BUG_ON(num_regs > ARRAY_SIZE(chip->saved_regs)))
939 return;
937 for (; num_regs; num_regs--) 940 for (; num_regs; num_regs--)
938 snd_sbmixer_write(chip, *regs++, *val++); 941 snd_sbmixer_write(chip, *regs++, *val++);
939} 942}