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/info.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/info.c')
-rw-r--r-- | sound/core/info.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/sound/core/info.c b/sound/core/info.c index c67773ad9298..527b207462b0 100644 --- a/sound/core/info.c +++ b/sound/core/info.c | |||
@@ -217,7 +217,8 @@ static ssize_t snd_info_entry_read(struct file *file, char __user *buffer, | |||
217 | loff_t pos; | 217 | loff_t pos; |
218 | 218 | ||
219 | data = file->private_data; | 219 | data = file->private_data; |
220 | snd_assert(data != NULL, return -ENXIO); | 220 | if (snd_BUG_ON(!data)) |
221 | return -ENXIO; | ||
221 | pos = *offset; | 222 | pos = *offset; |
222 | if (pos < 0 || (long) pos != pos || (ssize_t) count < 0) | 223 | if (pos < 0 || (long) pos != pos || (ssize_t) count < 0) |
223 | return -EIO; | 224 | return -EIO; |
@@ -258,7 +259,8 @@ static ssize_t snd_info_entry_write(struct file *file, const char __user *buffer | |||
258 | loff_t pos; | 259 | loff_t pos; |
259 | 260 | ||
260 | data = file->private_data; | 261 | data = file->private_data; |
261 | snd_assert(data != NULL, return -ENXIO); | 262 | if (snd_BUG_ON(!data)) |
263 | return -ENXIO; | ||
262 | entry = data->entry; | 264 | entry = data->entry; |
263 | pos = *offset; | 265 | pos = *offset; |
264 | if (pos < 0 || (long) pos != pos || (ssize_t) count < 0) | 266 | if (pos < 0 || (long) pos != pos || (ssize_t) count < 0) |
@@ -614,7 +616,8 @@ int snd_info_card_create(struct snd_card *card) | |||
614 | char str[8]; | 616 | char str[8]; |
615 | struct snd_info_entry *entry; | 617 | struct snd_info_entry *entry; |
616 | 618 | ||
617 | snd_assert(card != NULL, return -ENXIO); | 619 | if (snd_BUG_ON(!card)) |
620 | return -ENXIO; | ||
618 | 621 | ||
619 | sprintf(str, "card%i", card->number); | 622 | sprintf(str, "card%i", card->number); |
620 | if ((entry = snd_info_create_module_entry(card->module, str, NULL)) == NULL) | 623 | if ((entry = snd_info_create_module_entry(card->module, str, NULL)) == NULL) |
@@ -636,7 +639,8 @@ int snd_info_card_register(struct snd_card *card) | |||
636 | { | 639 | { |
637 | struct proc_dir_entry *p; | 640 | struct proc_dir_entry *p; |
638 | 641 | ||
639 | snd_assert(card != NULL, return -ENXIO); | 642 | if (snd_BUG_ON(!card)) |
643 | return -ENXIO; | ||
640 | 644 | ||
641 | if (!strcmp(card->id, card->proc_root->name)) | 645 | if (!strcmp(card->id, card->proc_root->name)) |
642 | return 0; | 646 | return 0; |
@@ -654,7 +658,8 @@ int snd_info_card_register(struct snd_card *card) | |||
654 | */ | 658 | */ |
655 | void snd_info_card_disconnect(struct snd_card *card) | 659 | void snd_info_card_disconnect(struct snd_card *card) |
656 | { | 660 | { |
657 | snd_assert(card != NULL, return); | 661 | if (!card) |
662 | return; | ||
658 | mutex_lock(&info_mutex); | 663 | mutex_lock(&info_mutex); |
659 | if (card->proc_root_link) { | 664 | if (card->proc_root_link) { |
660 | snd_remove_proc_entry(snd_proc_root, card->proc_root_link); | 665 | snd_remove_proc_entry(snd_proc_root, card->proc_root_link); |
@@ -671,7 +676,8 @@ void snd_info_card_disconnect(struct snd_card *card) | |||
671 | */ | 676 | */ |
672 | int snd_info_card_free(struct snd_card *card) | 677 | int snd_info_card_free(struct snd_card *card) |
673 | { | 678 | { |
674 | snd_assert(card != NULL, return -ENXIO); | 679 | if (!card) |
680 | return 0; | ||
675 | snd_info_free_entry(card->proc_root); | 681 | snd_info_free_entry(card->proc_root); |
676 | card->proc_root = NULL; | 682 | card->proc_root = NULL; |
677 | return 0; | 683 | return 0; |
@@ -849,7 +855,7 @@ static void snd_info_disconnect(struct snd_info_entry *entry) | |||
849 | return; | 855 | return; |
850 | list_del_init(&entry->list); | 856 | list_del_init(&entry->list); |
851 | root = entry->parent == NULL ? snd_proc_root : entry->parent->p; | 857 | root = entry->parent == NULL ? snd_proc_root : entry->parent->p; |
852 | snd_assert(root, return); | 858 | snd_BUG_ON(!root); |
853 | snd_remove_proc_entry(root, entry->p); | 859 | snd_remove_proc_entry(root, entry->p); |
854 | entry->p = NULL; | 860 | entry->p = NULL; |
855 | } | 861 | } |
@@ -947,7 +953,8 @@ int snd_info_register(struct snd_info_entry * entry) | |||
947 | { | 953 | { |
948 | struct proc_dir_entry *root, *p = NULL; | 954 | struct proc_dir_entry *root, *p = NULL; |
949 | 955 | ||
950 | snd_assert(entry != NULL, return -ENXIO); | 956 | if (snd_BUG_ON(!entry)) |
957 | return -ENXIO; | ||
951 | root = entry->parent == NULL ? snd_proc_root : entry->parent->p; | 958 | root = entry->parent == NULL ? snd_proc_root : entry->parent->p; |
952 | mutex_lock(&info_mutex); | 959 | mutex_lock(&info_mutex); |
953 | p = snd_create_proc_entry(entry->name, entry->mode, root); | 960 | p = snd_create_proc_entry(entry->name, entry->mode, root); |