aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/control.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2005-10-10 05:46:31 -0400
committerJaroslav Kysela <perex@suse.cz>2005-11-04 07:17:42 -0500
commit7c22f1aaa23370bf9ba2dd3abbccbed70dced216 (patch)
treeebc9c1e5cfdab4815afdfab1ba583e6220287252 /sound/core/control.c
parentf01cc521a2abef5dba24fb0873b9626ba6b0a0a5 (diff)
[ALSA] Remove snd_runtime_check() macro
Remove snd_runtime_check() macro. This macro worsens the readability of codes. They should be either normal if() or removable asserts. Also, the assert displays stack-dump, instead of only the last caller pointer. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/control.c')
-rw-r--r--sound/core/control.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/sound/core/control.c b/sound/core/control.c
index 736edf358e05..212c46a94376 100644
--- a/sound/core/control.c
+++ b/sound/core/control.c
@@ -144,7 +144,7 @@ void snd_ctl_notify(snd_card_t *card, unsigned int mask, snd_ctl_elem_id_t *id)
144 snd_ctl_file_t *ctl; 144 snd_ctl_file_t *ctl;
145 snd_kctl_event_t *ev; 145 snd_kctl_event_t *ev;
146 146
147 snd_runtime_check(card != NULL && id != NULL, return); 147 snd_assert(card != NULL && id != NULL, return);
148 read_lock(&card->ctl_files_rwlock); 148 read_lock(&card->ctl_files_rwlock);
149#if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE) 149#if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE)
150 card->mixer_oss_change_count++; 150 card->mixer_oss_change_count++;
@@ -193,8 +193,8 @@ snd_kcontrol_t *snd_ctl_new(snd_kcontrol_t * control, unsigned int access)
193 snd_kcontrol_t *kctl; 193 snd_kcontrol_t *kctl;
194 unsigned int idx; 194 unsigned int idx;
195 195
196 snd_runtime_check(control != NULL, return NULL); 196 snd_assert(control != NULL, return NULL);
197 snd_runtime_check(control->count > 0, return NULL); 197 snd_assert(control->count > 0, return NULL);
198 kctl = kzalloc(sizeof(*kctl) + sizeof(snd_kcontrol_volatile_t) * control->count, GFP_KERNEL); 198 kctl = kzalloc(sizeof(*kctl) + sizeof(snd_kcontrol_volatile_t) * control->count, GFP_KERNEL);
199 if (kctl == NULL) 199 if (kctl == NULL)
200 return NULL; 200 return NULL;
@@ -220,7 +220,7 @@ snd_kcontrol_t *snd_ctl_new1(const snd_kcontrol_new_t * ncontrol, void *private_
220 snd_kcontrol_t kctl; 220 snd_kcontrol_t kctl;
221 unsigned int access; 221 unsigned int access;
222 222
223 snd_runtime_check(ncontrol != NULL, return NULL); 223 snd_assert(ncontrol != NULL, return NULL);
224 snd_assert(ncontrol->info != NULL, return NULL); 224 snd_assert(ncontrol->info != NULL, return NULL);
225 memset(&kctl, 0, sizeof(kctl)); 225 memset(&kctl, 0, sizeof(kctl));
226 kctl.id.iface = ncontrol->iface; 226 kctl.id.iface = ncontrol->iface;
@@ -309,7 +309,7 @@ int snd_ctl_add(snd_card_t * card, snd_kcontrol_t * kcontrol)
309 snd_ctl_elem_id_t id; 309 snd_ctl_elem_id_t id;
310 unsigned int idx; 310 unsigned int idx;
311 311
312 snd_runtime_check(card != NULL && kcontrol != NULL, return -EINVAL); 312 snd_assert(card != NULL && kcontrol != NULL, return -EINVAL);
313 snd_assert(kcontrol->info != NULL, return -EINVAL); 313 snd_assert(kcontrol->info != NULL, return -EINVAL);
314 id = kcontrol->id; 314 id = kcontrol->id;
315 down_write(&card->controls_rwsem); 315 down_write(&card->controls_rwsem);
@@ -355,7 +355,7 @@ int snd_ctl_remove(snd_card_t * card, snd_kcontrol_t * kcontrol)
355 snd_ctl_elem_id_t id; 355 snd_ctl_elem_id_t id;
356 unsigned int idx; 356 unsigned int idx;
357 357
358 snd_runtime_check(card != NULL && kcontrol != NULL, return -EINVAL); 358 snd_assert(card != NULL && kcontrol != NULL, return -EINVAL);
359 list_del(&kcontrol->list); 359 list_del(&kcontrol->list);
360 card->controls_count -= kcontrol->count; 360 card->controls_count -= kcontrol->count;
361 id = kcontrol->id; 361 id = kcontrol->id;
@@ -468,7 +468,7 @@ snd_kcontrol_t *snd_ctl_find_numid(snd_card_t * card, unsigned int numid)
468 struct list_head *list; 468 struct list_head *list;
469 snd_kcontrol_t *kctl; 469 snd_kcontrol_t *kctl;
470 470
471 snd_runtime_check(card != NULL && numid != 0, return NULL); 471 snd_assert(card != NULL && numid != 0, return NULL);
472 list_for_each(list, &card->controls) { 472 list_for_each(list, &card->controls) {
473 kctl = snd_kcontrol(list); 473 kctl = snd_kcontrol(list);
474 if (kctl->id.numid <= numid && kctl->id.numid + kctl->count > numid) 474 if (kctl->id.numid <= numid && kctl->id.numid + kctl->count > numid)
@@ -494,7 +494,7 @@ snd_kcontrol_t *snd_ctl_find_id(snd_card_t * card, snd_ctl_elem_id_t *id)
494 struct list_head *list; 494 struct list_head *list;
495 snd_kcontrol_t *kctl; 495 snd_kcontrol_t *kctl;
496 496
497 snd_runtime_check(card != NULL && id != NULL, return NULL); 497 snd_assert(card != NULL && id != NULL, return NULL);
498 if (id->numid != 0) 498 if (id->numid != 0)
499 return snd_ctl_find_numid(card, id->numid); 499 return snd_ctl_find_numid(card, id->numid);
500 list_for_each(list, &card->controls) { 500 list_for_each(list, &card->controls) {
@@ -1215,7 +1215,7 @@ static int _snd_ctl_unregister_ioctl(snd_kctl_ioctl_func_t fcn, struct list_head
1215 struct list_head *list; 1215 struct list_head *list;
1216 snd_kctl_ioctl_t *p; 1216 snd_kctl_ioctl_t *p;
1217 1217
1218 snd_runtime_check(fcn != NULL, return -EINVAL); 1218 snd_assert(fcn != NULL, return -EINVAL);
1219 down_write(&snd_ioctl_rwsem); 1219 down_write(&snd_ioctl_rwsem);
1220 list_for_each(list, lists) { 1220 list_for_each(list, lists) {
1221 p = list_entry(list, snd_kctl_ioctl_t, list); 1221 p = list_entry(list, snd_kctl_ioctl_t, list);