vserver 2.0 rc7
[linux-2.6.git] / net / irda / iriap.c
index f22993c..b8bb78a 100644 (file)
@@ -107,8 +107,8 @@ int __init iriap_init(void)
        /* Object repository - defined in irias_object.c */
        irias_objects = hashbin_new(HB_LOCK);
        if (!irias_objects) {
-               WARNING("%s: Can't allocate irias_objects hashbin!\n",
-                       __FUNCTION__);
+               IRDA_WARNING("%s: Can't allocate irias_objects hashbin!\n",
+                            __FUNCTION__);
                hashbin_delete(iriap, NULL);
                return -ENOMEM;
        }
@@ -175,7 +175,7 @@ struct iriap_cb *iriap_open(__u8 slsap_sel, int mode, void *priv,
 
        self = kmalloc(sizeof(struct iriap_cb), GFP_ATOMIC);
        if (!self) {
-               WARNING("%s: Unable to kmalloc!\n", __FUNCTION__);
+               IRDA_WARNING("%s: Unable to kmalloc!\n", __FUNCTION__);
                return NULL;
        }
 
@@ -220,8 +220,8 @@ static void __iriap_close(struct iriap_cb *self)
 {
        IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
-       ASSERT(self != NULL, return;);
-       ASSERT(self->magic == IAS_MAGIC, return;);
+       IRDA_ASSERT(self != NULL, return;);
+       IRDA_ASSERT(self->magic == IAS_MAGIC, return;);
 
        del_timer(&self->watchdog_timer);
 
@@ -244,8 +244,8 @@ void iriap_close(struct iriap_cb *self)
 
        IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
-       ASSERT(self != NULL, return;);
-       ASSERT(self->magic == IAS_MAGIC, return;);
+       IRDA_ASSERT(self != NULL, return;);
+       IRDA_ASSERT(self->magic == IAS_MAGIC, return;);
 
        if (self->lsap) {
                irlmp_close_lsap(self->lsap);
@@ -253,7 +253,7 @@ void iriap_close(struct iriap_cb *self)
        }
 
        entry = (struct iriap_cb *) hashbin_remove(iriap, (long) self, NULL);
-       ASSERT(entry == self, return;);
+       IRDA_ASSERT(entry == self, return;);
 
        __iriap_close(self);
 }
@@ -278,7 +278,7 @@ static int iriap_register_lsap(struct iriap_cb *self, __u8 slsap_sel, int mode)
 
        self->lsap = irlmp_open_lsap(slsap_sel, &notify, 0);
        if (self->lsap == NULL) {
-               ERROR("%s: Unable to allocated LSAP!\n", __FUNCTION__);
+               IRDA_ERROR("%s: Unable to allocated LSAP!\n", __FUNCTION__);
                return -1;
        }
        self->slsap_sel = self->lsap->slsap_sel;
@@ -302,10 +302,10 @@ static void iriap_disconnect_indication(void *instance, void *sap,
 
        self = (struct iriap_cb *) instance;
 
-       ASSERT(self != NULL, return;);
-       ASSERT(self->magic == IAS_MAGIC, return;);
+       IRDA_ASSERT(self != NULL, return;);
+       IRDA_ASSERT(self->magic == IAS_MAGIC, return;);
 
-       ASSERT(iriap != NULL, return;);
+       IRDA_ASSERT(iriap != NULL, return;);
 
        del_timer(&self->watchdog_timer);
 
@@ -343,8 +343,8 @@ static void iriap_disconnect_request(struct iriap_cb *self)
 
        IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
-       ASSERT(self != NULL, return;);
-       ASSERT(self->magic == IAS_MAGIC, return;);
+       IRDA_ASSERT(self != NULL, return;);
+       IRDA_ASSERT(self->magic == IAS_MAGIC, return;);
 
        tx_skb = dev_alloc_skb(64);
        if (tx_skb == NULL) {
@@ -375,8 +375,8 @@ int iriap_getvaluebyclass_request(struct iriap_cb *self,
        int name_len, attr_len, skb_len;
        __u8 *frame;
 
-       ASSERT(self != NULL, return -1;);
-       ASSERT(self->magic == IAS_MAGIC, return -1;);
+       IRDA_ASSERT(self != NULL, return -1;);
+       IRDA_ASSERT(self->magic == IAS_MAGIC, return -1;);
 
        /* Client must supply the destination device address */
        if (!daddr)
@@ -442,9 +442,9 @@ static void iriap_getvaluebyclass_confirm(struct iriap_cb *self,
        __u8 *fp;
        int n;
 
-       ASSERT(self != NULL, return;);
-       ASSERT(self->magic == IAS_MAGIC, return;);
-       ASSERT(skb != NULL, return;);
+       IRDA_ASSERT(self != NULL, return;);
+       IRDA_ASSERT(self->magic == IAS_MAGIC, return;);
+       IRDA_ASSERT(skb != NULL, return;);
 
        /* Initialize variables */
        fp = skb->data;
@@ -549,10 +549,10 @@ static void iriap_getvaluebyclass_response(struct iriap_cb *self,
 
        IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
-       ASSERT(self != NULL, return;);
-       ASSERT(self->magic == IAS_MAGIC, return;);
-       ASSERT(value != NULL, return;);
-       ASSERT(value->len <= 1024, return;);
+       IRDA_ASSERT(self != NULL, return;);
+       IRDA_ASSERT(self->magic == IAS_MAGIC, return;);
+       IRDA_ASSERT(value != NULL, return;);
+       IRDA_ASSERT(value->len <= 1024, return;);
 
        /* Initialize variables */
        n = 0;
@@ -642,9 +642,9 @@ static void iriap_getvaluebyclass_indication(struct iriap_cb *self,
 
        IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
-       ASSERT(self != NULL, return;);
-       ASSERT(self->magic == IAS_MAGIC, return;);
-       ASSERT(skb != NULL, return;);
+       IRDA_ASSERT(self != NULL, return;);
+       IRDA_ASSERT(self->magic == IAS_MAGIC, return;);
+       IRDA_ASSERT(skb != NULL, return;);
 
        fp = skb->data;
        n = 1;
@@ -697,8 +697,8 @@ void iriap_send_ack(struct iriap_cb *self)
 
        IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
 
-       ASSERT(self != NULL, return;);
-       ASSERT(self->magic == IAS_MAGIC, return;);
+       IRDA_ASSERT(self != NULL, return;);
+       IRDA_ASSERT(self->magic == IAS_MAGIC, return;);
 
        tx_skb = dev_alloc_skb(64);
        if (!tx_skb)
@@ -719,8 +719,8 @@ void iriap_connect_request(struct iriap_cb *self)
 {
        int ret;
 
-       ASSERT(self != NULL, return;);
-       ASSERT(self->magic == IAS_MAGIC, return;);
+       IRDA_ASSERT(self != NULL, return;);
+       IRDA_ASSERT(self->magic == IAS_MAGIC, return;);
 
        ret = irlmp_connect_request(self->lsap, LSAP_IAS,
                                    self->saddr, self->daddr,
@@ -746,9 +746,9 @@ static void iriap_connect_confirm(void *instance, void *sap,
 
        self = (struct iriap_cb *) instance;
 
-       ASSERT(self != NULL, return;);
-       ASSERT(self->magic == IAS_MAGIC, return;);
-       ASSERT(skb != NULL, return;);
+       IRDA_ASSERT(self != NULL, return;);
+       IRDA_ASSERT(self->magic == IAS_MAGIC, return;);
+       IRDA_ASSERT(skb != NULL, return;);
 
        self->max_data_size = max_seg_size;
        self->max_header_size = max_header_size;
@@ -778,9 +778,9 @@ static void iriap_connect_indication(void *instance, void *sap,
 
        self = (struct iriap_cb *) instance;
 
-       ASSERT(skb != NULL, return;);
-       ASSERT(self != NULL, goto out;);
-       ASSERT(self->magic == IAS_MAGIC, goto out;);
+       IRDA_ASSERT(skb != NULL, return;);
+       IRDA_ASSERT(self != NULL, goto out;);
+       IRDA_ASSERT(self->magic == IAS_MAGIC, goto out;);
 
        /* Start new server */
        new = iriap_open(LSAP_IAS, IAS_SERVER, NULL, NULL);
@@ -826,9 +826,9 @@ static int iriap_data_indication(void *instance, void *sap,
 
        self = (struct iriap_cb *) instance;
 
-       ASSERT(skb != NULL, return 0;);
-       ASSERT(self != NULL, goto out;);
-       ASSERT(self->magic == IAS_MAGIC, goto out;);
+       IRDA_ASSERT(skb != NULL, return 0;);
+       IRDA_ASSERT(self != NULL, goto out;);
+       IRDA_ASSERT(self->magic == IAS_MAGIC, goto out;);
 
        frame = skb->data;
 
@@ -840,8 +840,9 @@ static int iriap_data_indication(void *instance, void *sap,
        }
        opcode = frame[0];
        if (~opcode & IAP_LST) {
-               WARNING("%s:, IrIAS multiframe commands or "
-                       "results is not implemented yet!\n", __FUNCTION__);
+               IRDA_WARNING("%s:, IrIAS multiframe commands or "
+                            "results is not implemented yet!\n",
+                            __FUNCTION__);
                goto out;
        }
 
@@ -917,24 +918,24 @@ void iriap_call_indication(struct iriap_cb *self, struct sk_buff *skb)
 
        IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
-       ASSERT(self != NULL, return;);
-       ASSERT(self->magic == IAS_MAGIC, return;);
-       ASSERT(skb != NULL, return;);
+       IRDA_ASSERT(self != NULL, return;);
+       IRDA_ASSERT(self->magic == IAS_MAGIC, return;);
+       IRDA_ASSERT(skb != NULL, return;);
 
        fp = skb->data;
 
        opcode = fp[0];
        if (~opcode & 0x80) {
-               WARNING("%s: IrIAS multiframe commands or results"
-                       "is not implemented yet!\n", __FUNCTION__);
+               IRDA_WARNING("%s: IrIAS multiframe commands or results"
+                            "is not implemented yet!\n", __FUNCTION__);
                return;
        }
        opcode &= 0x7f; /* Mask away LST bit */
 
        switch (opcode) {
        case GET_INFO_BASE:
-               WARNING("%s: GetInfoBaseDetails not implemented yet!\n",
-                               __FUNCTION__);
+               IRDA_WARNING("%s: GetInfoBaseDetails not implemented yet!\n",
+                            __FUNCTION__);
                break;
        case GET_VALUE_BY_CLASS:
                iriap_getvaluebyclass_indication(self, skb);
@@ -953,8 +954,8 @@ static void iriap_watchdog_timer_expired(void *data)
 {
        struct iriap_cb *self = (struct iriap_cb *) data;
 
-       ASSERT(self != NULL, return;);
-       ASSERT(self->magic == IAS_MAGIC, return;);
+       IRDA_ASSERT(self != NULL, return;);
+       IRDA_ASSERT(self->magic == IAS_MAGIC, return;);
 
        /* iriap_close(self); */
 }
@@ -1010,7 +1011,7 @@ static int irias_seq_show(struct seq_file *seq, void *v)
                struct ias_object *obj = v;
                struct ias_attrib *attrib;
 
-               ASSERT(obj->magic == IAS_OBJECT_MAGIC, return -EINVAL;);
+               IRDA_ASSERT(obj->magic == IAS_OBJECT_MAGIC, return -EINVAL;);
 
                seq_printf(seq, "name: %s, id=%d\n",
                           obj->name, obj->id);
@@ -1025,7 +1026,8 @@ static int irias_seq_show(struct seq_file *seq, void *v)
                     attrib != NULL;
                     attrib = (struct ias_attrib *) hashbin_get_next(obj->attribs)) {
                     
-                       ASSERT(attrib->magic == IAS_ATTRIB_MAGIC, break; );
+                       IRDA_ASSERT(attrib->magic == IAS_ATTRIB_MAGIC,
+                                   goto outloop; );
 
                        seq_printf(seq, " - Attribute name: \"%s\", ",
                                   attrib->name);
@@ -1055,6 +1057,7 @@ static int irias_seq_show(struct seq_file *seq, void *v)
                        seq_putc(seq, '\n');
 
                }
+       IRDA_ASSERT_LABEL(outloop:)
                spin_unlock(&obj->attribs->hb_spinlock);
        }
 
@@ -1070,7 +1073,7 @@ static struct seq_operations irias_seq_ops = {
 
 static int irias_seq_open(struct inode *inode, struct file *file)
 {
-       ASSERT( irias_objects != NULL, return -EINVAL;);
+       IRDA_ASSERT( irias_objects != NULL, return -EINVAL;);
 
        return seq_open(file, &irias_seq_ops);
 }