]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - sound/pci/mixart/mixart_core.c
ALSA: Kill snd_assert() in sound/pci/*
[linux-2.6-omap-h63xx.git] / sound / pci / mixart / mixart_core.c
index 785085e48353c3111f4e29085be77ade17298750..b9a06c2793970d4d13a29e6c2ca3f9a4cae7faa4 100644 (file)
@@ -56,8 +56,10 @@ static int retrieve_msg_frame(struct mixart_mgr *mgr, u32 *msg_frame)
        if (tailptr == headptr)
                return 0; /* no message posted */
 
-       snd_assert( tailptr >= MSG_OUTBOUND_POST_STACK, return 0); /* error */
-       snd_assert( tailptr < (MSG_OUTBOUND_POST_STACK+MSG_BOUND_STACK_SIZE), return 0); /* error */
+       if (tailptr < MSG_OUTBOUND_POST_STACK)
+               return 0; /* error */
+       if (tailptr >= MSG_OUTBOUND_POST_STACK + MSG_BOUND_STACK_SIZE)
+               return 0; /* error */
 
        *msg_frame = readl_be(MIXART_MEM(mgr, tailptr));
 
@@ -149,7 +151,8 @@ static int send_msg( struct mixart_mgr *mgr,
        u32 msg_frame_address;
        int err, i;
 
-       snd_assert(msg->size % 4 == 0, return -EINVAL);
+       if (snd_BUG_ON(msg->size % 4))
+               return -EINVAL;
 
        err = 0;
 
@@ -289,9 +292,12 @@ int snd_mixart_send_msg_wait_notif(struct mixart_mgr *mgr,
        wait_queue_t wait;
        long timeout;
 
-       snd_assert(notif_event != 0, return -EINVAL);
-       snd_assert((notif_event & MSG_TYPE_MASK) == MSG_TYPE_NOTIFY, return -EINVAL);
-       snd_assert((notif_event & MSG_CANCEL_NOTIFY_MASK) == 0, return -EINVAL);
+       if (snd_BUG_ON(!notif_event))
+               return -EINVAL;
+       if (snd_BUG_ON((notif_event & MSG_TYPE_MASK) != MSG_TYPE_NOTIFY))
+               return -EINVAL;
+       if (snd_BUG_ON(notif_event & MSG_CANCEL_NOTIFY_MASK))
+               return -EINVAL;
 
        mutex_lock(&mgr->msg_mutex);