]> git.hungrycats.org Git - linux/commitdiff
[PATCH] sparse: NULL noise in drivers/isdn
authorAlexander Viro <viro@www.linux.org.uk>
Mon, 12 Jul 2004 02:08:24 +0000 (19:08 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Mon, 12 Jul 2004 02:08:24 +0000 (19:08 -0700)
37 files changed:
drivers/isdn/capi/capi.c
drivers/isdn/capi/capidrv.c
drivers/isdn/capi/capilib.c
drivers/isdn/capi/capiutil.c
drivers/isdn/capi/kcapi.c
drivers/isdn/capi/kcapi_proc.c
drivers/isdn/hardware/eicon/capifunc.c
drivers/isdn/hardware/eicon/capimain.c
drivers/isdn/hardware/eicon/dadapter.c
drivers/isdn/hardware/eicon/debug.c
drivers/isdn/hardware/eicon/di.c
drivers/isdn/hardware/eicon/diddfunc.c
drivers/isdn/hardware/eicon/diva.c
drivers/isdn/hardware/eicon/diva_dma.c
drivers/isdn/hardware/eicon/divamnt.c
drivers/isdn/hardware/eicon/divasfunc.c
drivers/isdn/hardware/eicon/divasmain.c
drivers/isdn/hardware/eicon/dqueue.c
drivers/isdn/hardware/eicon/idifunc.c
drivers/isdn/hardware/eicon/maintidi.c
drivers/isdn/hardware/eicon/message.c
drivers/isdn/hardware/eicon/mntfunc.c
drivers/isdn/hardware/eicon/os_4bri.c
drivers/isdn/hardware/eicon/os_bri.c
drivers/isdn/hardware/eicon/os_pri.c
drivers/isdn/hardware/eicon/um_idi.c
drivers/isdn/hisax/config.c
drivers/isdn/hisax/diva.c
drivers/isdn/hisax/elsa_ser.c
drivers/isdn/hisax/hfc_usb.c
drivers/isdn/hisax/tei.c
drivers/isdn/i4l/isdn_common.c
drivers/isdn/i4l/isdn_net.c
drivers/isdn/i4l/isdn_tty.c
drivers/isdn/pcbit/module.c
drivers/isdn/sc/command.c
drivers/isdn/sc/ioctl.c

index 53c0acf229c71ce1070f0cbd4f94b852df5c50be..da9799450e15ef989cda79a2b910b10ce1716e60 100644 (file)
@@ -162,7 +162,7 @@ static int capincci_add_ack(struct capiminor *mp, u16 datahandle)
           printk(KERN_ERR "capi: alloc datahandle failed\n");
           return -1;
        }
-       n->next = 0;
+       n->next = NULL;
        n->datahandle = datahandle;
        for (pp = &mp->ackqueue; *pp; pp = &(*pp)->next) ;
        *pp = n;
@@ -211,7 +211,7 @@ static struct capiminor *capiminor_alloc(struct capi20_appl *ap, u32 ncci)
        mp = kmalloc(sizeof(*mp), GFP_ATOMIC);
        if (!mp) {
                printk(KERN_ERR "capi: can't alloc capiminor\n");
-               return 0;
+               return NULL;
        }
 
        memset(mp, 0, sizeof(struct capiminor));
@@ -245,7 +245,7 @@ static struct capiminor *capiminor_alloc(struct capi20_appl *ap, u32 ncci)
        if (!(minor < capi_ttyminors)) {
                printk(KERN_NOTICE "capi: out of minors\n");
                        kfree(mp);
-               return 0;
+               return NULL;
        }
 
        return mp;
@@ -260,7 +260,7 @@ static void capiminor_free(struct capiminor *mp)
        write_unlock_irqrestore(&capiminor_list_lock, flags);
 
        if (mp->ttyskb) kfree_skb(mp->ttyskb);
-       mp->ttyskb = 0;
+       mp->ttyskb = NULL;
        skb_queue_purge(&mp->inqueue);
        skb_queue_purge(&mp->outqueue);
        capiminor_del_all_ack(mp);
@@ -292,17 +292,17 @@ static struct capincci *capincci_alloc(struct capidev *cdev, u32 ncci)
 {
        struct capincci *np, **pp;
 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
-       struct capiminor *mp = 0;
+       struct capiminor *mp = NULL;
 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
 
        np = kmalloc(sizeof(*np), GFP_ATOMIC);
        if (!np)
-               return 0;
+               return NULL;
        memset(np, 0, sizeof(struct capincci));
        np->ncci = ncci;
        np->cdev = cdev;
 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
-       mp = 0;
+       mp = NULL;
        if (cdev->userflags & CAPIFLAG_HIGHJACKING)
                mp = np->minorp = capiminor_alloc(&cdev->ap, ncci);
        if (mp) {
@@ -339,7 +339,7 @@ static void capincci_free(struct capidev *cdev, u32 ncci)
                                capifs_free_ncci(mp->minor);
 #endif
                                if (mp->tty) {
-                                       mp->nccip = 0;
+                                       mp->nccip = NULL;
 #ifdef _DEBUG_REFCOUNT
                                        printk(KERN_DEBUG "reset mp->nccip\n");
 #endif
@@ -377,7 +377,7 @@ static struct capidev *capidev_alloc(void)
 
        cdev = kmalloc(sizeof(*cdev), GFP_KERNEL);
        if (!cdev)
-               return 0;
+               return NULL;
        memset(cdev, 0, sizeof(struct capidev));
 
        init_MUTEX(&cdev->ncci_list_sem);
@@ -473,7 +473,7 @@ static int handle_recv_skb(struct capiminor *mp, struct sk_buff *skb)
                printk(KERN_DEBUG "capi: DATA_B3_RESP %u len=%d => ldisc\n",
                                        datahandle, skb->len);
 #endif
-               mp->tty->ldisc.receive_buf(mp->tty, skb->data, 0, skb->len);
+               mp->tty->ldisc.receive_buf(mp->tty, skb->data, NULL, skb->len);
                kfree_skb(skb);
                return 0;
 
@@ -1026,8 +1026,8 @@ static void capinc_tty_close(struct tty_struct * tty, struct file * file)
 #ifdef _DEBUG_REFCOUNT
                        printk(KERN_DEBUG "capinc_tty_close lastclose\n");
 #endif
-                       tty->driver_data = (void *)0;
-                       mp->tty = 0;
+                       tty->driver_data = NULL;
+                       mp->tty = NULL;
                }
 #ifdef _DEBUG_REFCOUNT
                printk(KERN_DEBUG "capinc_tty_close ocount=%d\n", atomic_read(&mp->ttyopencount));
@@ -1062,7 +1062,7 @@ static int capinc_tty_write(struct tty_struct * tty, int from_user,
 
        skb = mp->ttyskb;
        if (skb) {
-               mp->ttyskb = 0;
+               mp->ttyskb = NULL;
                skb_queue_tail(&mp->outqueue, skb);
                mp->outbytes += skb->len;
        }
@@ -1075,7 +1075,8 @@ static int capinc_tty_write(struct tty_struct * tty, int from_user,
 
        skb_reserve(skb, CAPI_DATA_B3_REQ_LEN);
        if (from_user) {
-               if ((retval = copy_from_user(skb_put(skb, count), buf, count))) {
+               retval = copy_from_user(skb_put(skb, count), buf, count);
+               if (retval) {
                        kfree_skb(skb);
 #ifdef _DEBUG_TTYFUNCS
                        printk(KERN_DEBUG "capinc_tty_write: copy_from_user=%d\n", retval);
@@ -1115,7 +1116,7 @@ static void capinc_tty_put_char(struct tty_struct *tty, unsigned char ch)
                        *(skb_put(skb, 1)) = ch;
                        return;
                }
-               mp->ttyskb = 0;
+               mp->ttyskb = NULL;
                skb_queue_tail(&mp->outqueue, skb);
                mp->outbytes += skb->len;
                (void)handle_minor_send(mp);
@@ -1148,7 +1149,7 @@ static void capinc_tty_flush_chars(struct tty_struct *tty)
 
        skb = mp->ttyskb;
        if (skb) {
-               mp->ttyskb = 0;
+               mp->ttyskb = NULL;
                skb_queue_tail(&mp->outqueue, skb);
                mp->outbytes += skb->len;
                (void)handle_minor_send(mp);
@@ -1466,7 +1467,7 @@ static void __init proc_init(void)
 
     for (i=0; i < nelem; i++) {
         struct procfsentries *p = procfsentries + i;
-       p->procent = create_proc_entry(p->name, p->mode, 0);
+       p->procent = create_proc_entry(p->name, p->mode, NULL);
        if (p->procent) p->procent->read_proc = p->read_proc;
     }
 }
@@ -1479,8 +1480,8 @@ static void __exit proc_exit(void)
     for (i=nelem-1; i >= 0; i--) {
         struct procfsentries *p = procfsentries + i;
        if (p->procent) {
-          remove_proc_entry(p->name, 0);
-          p->procent = 0;
+          remove_proc_entry(p->name, NULL);
+          p->procent = NULL;
        }
     }
 }
index 36ee8c2d0492b8047ed9f0556fcce52d0d7cdb29..b0a223ddb581341a94fda0d2b9e17c4bedf77ae4 100644 (file)
@@ -230,7 +230,7 @@ static _cstruct b1config(int l2, int l3)
        case ISDN_PROTO_L2_HDLC:
        case ISDN_PROTO_L2_TRANS:
        default:
-               return 0;
+               return NULL;
         case ISDN_PROTO_L2_V11096:
            return b1config_async_v110(9600);
         case ISDN_PROTO_L2_V11019:
@@ -336,7 +336,7 @@ static capidrv_plci *new_plci(capidrv_contr * card, int chan)
        plcip = (capidrv_plci *) kmalloc(sizeof(capidrv_plci), GFP_ATOMIC);
 
        if (plcip == 0)
-               return 0;
+               return NULL;
 
        memset(plcip, 0, sizeof(capidrv_plci));
        plcip->state = ST_PLCI_NONE;
@@ -356,7 +356,7 @@ static capidrv_plci *find_plci_by_plci(capidrv_contr * card, u32 plci)
        for (p = card->plci_list; p; p = p->next)
                if (p->plci == plci)
                        return p;
-       return 0;
+       return NULL;
 }
 
 static capidrv_plci *find_plci_by_msgid(capidrv_contr * card, u16 msgid)
@@ -365,7 +365,7 @@ static capidrv_plci *find_plci_by_msgid(capidrv_contr * card, u16 msgid)
        for (p = card->plci_list; p; p = p->next)
                if (p->msgid == msgid)
                        return p;
-       return 0;
+       return NULL;
 }
 
 static capidrv_plci *find_plci_by_ncci(capidrv_contr * card, u32 ncci)
@@ -374,7 +374,7 @@ static capidrv_plci *find_plci_by_ncci(capidrv_contr * card, u32 ncci)
        for (p = card->plci_list; p; p = p->next)
                if (p->plci == (ncci & 0xffff))
                        return p;
-       return 0;
+       return NULL;
 }
 
 static void free_plci(capidrv_contr * card, capidrv_plci * plcip)
@@ -384,7 +384,7 @@ static void free_plci(capidrv_contr * card, capidrv_plci * plcip)
        for (pp = &card->plci_list; *pp; pp = &(*pp)->next) {
                if (*pp == plcip) {
                        *pp = (*pp)->next;
-                       card->bchans[plcip->chan].plcip = 0;
+                       card->bchans[plcip->chan].plcip = NULL;
                        card->bchans[plcip->chan].disconnecting = 0;
                        card->bchans[plcip->chan].incoming = 0;
                        kfree(plcip);
@@ -406,7 +406,7 @@ static inline capidrv_ncci *new_ncci(capidrv_contr * card,
        nccip = (capidrv_ncci *) kmalloc(sizeof(capidrv_ncci), GFP_ATOMIC);
 
        if (nccip == 0)
-               return 0;
+               return NULL;
 
        memset(nccip, 0, sizeof(capidrv_ncci));
        nccip->ncci = ncci;
@@ -429,12 +429,12 @@ static inline capidrv_ncci *find_ncci(capidrv_contr * card, u32 ncci)
        capidrv_ncci *p;
 
        if ((plcip = find_plci_by_ncci(card, ncci)) == 0)
-               return 0;
+               return NULL;
 
        for (p = plcip->ncci_list; p; p = p->next)
                if (p->ncci == ncci)
                        return p;
-       return 0;
+       return NULL;
 }
 
 static inline capidrv_ncci *find_ncci_by_msgid(capidrv_contr * card,
@@ -444,12 +444,12 @@ static inline capidrv_ncci *find_ncci_by_msgid(capidrv_contr * card,
        capidrv_ncci *p;
 
        if ((plcip = find_plci_by_ncci(card, ncci)) == 0)
-               return 0;
+               return NULL;
 
        for (p = plcip->ncci_list; p; p = p->next)
                if (p->msgid == msgid)
                        return p;
-       return 0;
+       return NULL;
 }
 
 static void free_ncci(capidrv_contr * card, struct capidrv_ncci *nccip)
@@ -462,7 +462,7 @@ static void free_ncci(capidrv_contr * card, struct capidrv_ncci *nccip)
                        break;
                }
        }
-       card->bchans[nccip->chan].nccip = 0;
+       card->bchans[nccip->chan].nccip = NULL;
        kfree(nccip);
 }
 
@@ -477,7 +477,7 @@ static int capidrv_add_ack(struct capidrv_ncci *nccip,
           printk(KERN_ERR "capidrv: kmalloc ncci_datahandle failed\n");
           return -1;
        }
-       n->next = 0;
+       n->next = NULL;
        n->datahandle = datahandle;
        n->len = len;
        for (pp = &nccip->ackqueue; *pp; pp = &(*pp)->next) ;
@@ -560,7 +560,7 @@ static void p0(capidrv_contr * card, capidrv_plci * plci)
 {
        isdn_ctrl cmd;
 
-       card->bchans[plci->chan].contr = 0;
+       card->bchans[plci->chan].contr = NULL;
        cmd.command = ISDN_STAT_DHUP;
        cmd.driver = card->myid;
        cmd.arg = plci->chan;
@@ -580,54 +580,54 @@ struct plcistatechange {
 static struct plcistatechange plcitable[] =
 {
   /* P-0 */
-  {ST_PLCI_NONE, ST_PLCI_OUTGOING, EV_PLCI_CONNECT_REQ, 0},
-  {ST_PLCI_NONE, ST_PLCI_ALLOCATED, EV_PLCI_FACILITY_IND_UP, 0},
-  {ST_PLCI_NONE, ST_PLCI_INCOMING, EV_PLCI_CONNECT_IND, 0},
-  {ST_PLCI_NONE, ST_PLCI_RESUMEING, EV_PLCI_RESUME_REQ, 0},
+  {ST_PLCI_NONE, ST_PLCI_OUTGOING, EV_PLCI_CONNECT_REQ, NULL},
+  {ST_PLCI_NONE, ST_PLCI_ALLOCATED, EV_PLCI_FACILITY_IND_UP, NULL},
+  {ST_PLCI_NONE, ST_PLCI_INCOMING, EV_PLCI_CONNECT_IND, NULL},
+  {ST_PLCI_NONE, ST_PLCI_RESUMEING, EV_PLCI_RESUME_REQ, NULL},
   /* P-0.1 */
   {ST_PLCI_OUTGOING, ST_PLCI_NONE, EV_PLCI_CONNECT_CONF_ERROR, p0},
-  {ST_PLCI_OUTGOING, ST_PLCI_ALLOCATED, EV_PLCI_CONNECT_CONF_OK, 0},
+  {ST_PLCI_OUTGOING, ST_PLCI_ALLOCATED, EV_PLCI_CONNECT_CONF_OK, NULL},
   /* P-1 */
-  {ST_PLCI_ALLOCATED, ST_PLCI_ACTIVE, EV_PLCI_CONNECT_ACTIVE_IND, 0},
-  {ST_PLCI_ALLOCATED, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, 0},
-  {ST_PLCI_ALLOCATED, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, 0},
-  {ST_PLCI_ALLOCATED, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, 0},
+  {ST_PLCI_ALLOCATED, ST_PLCI_ACTIVE, EV_PLCI_CONNECT_ACTIVE_IND, NULL},
+  {ST_PLCI_ALLOCATED, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, NULL},
+  {ST_PLCI_ALLOCATED, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, NULL},
+  {ST_PLCI_ALLOCATED, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL},
   /* P-ACT */
-  {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, 0},
-  {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, 0},
-  {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, 0},
-  {ST_PLCI_ACTIVE, ST_PLCI_HELD, EV_PLCI_HOLD_IND, 0},
-  {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTING, EV_PLCI_SUSPEND_IND, 0},
+  {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, NULL},
+  {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, NULL},
+  {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL},
+  {ST_PLCI_ACTIVE, ST_PLCI_HELD, EV_PLCI_HOLD_IND, NULL},
+  {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTING, EV_PLCI_SUSPEND_IND, NULL},
   /* P-2 */
-  {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_CONNECT_REJECT, 0},
-  {ST_PLCI_INCOMING, ST_PLCI_FACILITY_IND, EV_PLCI_FACILITY_IND_UP, 0},
-  {ST_PLCI_INCOMING, ST_PLCI_ACCEPTING, EV_PLCI_CONNECT_RESP, 0},
-  {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, 0},
-  {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, 0},
-  {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, 0},
-  {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_CD_IND, 0},
+  {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_CONNECT_REJECT, NULL},
+  {ST_PLCI_INCOMING, ST_PLCI_FACILITY_IND, EV_PLCI_FACILITY_IND_UP, NULL},
+  {ST_PLCI_INCOMING, ST_PLCI_ACCEPTING, EV_PLCI_CONNECT_RESP, NULL},
+  {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, NULL},
+  {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, NULL},
+  {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL},
+  {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_CD_IND, NULL},
   /* P-3 */
-  {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTING, EV_PLCI_CONNECT_REJECT, 0},
-  {ST_PLCI_FACILITY_IND, ST_PLCI_ACCEPTING, EV_PLCI_CONNECT_ACTIVE_IND, 0},
-  {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, 0},
-  {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, 0},
-  {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, 0},
+  {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTING, EV_PLCI_CONNECT_REJECT, NULL},
+  {ST_PLCI_FACILITY_IND, ST_PLCI_ACCEPTING, EV_PLCI_CONNECT_ACTIVE_IND, NULL},
+  {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, NULL},
+  {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, NULL},
+  {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL},
   /* P-4 */
-  {ST_PLCI_ACCEPTING, ST_PLCI_ACTIVE, EV_PLCI_CONNECT_ACTIVE_IND, 0},
-  {ST_PLCI_ACCEPTING, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, 0},
-  {ST_PLCI_ACCEPTING, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, 0},
-  {ST_PLCI_ACCEPTING, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, 0},
+  {ST_PLCI_ACCEPTING, ST_PLCI_ACTIVE, EV_PLCI_CONNECT_ACTIVE_IND, NULL},
+  {ST_PLCI_ACCEPTING, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, NULL},
+  {ST_PLCI_ACCEPTING, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, NULL},
+  {ST_PLCI_ACCEPTING, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL},
   /* P-5 */
-  {ST_PLCI_DISCONNECTING, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, 0},
+  {ST_PLCI_DISCONNECTING, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL},
   /* P-6 */
   {ST_PLCI_DISCONNECTED, ST_PLCI_NONE, EV_PLCI_DISCONNECT_RESP, p0},
   /* P-0.Res */
   {ST_PLCI_RESUMEING, ST_PLCI_NONE, EV_PLCI_RESUME_CONF_ERROR, p0},
-  {ST_PLCI_RESUMEING, ST_PLCI_RESUME, EV_PLCI_RESUME_CONF_OK, 0},
+  {ST_PLCI_RESUMEING, ST_PLCI_RESUME, EV_PLCI_RESUME_CONF_OK, NULL},
   /* P-RES */
-  {ST_PLCI_RESUME, ST_PLCI_ACTIVE, EV_PLCI_RESUME_IND, 0},
+  {ST_PLCI_RESUME, ST_PLCI_ACTIVE, EV_PLCI_RESUME_IND, NULL},
   /* P-HELD */
-  {ST_PLCI_HELD, ST_PLCI_ACTIVE, EV_PLCI_RETRIEVE_IND, 0},
+  {ST_PLCI_HELD, ST_PLCI_ACTIVE, EV_PLCI_RETRIEVE_IND, NULL},
   {},
 };
 
@@ -662,10 +662,10 @@ static void n0(capidrv_contr * card, capidrv_ncci * ncci)
                                 global.ap.applid,
                                 card->msgid++,
                                 ncci->plcip->plci,
-                                0,     /* BChannelinformation */
-                                0,     /* Keypadfacility */
-                                0,     /* Useruserdata */   /* $$$$ */
-                                0      /* Facilitydataarray */
+                                NULL,  /* BChannelinformation */
+                                NULL,  /* Keypadfacility */
+                                NULL,  /* Useruserdata */   /* $$$$ */
+                                NULL   /* Facilitydataarray */
        );
        send_message(card, &cmsg);
        plci_change_state(card, ncci->plcip, EV_PLCI_DISCONNECT_REQ);
@@ -689,32 +689,32 @@ struct nccistatechange {
 static struct nccistatechange nccitable[] =
 {
   /* N-0 */
-  {ST_NCCI_NONE, ST_NCCI_OUTGOING, EV_NCCI_CONNECT_B3_REQ, 0},
-  {ST_NCCI_NONE, ST_NCCI_INCOMING, EV_NCCI_CONNECT_B3_IND, 0},
+  {ST_NCCI_NONE, ST_NCCI_OUTGOING, EV_NCCI_CONNECT_B3_REQ, NULL},
+  {ST_NCCI_NONE, ST_NCCI_INCOMING, EV_NCCI_CONNECT_B3_IND, NULL},
   /* N-0.1 */
-  {ST_NCCI_OUTGOING, ST_NCCI_ALLOCATED, EV_NCCI_CONNECT_B3_CONF_OK, 0},
+  {ST_NCCI_OUTGOING, ST_NCCI_ALLOCATED, EV_NCCI_CONNECT_B3_CONF_OK, NULL},
   {ST_NCCI_OUTGOING, ST_NCCI_NONE, EV_NCCI_CONNECT_B3_CONF_ERROR, n0},
   /* N-1 */
-  {ST_NCCI_INCOMING, ST_NCCI_DISCONNECTING, EV_NCCI_CONNECT_B3_REJECT, 0},
-  {ST_NCCI_INCOMING, ST_NCCI_ALLOCATED, EV_NCCI_CONNECT_B3_RESP, 0},
-  {ST_NCCI_INCOMING, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, 0},
-  {ST_NCCI_INCOMING, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, 0},
+  {ST_NCCI_INCOMING, ST_NCCI_DISCONNECTING, EV_NCCI_CONNECT_B3_REJECT, NULL},
+  {ST_NCCI_INCOMING, ST_NCCI_ALLOCATED, EV_NCCI_CONNECT_B3_RESP, NULL},
+  {ST_NCCI_INCOMING, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, NULL},
+  {ST_NCCI_INCOMING, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, NULL},
   /* N-2 */
-  {ST_NCCI_ALLOCATED, ST_NCCI_ACTIVE, EV_NCCI_CONNECT_B3_ACTIVE_IND, 0},
-  {ST_NCCI_ALLOCATED, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, 0},
-  {ST_NCCI_ALLOCATED, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, 0},
+  {ST_NCCI_ALLOCATED, ST_NCCI_ACTIVE, EV_NCCI_CONNECT_B3_ACTIVE_IND, NULL},
+  {ST_NCCI_ALLOCATED, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, NULL},
+  {ST_NCCI_ALLOCATED, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, NULL},
   /* N-ACT */
-  {ST_NCCI_ACTIVE, ST_NCCI_ACTIVE, EV_NCCI_RESET_B3_IND, 0},
-  {ST_NCCI_ACTIVE, ST_NCCI_RESETING, EV_NCCI_RESET_B3_REQ, 0},
-  {ST_NCCI_ACTIVE, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, 0},
-  {ST_NCCI_ACTIVE, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, 0},
+  {ST_NCCI_ACTIVE, ST_NCCI_ACTIVE, EV_NCCI_RESET_B3_IND, NULL},
+  {ST_NCCI_ACTIVE, ST_NCCI_RESETING, EV_NCCI_RESET_B3_REQ, NULL},
+  {ST_NCCI_ACTIVE, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, NULL},
+  {ST_NCCI_ACTIVE, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, NULL},
   /* N-3 */
-  {ST_NCCI_RESETING, ST_NCCI_ACTIVE, EV_NCCI_RESET_B3_IND, 0},
-  {ST_NCCI_RESETING, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, 0},
-  {ST_NCCI_RESETING, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, 0},
+  {ST_NCCI_RESETING, ST_NCCI_ACTIVE, EV_NCCI_RESET_B3_IND, NULL},
+  {ST_NCCI_RESETING, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, NULL},
+  {ST_NCCI_RESETING, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, NULL},
   /* N-4 */
-  {ST_NCCI_DISCONNECTING, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, 0},
-  {ST_NCCI_DISCONNECTING, ST_NCCI_PREVIOUS, EV_NCCI_DISCONNECT_B3_CONF_ERROR,0},
+  {ST_NCCI_DISCONNECTING, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, NULL},
+  {ST_NCCI_DISCONNECTING, ST_NCCI_PREVIOUS, EV_NCCI_DISCONNECT_B3_CONF_ERROR,NULL},
   /* N-5 */
   {ST_NCCI_DISCONNECTED, ST_NCCI_NONE, EV_NCCI_DISCONNECT_B3_RESP, n0},
   {},
@@ -821,7 +821,7 @@ static void handle_controller(_cmsg * cmsg)
                goto ignored;
        case CAPI_MANUFACTURER_CONF:    /* Controller */
                if (cmsg->ManuID == 0x214D5641) {
-                  char *s = 0;
+                  char *s = NULL;
                   switch (cmsg->Class) {
                      case 0: break;
                      case 1: s = "unknown class"; break;
@@ -950,10 +950,10 @@ static void handle_incoming_call(capidrv_contr * card, _cmsg * cmsg)
                                            global.ap.applid,
                                            card->msgid++,
                                            plcip->plci,        /* adr */
-                                           0,  /* BChannelinformation */
-                                           0,  /* Keypadfacility */
-                                           0,  /* Useruserdata */
-                                           0   /* Facilitydataarray */
+                                           NULL,/* BChannelinformation */
+                                           NULL,/* Keypadfacility */
+                                           NULL,/* Useruserdata */
+                                           NULL /* Facilitydataarray */
                        );
                        plcip->msgid = cmsg->Messagenumber;
                        send_message(card, cmsg);
@@ -1090,7 +1090,7 @@ static void handle_plci(_cmsg * cmsg)
                                                 global.ap.applid,
                                                 card->msgid++,
                                                 plcip->plci,   /* adr */
-                                                0      /* NCPI */
+                                                NULL   /* NCPI */
                        );
                        nccip->msgid = cmsg->Messagenumber;
                        send_message(card, cmsg);
@@ -1208,7 +1208,7 @@ static void handle_ncci(_cmsg * cmsg)
                                                          card->msgid++,
                                                          nccip->ncci,  /* adr */
                                                          0,    /* Reject */
-                                                         0     /* NCPI */
+                                                         NULL  /* NCPI */
                                );
                                send_message(card, cmsg);
                                ncci_change_state(card, nccip, EV_NCCI_CONNECT_B3_RESP);
@@ -1226,7 +1226,7 @@ static void handle_ncci(_cmsg * cmsg)
                                          card->msgid++,
                                          cmsg->adr.adrNCCI,
                                          2,    /* Reject */
-                                         0     /* NCPI */
+                                         NULL  /* NCPI */
                );
                send_message(card, cmsg);
                break;
@@ -1624,22 +1624,22 @@ static int capidrv_command(isdn_ctrl * c, capidrv_contr * card)
                                          si2cip(bchan->si1, bchan->si2),       /* cipvalue */
                                              called,   /* CalledPartyNumber */
                                              calling,  /* CallingPartyNumber */
-                                             0,        /* CalledPartySubaddress */
-                                             0,        /* CallingPartySubaddress */
+                                             NULL,     /* CalledPartySubaddress */
+                                             NULL,     /* CallingPartySubaddress */
                                            b1prot(bchan->l2, bchan->l3),       /* B1protocol */
                                            b2prot(bchan->l2, bchan->l3),       /* B2protocol */
                                            b3prot(bchan->l2, bchan->l3),       /* B3protocol */
                                            b1config(bchan->l2, bchan->l3),     /* B1configuration */
-                                             0,        /* B2configuration */
-                                             0,        /* B3configuration */
-                                             0,        /* BC */
-                                             0,        /* LLC */
-                                             0,        /* HLC */
+                                             NULL,     /* B2configuration */
+                                             NULL,     /* B3configuration */
+                                             NULL,     /* BC */
+                                             NULL,     /* LLC */
+                                             NULL,     /* HLC */
                                              /* BChannelinformation */
                                              isleasedline ? AdditionalInfo : 0,
-                                             0,        /* Keypadfacility */
-                                             0,        /* Useruserdata */
-                                             0         /* Facilitydataarray */
+                                             NULL,     /* Keypadfacility */
+                                             NULL,     /* Useruserdata */
+                                             NULL      /* Facilitydataarray */
                            );
                        if ((plcip = new_plci(card, (c->arg % card->nbchan))) == 0) {
                                cmd.command = ISDN_STAT_DHUP;
@@ -1672,15 +1672,15 @@ static int capidrv_command(isdn_ctrl * c, capidrv_contr * card)
                                       b2prot(bchan->l2, bchan->l3),    /* B2protocol */
                                       b3prot(bchan->l2, bchan->l3),    /* B3protocol */
                                       b1config(bchan->l2, bchan->l3),  /* B1configuration */
-                                      0,       /* B2configuration */
-                                      0,       /* B3configuration */
-                                      0,       /* ConnectedNumber */
-                                      0,       /* ConnectedSubaddress */
-                                      0,       /* LLC */
-                                      0,       /* BChannelinformation */
-                                      0,       /* Keypadfacility */
-                                      0,       /* Useruserdata */
-                                      0        /* Facilitydataarray */
+                                      NULL,    /* B2configuration */
+                                      NULL,    /* B3configuration */
+                                      NULL,    /* ConnectedNumber */
+                                      NULL,    /* ConnectedSubaddress */
+                                      NULL,    /* LLC */
+                                      NULL,    /* BChannelinformation */
+                                      NULL,    /* Keypadfacility */
+                                      NULL,    /* Useruserdata */
+                                      NULL     /* Facilitydataarray */
                );
                capi_cmsg2message(&cmdcmsg, cmdcmsg.buf);
                plci_change_state(card, bchan->plcip, EV_PLCI_CONNECT_RESP);
@@ -1714,7 +1714,7 @@ static int capidrv_command(isdn_ctrl * c, capidrv_contr * card)
                                                    global.ap.applid,
                                                    card->msgid++,
                                                    bchan->nccip->ncci,
-                                                   0   /* NCPI */
+                                                   NULL        /* NCPI */
                        );
                        ncci_change_state(card, bchan->nccip, EV_NCCI_DISCONNECT_B3_REQ);
                        send_message(card, &cmdcmsg);
@@ -1735,10 +1735,10 @@ static int capidrv_command(isdn_ctrl * c, capidrv_contr * card)
                                                         global.ap.applid,
                                                         card->msgid++,
                                                      bchan->plcip->plci,
-                                                        0,     /* BChannelinformation */
-                                                        0,     /* Keypadfacility */
-                                                        0,     /* Useruserdata */
-                                                        0      /* Facilitydataarray */
+                                                        NULL,  /* BChannelinformation */
+                                                        NULL,  /* Keypadfacility */
+                                                        NULL,  /* Useruserdata */
+                                                        NULL   /* Facilitydataarray */
                                );
                                plci_change_state(card, bchan->plcip, EV_PLCI_DISCONNECT_REQ);
                                send_message(card, &cmdcmsg);
@@ -1977,7 +1977,7 @@ static void send_listen(capidrv_contr *card)
                             1 << 6,    /* Infomask */
                             card->cipmask,
                             card->cipmask2,
-                            0, 0);
+                            NULL, NULL);
        send_message(card, &cmdcmsg);
        listen_change_state(card, EV_LISTEN_REQ);
 }
@@ -2028,7 +2028,7 @@ static int capidrv_addcontr(u16 contr, struct capi_profile *profp)
        card->interface.maxbufsize = 2048;
        card->interface.command = if_command;
        card->interface.writebuf_skb = if_sendbuf;
-       card->interface.writecmd = 0;
+       card->interface.writecmd = NULL;
        card->interface.readstat = if_readstat;
        card->interface.features = ISDN_FEATURE_L2_HDLC |
                                   ISDN_FEATURE_L2_TRANS |
@@ -2141,7 +2141,7 @@ static int capidrv_delcontr(u16 contr)
                card->nbchan--;
        }
        kfree(card->bchans);
-       card->bchans = 0;
+       card->bchans = NULL;
 
        if (debugmode)
                printk(KERN_DEBUG "capidrv-%d: id=%d isdn unload\n",
@@ -2159,7 +2159,7 @@ static int capidrv_delcontr(u16 contr)
        for (pp = &global.contr_list; *pp; pp = &(*pp)->next) {
                if (*pp == card) {
                        *pp = (*pp)->next;
-                       card->next = 0;
+                       card->next = NULL;
                        global.ncontr--;
                        break;
                }
@@ -2228,7 +2228,7 @@ static void __init proc_init(void)
 
     for (i=0; i < nelem; i++) {
         struct procfsentries *p = procfsentries + i;
-       p->procent = create_proc_entry(p->name, p->mode, 0);
+       p->procent = create_proc_entry(p->name, p->mode, NULL);
        if (p->procent) p->procent->read_proc = p->read_proc;
     }
 }
@@ -2241,8 +2241,8 @@ static void __exit proc_exit(void)
     for (i=nelem-1; i >= 0; i--) {
         struct procfsentries *p = procfsentries + i;
        if (p->procent) {
-          remove_proc_entry(p->name, 0);
-          p->procent = 0;
+          remove_proc_entry(p->name, NULL);
+          p->procent = NULL;
        }
     }
 }
index 00d8795b9cc793a1c0ce3512b81b5df1a006bb91..68409d971e73a6c86aaf8f116f5eada1e75564c2 100644 (file)
@@ -30,8 +30,8 @@ struct capilib_ncci {
 static inline void mq_init(struct capilib_ncci * np)
 {
        u_int i;
-       np->msgidqueue = 0;
-       np->msgidlast = 0;
+       np->msgidqueue = NULL;
+       np->msgidlast = NULL;
        np->nmsg = 0;
        memset(np->msgidpool, 0, sizeof(np->msgidpool));
        np->msgidfree = &np->msgidpool[0];
@@ -48,7 +48,7 @@ static inline int mq_enqueue(struct capilib_ncci * np, u16 msgid)
                return 0;
        np->msgidfree = mq->next;
        mq->msgid = msgid;
-       mq->next = 0;
+       mq->next = NULL;
        if (np->msgidlast)
                np->msgidlast->next = mq;
        np->msgidlast = mq;
@@ -66,7 +66,7 @@ static inline int mq_dequeue(struct capilib_ncci * np, u16 msgid)
                        struct capilib_msgidqueue *mq = *pp;
                        *pp = mq->next;
                        if (mq == np->msgidlast)
-                               np->msgidlast = 0;
+                               np->msgidlast = NULL;
                        mq->next = np->msgidfree;
                        np->msgidfree = mq;
                        np->nmsg--;
index c26dec646a8760522f5d3c0d836659afe6f39eb8..e7cf6bc286a6fe8428fa1f89e271ac33aaf8aabf 100644 (file)
@@ -335,85 +335,54 @@ static _cdef cdef[] =
 
 static unsigned char *cpars[] =
 {
-    /*00 */ 0,
-    /*01 ALERT_REQ */ (unsigned char *) "\x03\x04\x0c\x27\x2f\x1c\x01\x01",
-    /*02 CONNECT_REQ */ (unsigned char *) "\x03\x14\x0e\x10\x0f\x11\x0d\x06\x08\x0a\x05\x07\x09\x01\x0b\x28\x22\x04\x0c\x27\x2f\x1c\x01\x01",
-    /*03 */ 0,
-    /*04 DISCONNECT_REQ */ (unsigned char *) "\x03\x04\x0c\x27\x2f\x1c\x01\x01",
-    /*05 LISTEN_REQ */ (unsigned char *) "\x03\x25\x12\x13\x10\x11\x01",
-    /*06 */ 0,
-    /*07 */ 0,
-    /*08 INFO_REQ */ (unsigned char *) "\x03\x0e\x04\x0c\x27\x2f\x1c\x01\x01",
-    /*09 FACILITY_REQ */ (unsigned char *) "\x03\x1f\x1e\x01",
-    /*0a SELECT_B_PROTOCOL_REQ */ (unsigned char *) "\x03\x0d\x06\x08\x0a\x05\x07\x09\x01\x01",
-    /*0b CONNECT_B3_REQ */ (unsigned char *) "\x03\x2b\x01",
-    /*0c */ 0,
-    /*0d DISCONNECT_B3_REQ */ (unsigned char *) "\x03\x2b\x01",
-    /*0e */ 0,
-    /*0f DATA_B3_REQ */ (unsigned char *) "\x03\x18\x1a\x19\x20\x01",
-    /*10 RESET_B3_REQ */ (unsigned char *) "\x03\x2b\x01",
-    /*11 */ 0,
-    /*12 */ 0,
-    /*13 ALERT_CONF */ (unsigned char *) "\x03\x23\x01",
-    /*14 CONNECT_CONF */ (unsigned char *) "\x03\x23\x01",
-    /*15 */ 0,
-    /*16 DISCONNECT_CONF */ (unsigned char *) "\x03\x23\x01",
-    /*17 LISTEN_CONF */ (unsigned char *) "\x03\x23\x01",
-    /*18 MANUFACTURER_REQ */ (unsigned char *) "\x03\x2a\x15\x21\x29\x01",
-    /*19 */ 0,
-    /*1a INFO_CONF */ (unsigned char *) "\x03\x23\x01",
-    /*1b FACILITY_CONF */ (unsigned char *) "\x03\x23\x1f\x1b\x01",
-    /*1c SELECT_B_PROTOCOL_CONF */ (unsigned char *) "\x03\x23\x01",
-    /*1d CONNECT_B3_CONF */ (unsigned char *) "\x03\x23\x01",
-    /*1e */ 0,
-    /*1f DISCONNECT_B3_CONF */ (unsigned char *) "\x03\x23\x01",
-    /*20 */ 0,
-    /*21 DATA_B3_CONF */ (unsigned char *) "\x03\x19\x23\x01",
-    /*22 RESET_B3_CONF */ (unsigned char *) "\x03\x23\x01",
-    /*23 */ 0,
-    /*24 */ 0,
-    /*25 */ 0,
-    /*26 CONNECT_IND */ (unsigned char *) "\x03\x14\x0e\x10\x0f\x11\x0b\x28\x22\x04\x0c\x27\x2f\x1c\x01\x01",
-    /*27 CONNECT_ACTIVE_IND */ (unsigned char *) "\x03\x16\x17\x28\x01",
-    /*28 DISCONNECT_IND */ (unsigned char *) "\x03\x2c\x01",
-    /*29 */ 0,
-    /*2a MANUFACTURER_CONF */ (unsigned char *) "\x03\x2a\x15\x21\x29\x01",
-    /*2b */ 0,
-    /*2c INFO_IND */ (unsigned char *) "\x03\x26\x24\x01",
-    /*2d FACILITY_IND */ (unsigned char *) "\x03\x1f\x1d\x01",
-    /*2e */ 0,
-    /*2f CONNECT_B3_IND */ (unsigned char *) "\x03\x2b\x01",
-    /*30 CONNECT_B3_ACTIVE_IND */ (unsigned char *) "\x03\x2b\x01",
-    /*31 DISCONNECT_B3_IND */ (unsigned char *) "\x03\x2d\x2b\x01",
-    /*32 */ 0,
-    /*33 DATA_B3_IND */ (unsigned char *) "\x03\x18\x1a\x19\x20\x01",
-    /*34 RESET_B3_IND */ (unsigned char *) "\x03\x2b\x01",
-    /*35 CONNECT_B3_T90_ACTIVE_IND */ (unsigned char *) "\x03\x2b\x01",
-    /*36 */ 0,
-    /*37 */ 0,
-    /*38 CONNECT_RESP */ (unsigned char *) "\x03\x2e\x0d\x06\x08\x0a\x05\x07\x09\x01\x16\x17\x28\x04\x0c\x27\x2f\x1c\x01\x01",
-    /*39 CONNECT_ACTIVE_RESP */ (unsigned char *) "\x03\x01",
-    /*3a DISCONNECT_RESP */ (unsigned char *) "\x03\x01",
-    /*3b */ 0,
-    /*3c MANUFACTURER_IND */ (unsigned char *) "\x03\x2a\x15\x21\x29\x01",
-    /*3d */ 0,
-    /*3e INFO_RESP */ (unsigned char *) "\x03\x01",
-    /*3f FACILITY_RESP */ (unsigned char *) "\x03\x1f\x01",
-    /*40 */ 0,
-    /*41 CONNECT_B3_RESP */ (unsigned char *) "\x03\x2e\x2b\x01",
-    /*42 CONNECT_B3_ACTIVE_RESP */ (unsigned char *) "\x03\x01",
-    /*43 DISCONNECT_B3_RESP */ (unsigned char *) "\x03\x01",
-    /*44 */ 0,
-    /*45 DATA_B3_RESP */ (unsigned char *) "\x03\x19\x01",
-    /*46 RESET_B3_RESP */ (unsigned char *) "\x03\x01",
-    /*47 CONNECT_B3_T90_ACTIVE_RESP */ (unsigned char *) "\x03\x01",
-    /*48 */ 0,
-    /*49 */ 0,
-    /*4a */ 0,
-    /*4b */ 0,
-    /*4c */ 0,
-    /*4d */ 0,
-    /*4e MANUFACTURER_RESP */ (unsigned char *) "\x03\x2a\x15\x21\x29\x01",
+    /* ALERT_REQ */ [0x01] = "\x03\x04\x0c\x27\x2f\x1c\x01\x01",
+    /* CONNECT_REQ */ [0x02] = "\x03\x14\x0e\x10\x0f\x11\x0d\x06\x08\x0a\x05\x07\x09\x01\x0b\x28\x22\x04\x0c\x27\x2f\x1c\x01\x01",
+    /* DISCONNECT_REQ */ [0x04] = "\x03\x04\x0c\x27\x2f\x1c\x01\x01",
+    /* LISTEN_REQ */ [0x05] = "\x03\x25\x12\x13\x10\x11\x01",
+    /* INFO_REQ */ [0x08] = "\x03\x0e\x04\x0c\x27\x2f\x1c\x01\x01",
+    /* FACILITY_REQ */ [0x09] = "\x03\x1f\x1e\x01",
+    /* SELECT_B_PROTOCOL_REQ */ [0x0a] = "\x03\x0d\x06\x08\x0a\x05\x07\x09\x01\x01",
+    /* CONNECT_B3_REQ */ [0x0b] = "\x03\x2b\x01",
+    /* DISCONNECT_B3_REQ */ [0x0d] = "\x03\x2b\x01",
+    /* DATA_B3_REQ */ [0x0f] = "\x03\x18\x1a\x19\x20\x01",
+    /* RESET_B3_REQ */ [0x10] = "\x03\x2b\x01",
+    /* ALERT_CONF */ [0x13] = "\x03\x23\x01",
+    /* CONNECT_CONF */ [0x14] = "\x03\x23\x01",
+    /* DISCONNECT_CONF */ [0x16] = "\x03\x23\x01",
+    /* LISTEN_CONF */ [0x17] = "\x03\x23\x01",
+    /* MANUFACTURER_REQ */ [0x18] = "\x03\x2a\x15\x21\x29\x01",
+    /* INFO_CONF */ [0x1a] = "\x03\x23\x01",
+    /* FACILITY_CONF */ [0x1b] = "\x03\x23\x1f\x1b\x01",
+    /* SELECT_B_PROTOCOL_CONF */ [0x1c] = "\x03\x23\x01",
+    /* CONNECT_B3_CONF */ [0x1d] = "\x03\x23\x01",
+    /* DISCONNECT_B3_CONF */ [0x1f] = "\x03\x23\x01",
+    /* DATA_B3_CONF */ [0x21] = "\x03\x19\x23\x01",
+    /* RESET_B3_CONF */ [0x22] = "\x03\x23\x01",
+    /* CONNECT_IND */ [0x26] = "\x03\x14\x0e\x10\x0f\x11\x0b\x28\x22\x04\x0c\x27\x2f\x1c\x01\x01",
+    /* CONNECT_ACTIVE_IND */ [0x27] = "\x03\x16\x17\x28\x01",
+    /* DISCONNECT_IND */ [0x28] = "\x03\x2c\x01",
+    /* MANUFACTURER_CONF */ [0x2a] = "\x03\x2a\x15\x21\x29\x01",
+    /* INFO_IND */ [0x2c] = "\x03\x26\x24\x01",
+    /* FACILITY_IND */ [0x2d] = "\x03\x1f\x1d\x01",
+    /* CONNECT_B3_IND */ [0x2f] = "\x03\x2b\x01",
+    /* CONNECT_B3_ACTIVE_IND */ [0x30] = "\x03\x2b\x01",
+    /* DISCONNECT_B3_IND */ [0x31] = "\x03\x2d\x2b\x01",
+    /* DATA_B3_IND */ [0x33] = "\x03\x18\x1a\x19\x20\x01",
+    /* RESET_B3_IND */ [0x34] = "\x03\x2b\x01",
+    /* CONNECT_B3_T90_ACTIVE_IND */ [0x35] = "\x03\x2b\x01",
+    /* CONNECT_RESP */ [0x38] = "\x03\x2e\x0d\x06\x08\x0a\x05\x07\x09\x01\x16\x17\x28\x04\x0c\x27\x2f\x1c\x01\x01",
+    /* CONNECT_ACTIVE_RESP */ [0x39] = "\x03\x01",
+    /* DISCONNECT_RESP */ [0x3a] = "\x03\x01",
+    /* MANUFACTURER_IND */ [0x3c] = "\x03\x2a\x15\x21\x29\x01",
+    /* INFO_RESP */ [0x3e] = "\x03\x01",
+    /* FACILITY_RESP */ [0x3f] = "\x03\x1f\x01",
+    /* CONNECT_B3_RESP */ [0x41] = "\x03\x2e\x2b\x01",
+    /* CONNECT_B3_ACTIVE_RESP */ [0x42] = "\x03\x01",
+    /* DISCONNECT_B3_RESP */ [0x43] = "\x03\x01",
+    /* DATA_B3_RESP */ [0x45] = "\x03\x19\x01",
+    /* RESET_B3_RESP */ [0x46] = "\x03\x01",
+    /* CONNECT_B3_T90_ACTIVE_RESP */ [0x47] = "\x03\x01",
+    /* MANUFACTURER_RESP */ [0x4e] = "\x03\x2a\x15\x21\x29\x01",
 };
 
 /*-------------------------------------------------------*/
@@ -623,85 +592,54 @@ unsigned capi_cmsg_header(_cmsg * cmsg, u16 _ApplId,
 
 static char *mnames[] =
 {
-       0,
-       "ALERT_REQ",
-       "CONNECT_REQ",
-       0,
-       "DISCONNECT_REQ",
-       "LISTEN_REQ",
-       0,
-       0,
-       "INFO_REQ",
-       "FACILITY_REQ",
-       "SELECT_B_PROTOCOL_REQ",
-       "CONNECT_B3_REQ",
-       0,
-       "DISCONNECT_B3_REQ",
-       0,
-       "DATA_B3_REQ",
-       "RESET_B3_REQ",
-       0,
-       0,
-       "ALERT_CONF",
-       "CONNECT_CONF",
-       0,
-       "DISCONNECT_CONF",
-       "LISTEN_CONF",
-       "MANUFACTURER_REQ",
-       0,
-       "INFO_CONF",
-       "FACILITY_CONF",
-       "SELECT_B_PROTOCOL_CONF",
-       "CONNECT_B3_CONF",
-       0,
-       "DISCONNECT_B3_CONF",
-       0,
-       "DATA_B3_CONF",
-       "RESET_B3_CONF",
-       0,
-       0,
-       0,
-       "CONNECT_IND",
-       "CONNECT_ACTIVE_IND",
-       "DISCONNECT_IND",
-       0,
-       "MANUFACTURER_CONF",
-       0,
-       "INFO_IND",
-       "FACILITY_IND",
-       0,
-       "CONNECT_B3_IND",
-       "CONNECT_B3_ACTIVE_IND",
-       "DISCONNECT_B3_IND",
-       0,
-       "DATA_B3_IND",
-       "RESET_B3_IND",
-       "CONNECT_B3_T90_ACTIVE_IND",
-       0,
-       0,
-       "CONNECT_RESP",
-       "CONNECT_ACTIVE_RESP",
-       "DISCONNECT_RESP",
-       0,
-       "MANUFACTURER_IND",
-       0,
-       "INFO_RESP",
-       "FACILITY_RESP",
-       0,
-       "CONNECT_B3_RESP",
-       "CONNECT_B3_ACTIVE_RESP",
-       "DISCONNECT_B3_RESP",
-       0,
-       "DATA_B3_RESP",
-       "RESET_B3_RESP",
-       "CONNECT_B3_T90_ACTIVE_RESP",
-       0,
-       0,
-       0,
-       0,
-       0,
-       0,
-       "MANUFACTURER_RESP"
+       [0x01] = "ALERT_REQ",
+       [0x02] = "CONNECT_REQ",
+       [0x04] = "DISCONNECT_REQ",
+       [0x05] = "LISTEN_REQ",
+       [0x08] = "INFO_REQ",
+       [0x09] = "FACILITY_REQ",
+       [0x0a] = "SELECT_B_PROTOCOL_REQ",
+       [0x0b] = "CONNECT_B3_REQ",
+       [0x0d] = "DISCONNECT_B3_REQ",
+       [0x0f] = "DATA_B3_REQ",
+       [0x10] = "RESET_B3_REQ",
+       [0x13] = "ALERT_CONF",
+       [0x14] = "CONNECT_CONF",
+       [0x16] = "DISCONNECT_CONF",
+       [0x17] = "LISTEN_CONF",
+       [0x18] = "MANUFACTURER_REQ",
+       [0x1a] = "INFO_CONF",
+       [0x1b] = "FACILITY_CONF",
+       [0x1c] = "SELECT_B_PROTOCOL_CONF",
+       [0x1d] = "CONNECT_B3_CONF",
+       [0x1f] = "DISCONNECT_B3_CONF",
+       [0x21] = "DATA_B3_CONF",
+       [0x22] = "RESET_B3_CONF",
+       [0x26] = "CONNECT_IND",
+       [0x27] = "CONNECT_ACTIVE_IND",
+       [0x28] = "DISCONNECT_IND",
+       [0x2a] = "MANUFACTURER_CONF",
+       [0x2c] = "INFO_IND",
+       [0x2d] = "FACILITY_IND",
+       [0x2f] = "CONNECT_B3_IND",
+       [0x30] = "CONNECT_B3_ACTIVE_IND",
+       [0x31] = "DISCONNECT_B3_IND",
+       [0x33] = "DATA_B3_IND",
+       [0x34] = "RESET_B3_IND",
+       [0x35] = "CONNECT_B3_T90_ACTIVE_IND",
+       [0x38] = "CONNECT_RESP",
+       [0x39] = "CONNECT_ACTIVE_RESP",
+       [0x3a] = "DISCONNECT_RESP",
+       [0x3c] = "MANUFACTURER_IND",
+       [0x3e] = "INFO_RESP",
+       [0x3f] = "FACILITY_RESP",
+       [0x41] = "CONNECT_B3_RESP",
+       [0x42] = "CONNECT_B3_ACTIVE_RESP",
+       [0x43] = "DISCONNECT_B3_RESP",
+       [0x45] = "DATA_B3_RESP",
+       [0x46] = "RESET_B3_RESP",
+       [0x47] = "CONNECT_B3_T90_ACTIVE_RESP",
+       [0x4e] = "MANUFACTURER_RESP"
 };
 
 char *capi_cmd2str(u8 cmd, u8 subcmd)
@@ -715,9 +653,9 @@ char *capi_cmd2str(u8 cmd, u8 subcmd)
 
 static char *pnames[] =
 {
-    /*00 */ 0,
-    /*01 */ 0,
-    /*02 */ 0,
+    /*00 */ NULL,
+    /*01 */ NULL,
+    /*02 */ NULL,
     /*03 */ "Controller/PLCI/NCCI",
     /*04 */ "AdditionalInfo",
     /*05 */ "B1configuration",
@@ -767,7 +705,7 @@ static char *pnames[] =
 
 
 static char buf[8192];
-static char *p = 0;
+static char *p = NULL;
 
 #include <stdarg.h>
 
index 8524997b10b690daf0915cd66d84d81c1096fe44..41e069c57d7e909072a4dd7feb5be5e14304e4e2 100644 (file)
@@ -193,7 +193,7 @@ static void notify_down(u32 contr)
        for (applid = 1; applid <= CAPI_MAXAPPL; applid++) {
                ap = get_capi_appl_by_nr(applid);
                if (ap && ap->callback && !ap->release_in_progress)
-                       ap->callback(KCI_CONTRDOWN, contr, 0);
+                       ap->callback(KCI_CONTRDOWN, contr, NULL);
        }
 }
 
@@ -421,7 +421,7 @@ attach_capi_ctr(struct capi_ctr *card)
        card->traceflag = showcapimsgs;
 
        sprintf(card->procfn, "capi/controllers/%d", card->cnr);
-       card->procent = create_proc_entry(card->procfn, 0, 0);
+       card->procent = create_proc_entry(card->procfn, 0, NULL);
        if (card->procent) {
           card->procent->read_proc = 
                (int (*)(char *,char **,off_t,int,int *,void *))
@@ -445,8 +445,8 @@ int detach_capi_ctr(struct capi_ctr *card)
        ncards--;
 
        if (card->procent) {
-          remove_proc_entry(card->procfn, 0);
-          card->procent = 0;
+          remove_proc_entry(card->procfn, NULL);
+          card->procent = NULL;
        }
        capi_cards[card->cnr - 1] = NULL;
        printk(KERN_NOTICE "kcapi: Controller %d: %s unregistered\n",
@@ -524,7 +524,7 @@ u16 capi20_register(struct capi20_appl *ap)
        ap->nrecvdatapkt = 0;
        ap->nsentctlpkt = 0;
        ap->nsentdatapkt = 0;
-       ap->callback = 0;
+       ap->callback = NULL;
        init_MUTEX(&ap->recv_sem);
        skb_queue_head_init(&ap->recv_queue);
        INIT_WORK(&ap->recv_work, recv_handler, (void *)ap);
@@ -718,7 +718,7 @@ static int old_capi_manufacturer(unsigned int cmd, void *data)
        avmb1_resetdef rdef;
        capicardparams cparams;
        struct capi_ctr *card;
-       struct capi_driver *driver = 0;
+       struct capi_driver *driver = NULL;
        capiloaddata ldata;
        struct list_head *l;
        unsigned long flags;
@@ -758,7 +758,7 @@ static int old_capi_manufacturer(unsigned int cmd, void *data)
                                }
                                break;
                        default:
-                               driver = 0;
+                               driver = NULL;
                                break;
                }
                if (!driver) {
@@ -784,7 +784,7 @@ static int old_capi_manufacturer(unsigned int cmd, void *data)
                                           sizeof(avmb1_loaddef)))
                                return -EFAULT;
                        ldef.t4config.len = 0;
-                       ldef.t4config.data = 0;
+                       ldef.t4config.data = NULL;
                } else {
                        if (copy_from_user((void *)&ldef, data,
                                           sizeof(avmb1_loadandconfigdef)))
@@ -901,7 +901,7 @@ int capi20_manufacturer(unsigned int cmd, void *data)
        case KCAPI_CMD_ADDCARD:
        {
                struct list_head *l;
-               struct capi_driver *driver = 0;
+               struct capi_driver *driver = NULL;
                capicardparams cparams;
                kcapi_carddef cdef;
                int retval;
index 195be3b8bf387cc24b571cd8c559555119db0403..16dc5418ff41b1d6df670dac1462b58bc7404855 100644 (file)
@@ -246,7 +246,7 @@ create_seq_entry(char *name, mode_t mode, struct file_operations *f)
 
 static __inline__ struct capi_driver *capi_driver_get_idx(loff_t pos)
 {
-       struct capi_driver *drv = 0;
+       struct capi_driver *drv = NULL;
        struct list_head *l;
        loff_t i;
 
@@ -256,7 +256,7 @@ static __inline__ struct capi_driver *capi_driver_get_idx(loff_t pos)
                if (i++ == pos)
                        return drv;
        }
-       return 0;
+       return NULL;
 }
 
 static void *capi_driver_start(struct seq_file *seq, loff_t *pos)
@@ -271,7 +271,7 @@ static void *capi_driver_next(struct seq_file *seq, void *v, loff_t *pos)
 {
        struct capi_driver *drv = (struct capi_driver *)v;
        ++*pos;
-       if (drv->list.next == &capi_drivers) return 0;
+       if (drv->list.next == &capi_drivers) return NULL;
        return list_entry(drv->list.next, struct capi_driver, list);
 }
 
index ba5dc752f2fe111423e9a59712ac5a7a014c2dd4..15d081a09f645e08a6ce3c28d7f6e2485ccde34f 100644 (file)
@@ -228,7 +228,7 @@ void sendf(APPL * appl, word command, dword Id, word Number, byte * format, ...)
        word length = 12, dlength = 0;
        byte *write;
        CAPI_MSG msg;
-       byte *string = 0;
+       byte *string = NULL;
        va_list ap;
        diva_os_message_buffer_s *dmb;
        diva_card *card = NULL;
@@ -1072,7 +1072,7 @@ static int divacapi_connect_didd(void)
                        req.didd_notify.e.Rc =
                            IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY;
                        req.didd_notify.info.callback = (void *)didd_callback;
-                       req.didd_notify.info.context = 0;
+                       req.didd_notify.info.context = NULL;
                        DAdapter.request((ENTITY *) & req);
                        if (req.didd_notify.e.Rc != 0xff) {
                                stop_dbg();
index 4a170252363204f34988a5632e64b7321fcffc06..8fe4f3f09353ed206e82169d1022f8dbe7cfec7b 100644 (file)
@@ -102,8 +102,8 @@ static int diva_ctl_read_proc(char *page, char **start, off_t off,
 void diva_os_set_controller_struct(struct capi_ctr *ctrl)
 {
        ctrl->driver_name = DRIVERLNAME;
-       ctrl->load_firmware = 0;
-       ctrl->reset_ctr = 0;
+       ctrl->load_firmware = NULL;
+       ctrl->reset_ctr = NULL;
        ctrl->ctr_read_proc = diva_ctl_read_proc;
        ctrl->owner = THIS_MODULE;
 }
index dcfae9e9ad7ba5775c9d0fc6307fb62ab7512624..3d4cfe919fcea55a1c414c9835f181aadfd1b355 100644 (file)
@@ -293,8 +293,8 @@ static void diva_remove_adapter_callback (dword handle) {
  diva_os_spin_lock_magic_t irql;
  if (handle && ((--handle) < DIVA_DIDD_MAX_NOTIFICATIONS)) {
   diva_os_enter_spin_lock (&didd_spin, &irql, "didd_nfy_rm");
-  NotificationTable[handle].callback = 0;
-  NotificationTable[handle].context  = 0;
+  NotificationTable[handle].callback = NULL;
+  NotificationTable[handle].context  = NULL;
   diva_os_leave_spin_lock (&didd_spin, &irql, "didd_nfy_rm");
   DBG_TRC(("Remove adapter notification[%d]", (int)(handle+1)))
   return;
index 907364c9cb9b179c9bf96acf08fbe96817543d78..e8e99ad354fbc2d65e273bc57e576a7793a801f3 100644 (file)
@@ -89,7 +89,7 @@ static void queueInit (MSG_QUEUE *Q, byte *Buffer, dword sizeBuffer) {
        Q->Size = sizeBuffer;
        Q->Base = Q->Head = Q->Tail = Buffer;
        Q->High = Buffer + sizeBuffer;
-       Q->Wrap = 0;
+       Q->Wrap = NULL;
        Q->Count= 0;
 }
 
@@ -107,7 +107,7 @@ static byte *queueAllocMsg (MSG_QUEUE *Q, word size) {
 
        if (Q->Tail == Q->Head) {
                if (Q->Wrap || need > Q->Size) {
-                       return(0); /* full */
+                       return NULL; /* full */
                }
                goto alloc; /* empty */
        }
@@ -115,7 +115,7 @@ static byte *queueAllocMsg (MSG_QUEUE *Q, word size) {
        if (Q->Tail > Q->Head) {
                if (Q->Tail + need <= Q->High) goto alloc; /* append */
                if (Q->Base + need > Q->Head) {
-                       return (0); /* too much */
+                       return NULL; /* too much */
                }
                /* wraparound the queue (but not the message) */
                Q->Wrap = Q->Tail;
@@ -124,7 +124,7 @@ static byte *queueAllocMsg (MSG_QUEUE *Q, word size) {
        }
 
        if (Q->Tail + need > Q->Head) {
-               return (0); /* too much */
+               return NULL; /* too much */
        }
 
 alloc:
@@ -151,7 +151,7 @@ static void queueFreeMsg (MSG_QUEUE *Q) {
        if (Q->Wrap) {
                if (Q->Head >= Q->Wrap) {
                        Q->Head = Q->Base;
-                       Q->Wrap = 0;
+                       Q->Wrap = NULL;
                }
        } else if (Q->Head >= Q->Tail) {
                Q->Head = Q->Tail = Q->Base;
@@ -167,7 +167,7 @@ static byte *queuePeekMsg (MSG_QUEUE *Q, word *size) {
 
        if (((byte *)Msg == Q->Tail && !Q->Wrap) ||
            (Msg->Size & MSG_INCOMPLETE)) {
-               return (0);
+               return NULL;
        } else {
                *size = Msg->Size;
                return ((byte *)(Msg + 1));
@@ -177,13 +177,13 @@ static byte *queuePeekMsg (MSG_QUEUE *Q, word *size) {
 /*
   Message queue header
   */
-static MSG_QUEUE*          dbg_queue = 0;
-static byte*               dbg_base  = 0;
-static int                 external_dbg_queue = 0;
+static MSG_QUEUE*          dbg_queue;
+static byte*               dbg_base;
+static int                 external_dbg_queue;
 static diva_os_spin_lock_t dbg_q_lock;
 static diva_os_spin_lock_t dbg_adapter_lock;
-static int                 dbg_q_busy = 0;
-static volatile dword      dbg_sequence = 0;
+static int                 dbg_q_busy;
+static volatile dword      dbg_sequence;
 static dword               start_sec;
 static dword               start_usec;
 
@@ -235,16 +235,16 @@ int diva_maint_init (byte* base, unsigned long length, int do_init) {
 
 
        if (diva_os_initialize_spin_lock (&dbg_q_lock, "dbg_init")) {
-    dbg_queue = 0;
-    dbg_base = 0;
+    dbg_queue = NULL;
+    dbg_base = NULL;
     external_dbg_queue = 0;
                return (-1);
   }
 
        if (diva_os_initialize_spin_lock (&dbg_adapter_lock, "dbg_init")) {
     diva_os_destroy_spin_lock(&dbg_q_lock, "dbg_init");
-    dbg_queue = 0;
-    dbg_base = 0;
+    dbg_queue = NULL;
+    dbg_base = NULL;
     external_dbg_queue = 0;
                return (-1);
   }
@@ -263,8 +263,8 @@ void* diva_maint_finit (void) {
   void* ret = (void*)dbg_base;
   int i;
 
-  dbg_queue = 0;
-  dbg_base  = 0;
+  dbg_queue = NULL;
+  dbg_base  = NULL;
 
   if (ret) {
     diva_os_destroy_spin_lock(&dbg_q_lock, "dbg_finit");
@@ -272,7 +272,7 @@ void* diva_maint_finit (void) {
   }
 
   if (external_dbg_queue) {
-    ret = 0;
+    ret = NULL;
   }
   external_dbg_queue = 0;
 
@@ -300,12 +300,12 @@ dword diva_dbg_q_length (void) {
   */
 diva_dbg_entry_head_t* diva_maint_get_message (word* size,
                                                diva_os_spin_lock_magic_t* old_irql) {
-  diva_dbg_entry_head_t*     pmsg = 0;
+  diva_dbg_entry_head_t*     pmsg = NULL;
 
   diva_os_enter_spin_lock_hard (&dbg_q_lock, old_irql, "read");
   if (dbg_q_busy) {
     diva_os_leave_spin_lock_hard (&dbg_q_lock, old_irql, "read_busy");
-    return (0);
+    return NULL;
   }
   dbg_q_busy = 1;
 
@@ -406,7 +406,7 @@ static void DI_register (void *arg) {
   }
 
   if (free_id != -1) {
-    diva_dbg_entry_head_t* pmsg = 0;
+    diva_dbg_entry_head_t* pmsg = NULL;
     int len;
     char tmp[256];
     word size;
@@ -476,7 +476,7 @@ static void DI_deregister (pDbgHandle hDbg) {
   dword sec, usec;
   int i;
   word size;
-  byte* pmem = 0;
+  byte* pmem = NULL;
 
   diva_os_get_time (&sec, &usec);
 
@@ -489,24 +489,24 @@ static void DI_deregister (pDbgHandle hDbg) {
       char tmp[256];
       int len;
 
-      clients[i].hDbg = 0;
+      clients[i].hDbg = NULL;
 
       hDbg->id       = -1;
       hDbg->dbgMask  = 0;
-      hDbg->dbg_end  = 0;
-      hDbg->dbg_prt  = 0;
-      hDbg->dbg_irq  = 0;
+      hDbg->dbg_end  = NULL;
+      hDbg->dbg_prt  = NULL;
+      hDbg->dbg_irq  = NULL;
       if (hDbg->Version > 0)
-        hDbg->dbg_old = 0;
+        hDbg->dbg_old = NULL;
       hDbg->Registered = 0;
-      hDbg->next     = 0;
+      hDbg->next     = NULL;
 
       if (clients[i].pIdiLib) {
         (*(clients[i].pIdiLib->DivaSTraceLibraryFinit))(clients[i].pIdiLib->hLib);
-        clients[i].pIdiLib = 0;
+        clients[i].pIdiLib = NULL;
 
         pmem = clients[i].pmem;
-        clients[i].pmem = 0;
+        clients[i].pmem = NULL;
       }
 
       /*
@@ -565,7 +565,7 @@ static void DI_format (int do_lock,
                        va_list ap) {
   diva_os_spin_lock_magic_t old_irql;
   dword sec, usec;
-  diva_dbg_entry_head_t* pmsg = 0;
+  diva_dbg_entry_head_t* pmsg = NULL;
   dword length;
   word size;
   static char fmtBuf[MSG_FRAME_MAX_SIZE+sizeof(*pmsg)+1];
@@ -843,7 +843,7 @@ void diva_mnt_add_xdi_adapter (const DESCRIPTOR* d) {
   dword sec, usec, logical, serial, org_mask;
   int id, best_id = 0, free_id = -1;
   char tmp[256];
-  diva_dbg_entry_head_t* pmsg = 0;
+  diva_dbg_entry_head_t* pmsg = NULL;
   int len;
   word size;
   byte* pmem;
@@ -938,7 +938,7 @@ void diva_mnt_add_xdi_adapter (const DESCRIPTOR* d) {
       if (((*(clients[id].pIdiLib->DivaSTraceLibraryStart))(clients[id].pIdiLib->hLib))) {
         diva_mnt_internal_dprintf (0, DLI_ERR, "Adapter(%d) Start failed", (int)logical);
         (*(clients[id].pIdiLib->DivaSTraceLibraryFinit))(clients[id].pIdiLib->hLib);
-        clients[id].pIdiLib = 0;
+        clients[id].pIdiLib = NULL;
       }
     } else {
       diva_mnt_internal_dprintf (0, DLI_ERR, "A(%d) management init failed", (int)logical);
@@ -946,9 +946,9 @@ void diva_mnt_add_xdi_adapter (const DESCRIPTOR* d) {
   }
 
   if (!clients[id].pIdiLib) {
-    clients[id].request = 0;
+    clients[id].request = NULL;
     clients[id].request_pending = 0;
-    clients[id].hDbg    = 0;
+    clients[id].hDbg    = NULL;
     diva_os_leave_spin_lock_hard (&dbg_q_lock, &old_irql, "register");
     diva_os_leave_spin_lock_hard (&dbg_adapter_lock, &old_irql1, "register");
     diva_os_free (0, pmem);
@@ -1008,7 +1008,7 @@ void diva_mnt_remove_xdi_adapter (const DESCRIPTOR* d) {
   dword sec, usec;
   int i;
   word size;
-  byte* pmem = 0;
+  byte* pmem = NULL;
 
   diva_os_get_time (&sec, &usec);
 
@@ -1023,14 +1023,14 @@ void diva_mnt_remove_xdi_adapter (const DESCRIPTOR* d) {
 
       if (clients[i].pIdiLib) {
         (*(clients[i].pIdiLib->DivaSTraceLibraryFinit))(clients[i].pIdiLib->hLib);
-        clients[i].pIdiLib = 0;
+        clients[i].pIdiLib = NULL;
 
         pmem = clients[i].pmem;
-        clients[i].pmem = 0;
+        clients[i].pmem = NULL;
       }
 
-      clients[i].hDbg    = 0;
-      clients[i].request = 0;
+      clients[i].hDbg    = NULL;
+      clients[i].request = NULL;
       clients[i].request_pending = 0;
 
       /*
@@ -1092,7 +1092,7 @@ void* SuperTraceOpenAdapter   (int AdapterNumber) {
     }
   }
 
-  return (0);
+  return NULL;
 }
 
 int SuperTraceCloseAdapter  (void* AdapterHandle) {
@@ -1741,7 +1741,7 @@ int diva_mnt_shutdown_xdi_adapters (void) {
 
 
   for (i = 1; i < (sizeof(clients)/sizeof(clients[0])); i++) {
-    pmem = 0;
+    pmem = NULL;
 
     diva_os_enter_spin_lock_hard (&dbg_adapter_lock, &old_irql1, "unload");
     diva_os_enter_spin_lock_hard (&dbg_q_lock, &old_irql, "unload");
@@ -1753,13 +1753,13 @@ int diva_mnt_shutdown_xdi_adapters (void) {
           */
         if (clients[i].pIdiLib) {
           (*(clients[i].pIdiLib->DivaSTraceLibraryFinit))(clients[i].pIdiLib->hLib);
-          clients[i].pIdiLib = 0;
+          clients[i].pIdiLib = NULL;
 
           pmem = clients[i].pmem;
-          clients[i].pmem = 0;
+          clients[i].pmem = NULL;
         }
-        clients[i].hDbg    = 0;
-        clients[i].request = 0;
+        clients[i].hDbg    = NULL;
+        clients[i].request = NULL;
         clients[i].request_pending = 0;
       } else {
         fret = -1;
index 8e1791d3b194923601709ec978415ea520af31c6..24fa5943b7c754f6daa504f2925804dd780b8583 100644 (file)
@@ -81,7 +81,7 @@ static void xdi_xlog_ind (byte Adapter,
 void pr_out(ADAPTER * a)
 {
   byte e_no;
-  ENTITY  * this = 0;
+  ENTITY  * this = NULL;
   BUFFERS  *X;
   word length;
   word i;
@@ -761,7 +761,7 @@ byte isdn_ind(ADAPTER * a,
   word clength;
   word offset;
   BUFFERS  *R;
-  byte* cma = 0;
+  byte* cma = NULL;
 #ifdef USE_EXTENDED_DEBUGS
   {
     DBG_TRC(("<A%d Id=0x%x Ind=0x%x", ((ISDN_ADAPTER *)a->io)->ANum, Id, Ind))
@@ -814,7 +814,7 @@ byte isdn_ind(ADAPTER * a,
                                                      Id,
                                                      cma,
                                                      sizeof(a->stream_buffer),
-                                                     &final, 0, 0);
+                                                     &final, NULL, NULL);
         }
         IoAdapter->RBuffer.length = MIN(MLength, 270);
         if (IoAdapter->RBuffer.length != MLength) {
index 69abacc7c85b72ba06d16948e891a3561b08301f..33172c1d64e14b22f7efe364b45202df36e0a83f 100644 (file)
@@ -66,7 +66,7 @@ static int DIVA_INIT_FUNCTION connect_didd(void)
                        req.didd_notify.e.Rc =
                            IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY;
                        req.didd_notify.info.callback = (void *)didd_callback;
-                       req.didd_notify.info.context = 0;
+                       req.didd_notify.info.context = NULL;
                        _DAdapter.request((ENTITY *) & req);
                        if (req.didd_notify.e.Rc != 0xff)
                                return (0);
index 47cf327eb3e4a3aa01b69d8fed63be524c460097..c0c266764193313489c3e93d6d0d5db3c6a36d37 100644 (file)
@@ -131,7 +131,7 @@ static diva_supported_cards_info_t divas_supported_cards[] = {
        /*
           EOL
         */
-       {-1, 0}
+       {-1}
 };
 
 static void diva_init_request_array(void);
@@ -174,7 +174,7 @@ void *diva_driver_add_card(void *pdev, unsigned long CardOrdinal)
        for (i = 0; divas_supported_cards[i].CardOrdinal != -1; i++) {
                if (divas_supported_cards[i].CardOrdinal == CardOrdinal) {
                        if (!(pdiva = divas_create_pci_card(i, pdev))) {
-                               return (0);
+                               return NULL;
                        }
                        switch (CardOrdinal) {
                        case CARDTYPE_DIVASRV_Q_8M_PCI:
@@ -237,11 +237,11 @@ void *diva_driver_add_card(void *pdev, unsigned long CardOrdinal)
                        DBG_ERR(("can not alloc request array"))
                        diva_driver_remove_card(pdiva);
 
-                       return (0);
+                       return NULL;
                }
        }
 
-       return (0);
+       return NULL;
 }
 
 /* --------------------------------------------------------------------------
@@ -286,7 +286,7 @@ void diva_driver_remove_card(void *pdiva)
        int i;
 
        pa = a[0] = (diva_os_xdi_adapter_t *) pdiva;
-       a[1] = a[2] = a[3] = 0;
+       a[1] = a[2] = a[3] = NULL;
 
        diva_os_enter_spin_lock(&adapter_lock, &old_irql, "remode adapter");
 
@@ -311,7 +311,7 @@ void diva_driver_remove_card(void *pdiva)
                if (a[i]) {
                        if (a[i]->controller) {
                                DBG_LOG(("remove adapter (%d)",
-                                        a[i]->controller)) IoAdapters[a[i]->controller - 1] = 0;
+                                        a[i]->controller)) IoAdapters[a[i]->controller - 1] = NULL;
                                remove_adapter_proc(a[i]);
                        }
                        diva_os_free(0, a[i]);
@@ -332,7 +332,7 @@ static void *divas_create_pci_card(int handle, void *pci_dev_handle)
 
        if (!(a = (diva_os_xdi_adapter_t *) diva_os_malloc(0, sizeof(*a)))) {
                DBG_ERR(("A: can't alloc adapter"));
-               return (0);
+               return NULL;
        }
 
        memset(a, 0x00, sizeof(*a));
@@ -359,7 +359,7 @@ static void *divas_create_pci_card(int handle, void *pci_dev_handle)
                diva_os_leave_spin_lock(&adapter_lock, &old_irql, "found_pci_card");
                diva_os_free(0, a);
                DBG_ERR(("A: can't get adapter resources"));
-               return (0);
+               return NULL;
        }
 
        return (a);
@@ -377,7 +377,7 @@ void divasa_xdi_driver_unload(void)
                        (*(a->interface.cleanup_adapter_proc)) (a);
                }
                if (a->controller) {
-                       IoAdapters[a->controller - 1] = 0;
+                       IoAdapters[a->controller - 1] = NULL;
                        remove_adapter_proc(a);
                }
                diva_os_free(0, a);
@@ -400,11 +400,11 @@ void *diva_xdi_open_adapter(void *os_handle, const void *src,
        if (length < sizeof(diva_xdi_um_cfg_cmd_t)) {
                DBG_ERR(("A: A(?) open, msg too small (%d < %d)",
                         length, sizeof(diva_xdi_um_cfg_cmd_t)))
-               return (0);
+               return NULL;
        }
        if ((*cp_fn) (os_handle, &msg, src, sizeof(msg)) <= 0) {
                DBG_ERR(("A: A(?) open, write error"))
-               return (0);
+               return NULL;
        }
        diva_os_enter_spin_lock(&adapter_lock, &old_irql, "open_adapter");
        list_for_each(tmp, &adapter_queue) {
@@ -432,7 +432,7 @@ void diva_xdi_close_adapter(void *adapter, void *os_handle)
        a->xdi_mbox.status &= ~DIVA_XDI_MBOX_BUSY;
        if (a->xdi_mbox.data) {
                diva_os_free(0, a->xdi_mbox.data);
-               a->xdi_mbox.data = 0;
+               a->xdi_mbox.data = NULL;
        }
 }
 
@@ -507,7 +507,7 @@ diva_xdi_read(void *adapter, void *os_handle, void *dst,
                      a->xdi_mbox.data_length);
        if (ret > 0) {
                diva_os_free(0, a->xdi_mbox.data);
-               a->xdi_mbox.data = 0;
+               a->xdi_mbox.data = NULL;
                a->xdi_mbox.status &= ~DIVA_XDI_MBOX_BUSY;
        }
 
@@ -526,7 +526,7 @@ irqreturn_t diva_os_irq_wrapper(int irq, void *context, struct pt_regs *regs)
 
        if ((clear_int_proc = a->clear_interrupts_proc)) {
                (*clear_int_proc) (a);
-               a->clear_interrupts_proc = 0;
+               a->clear_interrupts_proc = NULL;
                return IRQ_HANDLED;
        }
 
index bdf2969e69fbb70576d04ed36a6dbbabb51d5c3a..f53a7407605ffd7a3c7cc86c96bbe0eb1588e470 100644 (file)
@@ -39,11 +39,10 @@ struct _diva_dma_map_entry {
   Create local mapping structure and init it to default state
   */
 struct _diva_dma_map_entry* diva_alloc_dma_map (void* os_context, int nentries) {
-  diva_dma_map_entry_t* pmap;
-  if (!(pmap = diva_os_malloc (0, sizeof(*pmap)*(nentries+1))))
-    return (0);
-  memset (pmap, 0x00, sizeof(*pmap)*(nentries+1));
-  return (pmap);
+  diva_dma_map_entry_t* pmap = diva_os_malloc(0, sizeof(*pmap)*(nentries+1));
+  if (pmap)
+         memset (pmap, 0, sizeof(*pmap)*(nentries+1));
+  return pmap;
 }
 /*
   Free local map (context should be freed before) if any
index abd70d0d02687cc6953f0fad68dc71469efe6a93..82fcbb6db48f6c355bd05e50d6ad904f8f3c0aa1 100644 (file)
@@ -144,7 +144,7 @@ static struct proc_dir_entry *maint_proc_entry = NULL;
 static ssize_t
 maint_read(struct file *file, char *buf, size_t count, loff_t * off)
 {
-       diva_dbg_entry_head_t *pmsg = 0;
+       diva_dbg_entry_head_t *pmsg = NULL;
        diva_os_spin_lock_magic_t old_irql;
        word size;
        char *pstr, *dli_label = "UNK";
@@ -264,13 +264,13 @@ maint_read(struct file *file, char *buf, size_t count, loff_t * off)
 
        if (diva_os_copy_to_user(NULL, buf, pstr, str_length)) {
                diva_os_free_tbuffer(0, str_msg);
-               file->private_data = 0;
+               file->private_data = NULL;
                return (-EFAULT);
        }
        str_msg[1] += str_length;
        if ((str_msg[0] - str_msg[1]) <= 0) {
                diva_os_free_tbuffer(0, str_msg);
-               file->private_data = 0;
+               file->private_data = NULL;
        }
 
        return (str_length);
@@ -304,7 +304,7 @@ static int maint_open(struct inode *ino, struct file *filep)
        opened++;
        up(&opened_sem);
 
-       filep->private_data = 0;
+       filep->private_data = NULL;
 
        return (0);
 }
@@ -313,7 +313,7 @@ static int maint_close(struct inode *ino, struct file *filep)
 {
        if (filep->private_data) {
                diva_os_free_tbuffer(0, filep->private_data);
-               filep->private_data = 0;
+               filep->private_data = NULL;
        }
 
        down(&opened_sem);
@@ -416,7 +416,7 @@ static int DIVA_INIT_FUNCTION maint_init(void)
 {
        char tmprev[50];
        int ret = 0;
-       void *buffer = 0;
+       void *buffer = NULL;
 
        do_gettimeofday(&start_time);
        init_waitqueue_head(&msgwaitq);
index 52385931f3a46df119cecd4faf486368fae32573..4ee56d4bb4090f303fce5f15fec10d8bcee7eab8 100644 (file)
@@ -173,7 +173,7 @@ static int DIVA_INIT_FUNCTION connect_didd(void)
                        req.didd_notify.e.Rc =
                            IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY;
                        req.didd_notify.info.callback = (void *)didd_callback;
-                       req.didd_notify.info.context = 0;
+                       req.didd_notify.info.context = NULL;
                        DAdapter.request((ENTITY *) & req);
                        if (req.didd_notify.e.Rc != 0xff) {
                                stop_dbg();
index f00f6ba1975a6b3b1633feff4a2cca763d5eb566..264be7af368a7724e9c02b252127abe8f5b6cbef 100644 (file)
@@ -556,7 +556,7 @@ void diva_os_remove_soft_isr(diva_os_soft_isr_t * psoft_isr)
                tasklet_kill(&pdpc->divas_task);
                flush_scheduled_work();
                mem = psoft_isr->object;
-               psoft_isr->object = 0;
+               psoft_isr->object = NULL;
                diva_os_free(0, mem);
        }
 }
@@ -703,7 +703,7 @@ static int DIVA_INIT_FUNCTION divas_register_chrdev(void)
 static int __devinit divas_init_one(struct pci_dev *pdev,
                                    const struct pci_device_id *ent)
 {
-       void *pdiva = 0;
+       void *pdiva = NULL;
        u8 pci_latency;
        u8 new_latency = 32;
 
index f1d7997f33792ccd351c1148d4ad435199c3d5f2..982258225174ecd2867fca3383a77eb836417a56 100644 (file)
@@ -23,7 +23,7 @@ diva_data_q_init(diva_um_idi_data_queue_t * q,
        q->segments = max_segments;
 
        for (i = 0; i < q->segments; i++) {
-               q->data[i] = 0;
+               q->data[i] = NULL;
                q->length[i] = 0;
        }
        q->read = q->write = q->count = q->segment_pending = 0;
@@ -46,7 +46,7 @@ int diva_data_q_finit(diva_um_idi_data_queue_t * q)
                if (q->data[i]) {
                        diva_os_free(0, q->data[i]);
                }
-               q->data[i] = 0;
+               q->data[i] = NULL;
                q->length[i] = 0;
        }
        q->read = q->write = q->count = q->segment_pending = 0;
@@ -66,7 +66,7 @@ void *diva_data_q_get_segment4write(diva_um_idi_data_queue_t * q)
                return (q->data[q->write]);
        }
 
-       return (0);
+       return NULL;
 }
 
 void
@@ -89,7 +89,7 @@ const void *diva_data_q_get_segment4read(const diva_um_idi_data_queue_t *
        if (q->count) {
                return (q->data[q->read]);
        }
-       return (0);
+       return NULL;
 }
 
 int diva_data_q_get_segment_length(const diva_um_idi_data_queue_t * q)
index f3427aad634bd0d984abbf37138b2662cdc65f59..63746f4016e8ff679027e7c0c58436998088ddea 100644 (file)
@@ -199,7 +199,7 @@ static int DIVA_INIT_FUNCTION connect_didd(void)
                        req.didd_notify.e.Rc =
                            IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY;
                        req.didd_notify.info.callback = (void *)didd_callback;
-                       req.didd_notify.info.context = 0;
+                       req.didd_notify.info.context = NULL;
                        DAdapter.request((ENTITY *) & req);
                        if (req.didd_notify.e.Rc != 0xff) {
                                stop_dbg();
index 29850cf198aeda6d532e3ba658571ea478c0bab8..8bef29b8b9b5b7dd1633ecddec69dc90cf625ec0 100644 (file)
@@ -112,7 +112,7 @@ diva_strace_library_interface_t* DivaSTraceLibraryCreateInstance (int Adapter,
        int i;
 
        if (!pLib) {
-               return (0);
+               return NULL;
        }
 
   pmem += sizeof(*pLib);
@@ -161,7 +161,7 @@ diva_strace_library_interface_t* DivaSTraceLibraryCreateInstance (int Adapter,
 
        if (!(pLib->hAdapter = SuperTraceOpenAdapter (Adapter))) {
     diva_mnt_internal_dprintf (0, DLI_ERR, "Can not open XDI adapter");
-               return (0);
+               return NULL;
        }
        pLib->Channels = SuperTraceGetNumberOfChannels (pLib->hAdapter);
 
@@ -1170,13 +1170,13 @@ static diva_man_var_header_t* get_next_var (diva_man_var_header_t* pVar) {
        byte* start;
        int msg_length;
 
-       if (*msg != ESC) return (0);
+       if (*msg != ESC) return NULL;
 
        start = msg + 2;
        msg_length = *(msg+1);
        msg = (start+msg_length);
 
-       if (*msg != ESC) return (0);
+       if (*msg != ESC) return NULL;
 
        return ((diva_man_var_header_t*)msg);
 }
index 03d89d4265a01ff19a1b9c9e58b1cb8614e33043..5ce359aac9e0f192627916477460aff2325d643b 100644 (file)
@@ -414,7 +414,7 @@ word api_put(APPL   * appl, CAPI_MSG   * msg)
   }
   
   a = &adapter[controller];
-  plci = 0;
+  plci = NULL;
   if ((msg->header.plci != 0) && (msg->header.plci <= a->max_plci) && !a->adapter_disabled)
   {
     dbug(1,dprintf("plci=%x",msg->header.plci));
@@ -547,7 +547,7 @@ word api_put(APPL   * appl, CAPI_MSG   * msg)
     }
     else
     {
-      plci = 0;
+      plci = NULL;
     }
   }
   dbug(1,dprintf("com=%x",msg->header.command));
@@ -629,7 +629,7 @@ word api_parse(byte   * msg, word length, byte * format, API_PARSE * parms)
 
     if(p>length) return TRUE;
   }
-  if(parms) parms[i].info = 0;
+  if(parms) parms[i].info = NULL;
   return FALSE;
 }
 
@@ -661,7 +661,7 @@ void api_save_msg(API_PARSE   *in, byte *format, API_SAVE   *out)
     for (j = 0; j < n; j++)
       *(p++) = in[i].info[j];
   }
-  out->parms[i].info = 0;
+  out->parms[i].info = NULL;
   out->parms[i].length = 0;
 }
 
@@ -725,7 +725,7 @@ void init_internal_command_queue (PLCI   *plci)
 
   plci->internal_command = 0;
   for (i = 0; i < MAX_INTERNAL_COMMAND_LEVELS; i++)
-    plci->internal_command_queue[i] = 0;
+    plci->internal_command_queue[i] = NULL;
 }
 
 
@@ -759,16 +759,16 @@ void next_internal_command (dword Id, PLCI   *plci)
     UnMapId (Id), (char   *)(FILE_), __LINE__));
 
   plci->internal_command = 0;
-  plci->internal_command_queue[0] = 0;
+  plci->internal_command_queue[0] = NULL;
   while (plci->internal_command_queue[1] != 0)
   {
     for (i = 0; i < MAX_INTERNAL_COMMAND_LEVELS - 1; i++)
       plci->internal_command_queue[i] = plci->internal_command_queue[i+1];
-    plci->internal_command_queue[MAX_INTERNAL_COMMAND_LEVELS - 1] = 0;
+    plci->internal_command_queue[MAX_INTERNAL_COMMAND_LEVELS - 1] = NULL;
     (*(plci->internal_command_queue[0]))(Id, plci, OK);
     if (plci->internal_command != 0)
       return;
-    plci->internal_command_queue[0] = 0;
+    plci->internal_command_queue[0] = NULL;
   }
 }
 
@@ -1085,7 +1085,7 @@ void plci_remove(PLCI   * plci)
   plci_free_msg_in_queue (plci);
 
   plci->channels = 0;
-  plci->appl = 0;
+  plci->appl = NULL;
   if ((plci->State == INC_CON_PENDING) || (plci->State == INC_CON_ALERT))
     plci->State = OUTG_DIS_PENDING;
 }
@@ -1715,7 +1715,7 @@ byte info_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci, APP
 {
   word i;
   API_PARSE * ai;
-  PLCI   * rc_plci = 0;
+  PLCI   * rc_plci = NULL;
     API_PARSE ai_parms[5];
   word Info = 0;
 
@@ -2195,7 +2195,7 @@ byte facility_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci,
               relatedadapter = &adapter[MapController ((byte)(relatedPLCIvalue & 0x7f))-1];
               relatedPLCIvalue >>=8;
               /* find PLCI PTR*/
-              for(i=0,rplci=0;i<relatedadapter->max_plci;i++)
+              for(i=0,rplci=NULL;i<relatedadapter->max_plci;i++)
               {
                 if(relatedadapter->plci[i].Id == (byte)relatedPLCIvalue)
                 {
@@ -4355,7 +4355,7 @@ void control_rc(PLCI   * plci, byte req, byte rc, byte ch, byte global_req, byte
         if(rc!=OK)
         {
           Info = 0x300E; /* not supported */
-          plci->relatedPTYPLCI = 0;
+          plci->relatedPTYPLCI = NULL;
           plci->ptyState = 0;
         }
         sendf(rplci->appl,
@@ -4376,7 +4376,7 @@ void control_rc(PLCI   * plci, byte req, byte rc, byte ch, byte global_req, byte
         if(rc!=OK)
         {
           Info = 0x300E; /* not supported */
-          plci->relatedPTYPLCI = 0;
+          plci->relatedPTYPLCI = NULL;
           plci->ptyState = 0;
         }
         sendf(rplci->appl,
@@ -4560,7 +4560,7 @@ void control_rc(PLCI   * plci, byte req, byte rc, byte ch, byte global_req, byte
         if(rc!=OK)
         {
           Info = 0x300E; /* not supported */
-          plci->relatedPTYPLCI = 0;
+          plci->relatedPTYPLCI = NULL;
           plci->ptyState = 0;
         }
         sendf(rplci->appl,
@@ -4722,7 +4722,7 @@ void control_rc(PLCI   * plci, byte req, byte rc, byte ch, byte global_req, byte
           dbug(1,dprintf("Auto-Law assign failed"));
           a->automatic_law = 3;
           plci->internal_command = 0;
-          a->automatic_lawPLCI = 0;
+          a->automatic_lawPLCI = NULL;
         }
         break;
       }
@@ -4739,7 +4739,7 @@ void control_rc(PLCI   * plci, byte req, byte rc, byte ch, byte global_req, byte
         plci->internal_command = 0;
         sig_req(plci,REMOVE,0);
         send_req(plci);
-        a->automatic_lawPLCI = 0;
+        a->automatic_lawPLCI = NULL;
       }
       break;
     }
@@ -4839,7 +4839,7 @@ void sig_ind(PLCI   * plci)
     byte   *esc_profile = "";
 
     byte facility[256];
-  PLCI   * tplci = 0;
+  PLCI   * tplci = NULL;
   byte chi[] = "\x02\x18\x01";
   byte voice_cai[]  = "\x06\x14\x00\x00\x00\x00\x08";
     byte resume_cau[] = "\x05\x05\x00\x02\x00\x00";
@@ -4981,7 +4981,7 @@ void sig_ind(PLCI   * plci)
         plci->internal_command = 0;
         sig_req(plci,REMOVE,0);
         send_req(plci);
-        a->automatic_lawPLCI = 0;
+        a->automatic_lawPLCI = NULL;
       }
     }
     if (esc_profile[0])
@@ -5073,7 +5073,7 @@ void sig_ind(PLCI   * plci)
   {
     force_mt_info =  SendMultiIE(plci,Id,multi_fac_parms, FTY, 0x20, 0);
     force_mt_info |= SendMultiIE(plci,Id,multi_pi_parms, PI, 0x210, 0);
-    SendSSExtInd(0,plci,Id,multi_ssext_parms);
+    SendSSExtInd(NULL,plci,Id,multi_ssext_parms);
     SendInfo(plci,Id, parms, force_mt_info);
 
     VSwitchReqInd(plci,Id,multi_vswitch_parms);
@@ -5144,7 +5144,7 @@ void sig_ind(PLCI   * plci)
       {
         WRITE_WORD(&SS_Ind[4],0x300E);
       }
-      plci->relatedPTYPLCI = 0;
+      plci->relatedPTYPLCI = NULL;
       plci->ptyState = 0;
       sendf(tplci->appl,_FACILITY_I,rId,0,"ws",3, SS_Ind);
       break;
@@ -5298,7 +5298,7 @@ void sig_ind(PLCI   * plci)
           break;
       case CONF_ADD:
           WRITE_WORD(&CONF_Ind[1],S_CONF_ADD);
-          plci->relatedPTYPLCI = 0;
+          plci->relatedPTYPLCI = NULL;
           tplci=plci->relatedPTYPLCI;
           if(tplci) tplci->ptyState = CONNECTED;
           plci->ptyState = CONNECTED;
@@ -5342,7 +5342,7 @@ void sig_ind(PLCI   * plci)
         {
 
         plci->ptyState = IDLE;
-        plci->relatedPTYPLCI = 0;
+        plci->relatedPTYPLCI = NULL;
         plci->ptyState = 0;
 
         }
@@ -5364,7 +5364,7 @@ void sig_ind(PLCI   * plci)
 
         case S_3PTY_END:
           plci->ptyState = IDLE;
-          plci->relatedPTYPLCI = 0;
+          plci->relatedPTYPLCI = NULL;
           plci->ptyState = 0;
           dbug(1,dprintf("3PTY OFF"));
           break;
@@ -5904,7 +5904,7 @@ void sig_ind(PLCI   * plci)
           /* and signal '+'.Appl must decide */
           /* with connect_res if call must   */
           /* accepted or not                 */
-          for(i=0, tplci=0;i<max_appl;i++){
+          for(i=0, tplci=NULL;i<max_appl;i++){
             if(a->codec_listen[i]
             && (a->codec_listen[i]->State==INC_CON_PENDING
               ||a->codec_listen[i]->State==INC_CON_ALERT) ){
@@ -5927,7 +5927,7 @@ void sig_ind(PLCI   * plci)
               add_p(tplci, CAI, voice_cai);
               add_p(tplci, OAD, a->TelOAD);
               add_p(tplci, OSA, a->TelOSA);
-              add_p(tplci,SHIFT|6,0);
+              add_p(tplci,SHIFT|6,NULL);
               add_p(tplci,SIN,"\x02\x01\x00");
               add_p(tplci,UID,"\x06\x43\x61\x70\x69\x32\x30");
               sig_req(tplci,ASSIGN,DSIG_ID);
@@ -6080,7 +6080,7 @@ void sig_ind(PLCI   * plci)
     break;
 
   case SSEXT_IND:
-    SendSSExtInd(0,plci,Id,multi_ssext_parms);
+    SendSSExtInd(NULL,plci,Id,multi_ssext_parms);
     break;
 
   case VSWITCH_REQ:
@@ -6218,7 +6218,7 @@ void SendInfo(PLCI   * plci, dword Id, byte   * * parms, byte iesent)
         Info_Number = 0x0008;
         Info_Mask = 0x00;
         cause[2] = ie[2];
-        Info_Element = 0;
+        Info_Element = NULL;
         break;
       case 8:  /* display      */
         dbug(1,dprintf("display(%d)",i));
@@ -7273,8 +7273,8 @@ word get_plci(DIVA_CAPI_ADAPTER   * a)
   plci->sig_req = 0;
   plci->nl_req = 0;
 
-  plci->appl = 0;
-  plci->relatedPTYPLCI = 0;
+  plci->appl = NULL;
+  plci->relatedPTYPLCI = NULL;
   plci->State = IDLE;
   plci->SuppState = IDLE;
   plci->channels = 0;
@@ -8899,7 +8899,7 @@ void listen_check(DIVA_CAPI_ADAPTER   * a)
         add_p(plci,CAI,"\x01\xc0");
         add_p(plci,UID,"\x06\x43\x61\x70\x69\x32\x30");
         add_p(plci,LLI,"\x01\xc4");                  /* support Dummy CR FAC + MWI + SpoofNotify */       
-        add_p(plci,SHIFT|6,0);
+        add_p(plci,SHIFT|6,NULL);
         add_p(plci,SIN,"\x02\x00\x00");
         plci->internal_command = LISTEN_SIG_ASSIGN_PEND;     /* do indicate_req if OK  */
         sig_req(plci,ASSIGN,DSIG_ID);
@@ -9216,10 +9216,10 @@ void CodecIdCheck(DIVA_CAPI_ADAPTER   *a, PLCI   *plci)
       dbug(1,dprintf("remove temp codec PLCI"));
       plci_remove(a->AdvCodecPLCI);
       a->AdvCodecFLAG  = 0;
-      a->AdvCodecPLCI  = 0;
-      a->AdvSignalAppl = 0;
+      a->AdvCodecPLCI  = NULL;
+      a->AdvSignalAppl = NULL;
     }
-    a->AdvSignalPLCI = 0;
+    a->AdvSignalPLCI = NULL;
   }
 }
 
@@ -9351,7 +9351,7 @@ word CapiRelease(word Id)
       a->Info_Mask[Id-1] = 0;
       a->CIP_Mask[Id-1] = 0;
       a->Notification_Mask[Id-1] = 0;
-      a->codec_listen[Id-1] = 0;
+      a->codec_listen[Id-1] = NULL;
       a->requested_options_table[Id-1] = 0;
       for(j=0; j<a->max_plci; j++)           /* and all PLCIs connected */
       {                                      /* with this application   */
@@ -9386,7 +9386,7 @@ word CapiRelease(word Id)
           }
           if(plci->appl==this)
           {
-            plci->appl = 0;
+            plci->appl = NULL;
             plci_remove(plci);
             plci->State = IDLE;
           }
@@ -9405,7 +9405,7 @@ word CapiRelease(word Id)
             add_p(plci,OAD,"\x01\xfd");
             add_p(plci,CAI,"\x01\x80");
             add_p(plci,UID,"\x06\x43\x61\x70\x69\x32\x30");
-            add_p(plci,SHIFT|6,0);
+            add_p(plci,SHIFT|6,NULL);
             add_p(plci,SIN,"\x02\x00\x00");
             plci->internal_command = REM_L1_SIG_ASSIGN_PEND;
             sig_req(plci,ASSIGN,DSIG_ID);
@@ -9424,10 +9424,10 @@ word CapiRelease(word Id)
           a->AdvCodecPLCI->tel = 0;
           a->AdvCodecPLCI->adv_nl = 0;
         }
-        a->AdvSignalAppl = 0;
-        a->AdvSignalPLCI = 0;
+        a->AdvSignalAppl = NULL;
+        a->AdvSignalPLCI = NULL;
         a->AdvCodecFLAG = 0;
-        a->AdvCodecPLCI = 0;
+        a->AdvCodecPLCI = NULL;
       }
     }
   }
@@ -9458,7 +9458,7 @@ static word plci_remove_check(PLCI   *plci)
         plci->Id = 0;
         plci->State = IDLE;
         plci->channels = 0;
-        plci->appl = 0;
+        plci->appl = NULL;
         plci->notifiedcall = 0;
       }
       listen_check(plci->adapter);
@@ -10265,8 +10265,8 @@ static word dtmf_parameter_restore_config (dword Id, PLCI   *plci, byte Rc)
 /*------------------------------------------------------------------*/
 
 
-LI_CONFIG   *li_config_table = 0;
-word li_total_channels = 0;
+LI_CONFIG   *li_config_table;
+word li_total_channels;
 
 
 /*------------------------------------------------------------------*/
@@ -14948,7 +14948,7 @@ word CapiRegister(word id)
             add_p(plci,OAD,"\x01\xfd");
             add_p(plci,CAI,"\x01\x80");
             add_p(plci,UID,"\x06\x43\x61\x70\x69\x32\x30");
-            add_p(plci,SHIFT|6,0);
+            add_p(plci,SHIFT|6,NULL);
             add_p(plci,SIN,"\x02\x00\x00");
             plci->internal_command = START_L1_SIG_ASSIGN_PEND;
             sig_req(plci,ASSIGN,DSIG_ID);
@@ -15068,7 +15068,7 @@ static int diva_get_dma_descriptor (PLCI   *plci, dword   *dma_magic) {
 
   pReq->xdi_dma_descriptor_operation.info.operation =     IDI_SYNC_REQ_DMA_DESCRIPTOR_ALLOC;
   pReq->xdi_dma_descriptor_operation.info.descriptor_number  = -1;
-  pReq->xdi_dma_descriptor_operation.info.descriptor_address = 0;
+  pReq->xdi_dma_descriptor_operation.info.descriptor_address = NULL;
   pReq->xdi_dma_descriptor_operation.info.descriptor_magic   = 0;
 
   e.user[0] = plci->adapter->Id - 1;
@@ -15102,7 +15102,7 @@ static void diva_free_dma_descriptor (PLCI   *plci, int nr) {
 
   pReq->xdi_dma_descriptor_operation.info.operation =                                                IDI_SYNC_REQ_DMA_DESCRIPTOR_FREE;
   pReq->xdi_dma_descriptor_operation.info.descriptor_number  = nr;
-  pReq->xdi_dma_descriptor_operation.info.descriptor_address = 0;
+  pReq->xdi_dma_descriptor_operation.info.descriptor_address = NULL;
   pReq->xdi_dma_descriptor_operation.info.descriptor_magic   = 0;
 
   e.user[0] = plci->adapter->Id - 1;
index 00ef979d6c7cef2c079e6a79d223bce99a2248ce..14067e40af98dc637a73573ad3d628431b53bc4c 100644 (file)
@@ -102,7 +102,7 @@ static int DIVA_INIT_FUNCTION connect_didd(void)
                        req.didd_notify.e.Rc =
                            IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY;
                        req.didd_notify.info.callback = (void *)didd_callback;
-                       req.didd_notify.info.context = 0;
+                       req.didd_notify.info.context = NULL;
                        DAdapter.request((ENTITY *) & req);
                        if (req.didd_notify.e.Rc != 0xff)
                                return (0);
@@ -228,7 +228,7 @@ int maint_read_write(void *buf, int count)
                        diva_os_spin_lock_magic_t old_irql;
                        word size;
                        diva_dbg_entry_head_t *pmsg;
-                       byte *pbuf = 0;
+                       byte *pbuf = NULL;
                        int written = 0;
 
                        if (mask < 4096) {
index 7dade2d8db959d2348595d12ffd329c241cc2464..e6016f92400dda79eadc902cc083345fbbf523d4 100644 (file)
@@ -17,7 +17,7 @@
 #include "mi_pc.h"
 #include "dsrv4bri.h"
 
-void *diva_xdiLoadFileFile = 0;
+void *diva_xdiLoadFileFile = NULL;
 dword diva_xdiLoadFileLength = 0;
 
 /*
@@ -268,7 +268,7 @@ int diva_4bri_init_card(diva_os_xdi_adapter_t * a)
                     (diva_os_xdi_adapter_t *) diva_os_malloc(0, sizeof(*a))))
                {
                        diva_os_free(0, a->slave_adapters[0]);
-                       a->slave_adapters[0] = 0;
+                       a->slave_adapters[0] = NULL;
                        diva_4bri_cleanup_adapter(a);
                        return (-1);
                }
@@ -277,8 +277,8 @@ int diva_4bri_init_card(diva_os_xdi_adapter_t * a)
                {
                        diva_os_free(0, a->slave_adapters[0]);
                        diva_os_free(0, a->slave_adapters[1]);
-                       a->slave_adapters[0] = 0;
-                       a->slave_adapters[1] = 0;
+                       a->slave_adapters[0] = NULL;
+                       a->slave_adapters[1] = NULL;
                        diva_4bri_cleanup_adapter(a);
                        return (-1);
                }
@@ -300,7 +300,7 @@ int diva_4bri_init_card(diva_os_xdi_adapter_t * a)
        if (!(a->slave_list = quadro_list)) {
                for (i = 0; i < (tasks - 1); i++) {
                        diva_os_free(0, a->slave_adapters[i]);
-                       a->slave_adapters[i] = 0;
+                       a->slave_adapters[i] = NULL;
                }
                diva_4bri_cleanup_adapter(a);
                return (-1);
@@ -499,7 +499,7 @@ static int diva_4bri_cleanup_adapter(diva_os_xdi_adapter_t * a)
                            && a->resources.pci.addr[bar]) {
                                divasa_unmap_pci_bar(a->resources.pci.addr[bar]);
                                a->resources.pci.bar[bar] = 0;
-                               a->resources.pci.addr[bar] = 0;
+                               a->resources.pci.addr[bar] = NULL;
                        }
                }
        }
@@ -515,12 +515,12 @@ static int diva_4bri_cleanup_adapter(diva_os_xdi_adapter_t * a)
                                         _4bri_bar_length[1],
                                         &a->port_name[0], 1);
                a->resources.pci.bar[1] = 0;
-               a->resources.pci.addr[1] = 0;
+               a->resources.pci.addr[1] = NULL;
        }
 
        if (a->slave_list) {
                diva_os_free(0, a->slave_list);
-               a->slave_list = 0;
+               a->slave_list = NULL;
        }
 
        return (0);
@@ -607,14 +607,14 @@ static int diva_4bri_cleanup_slave_adapters(diva_os_xdi_adapter_t * a)
 
                        diva_os_remove_soft_isr(&diva_current->xdi_adapter.
                                                req_soft_isr);
-                       diva_current->xdi_adapter.isr_soft_isr.object = 0;
+                       diva_current->xdi_adapter.isr_soft_isr.object = NULL;
 
                        if (diva_current->xdi_adapter.e_tbl) {
                                diva_os_free(0,
                                             diva_current->xdi_adapter.
                                             e_tbl);
                        }
-                       diva_current->xdi_adapter.e_tbl = 0;
+                       diva_current->xdi_adapter.e_tbl = NULL;
                        diva_current->xdi_adapter.e_max = 0;
                        diva_current->xdi_adapter.e_count = 0;
                }
@@ -823,7 +823,7 @@ void *xdiLoadFile(char *FileName, unsigned long *FileLength,
        if (FileLength) {
                *FileLength = diva_xdiLoadFileLength;
        }
-       diva_xdiLoadFileFile = 0;
+       diva_xdiLoadFileFile = NULL;
        diva_xdiLoadFileLength = 0;
 
        return (ret);
@@ -848,7 +848,7 @@ diva_4bri_write_fpga_image(diva_os_xdi_adapter_t * a, byte * data,
 
        ret = qBri_FPGA_download(&a->xdi_adapter);
 
-       diva_xdiLoadFileFile = 0;
+       diva_xdiLoadFileFile = NULL;
        diva_xdiLoadFileLength = 0;
 
        return (ret ? 0 : -1);
@@ -1116,7 +1116,7 @@ static int diva_4bri_stop_adapter(diva_os_xdi_adapter_t * a)
 
        if (a->clear_interrupts_proc) {
                diva_4bri_clear_interrupts(a);
-               a->clear_interrupts_proc = 0;
+               a->clear_interrupts_proc = NULL;
                DBG_ERR(("A: A(%d) no final interrupt from 4BRI adapter",
                         IoAdapter->ANum))
        }
index b2acc3fd8bebf9e32a3d32795d4621500d6cadc0..e8f023d2df8982782c3bc207316ce3ed77dd096f 100644 (file)
@@ -282,7 +282,7 @@ static int diva_bri_cleanup_adapter(diva_os_xdi_adapter_t * a)
 
        if (a->resources.pci.addr[0] && a->resources.pci.bar[0]) {
                divasa_unmap_pci_bar(a->resources.pci.addr[0]);
-               a->resources.pci.addr[0] = 0;
+               a->resources.pci.addr[0] = NULL;
                a->resources.pci.bar[0] = 0;
        }
 
@@ -293,7 +293,7 @@ static int diva_bri_cleanup_adapter(diva_os_xdi_adapter_t * a)
                                                 a->resources.pci.
                                                 length[i],
                                                 &a->port_name[0], i);
-                       a->resources.pci.addr[i] = 0;
+                       a->resources.pci.addr[i] = NULL;
                        a->resources.pci.bar[i] = 0;
                }
        }
@@ -305,7 +305,7 @@ static int diva_bri_cleanup_adapter(diva_os_xdi_adapter_t * a)
        diva_os_cancel_soft_isr(&a->xdi_adapter.isr_soft_isr);
 
        diva_os_remove_soft_isr(&a->xdi_adapter.req_soft_isr);
-       a->xdi_adapter.isr_soft_isr.object = 0;
+       a->xdi_adapter.isr_soft_isr.object = NULL;
 
        diva_os_destroy_spin_lock(&a->xdi_adapter.isr_spin_lock, "rm");
        diva_os_destroy_spin_lock(&a->xdi_adapter.data_spin_lock, "rm");
@@ -315,7 +315,7 @@ static int diva_bri_cleanup_adapter(diva_os_xdi_adapter_t * a)
         */
        if (a->xdi_adapter.e_tbl) {
                diva_os_free(0, a->xdi_adapter.e_tbl);
-               a->xdi_adapter.e_tbl = 0;
+               a->xdi_adapter.e_tbl = NULL;
        }
 
        return (0);
@@ -367,7 +367,7 @@ static int diva_bri_reregister_io(diva_os_xdi_adapter_t * a)
                diva_os_register_io_port(a, 0, a->resources.pci.bar[i],
                                         a->resources.pci.length[i],
                                         &a->port_name[0], i);
-               a->resources.pci.addr[i] = 0;
+               a->resources.pci.addr[i] = NULL;
        }
 
        sprintf(a->port_name, "DIVA BRI %ld",
@@ -797,7 +797,7 @@ static int diva_bri_stop_adapter(diva_os_xdi_adapter_t * a)
        } while (i-- && a->clear_interrupts_proc);
        if (a->clear_interrupts_proc) {
                diva_bri_clear_interrupts(a);
-               a->clear_interrupts_proc = 0;
+               a->clear_interrupts_proc = NULL;
                DBG_ERR(("A: A(%d) no final interrupt from BRI adapter",
                         IoAdapter->ANum))
        }
index 0fafdc154d2555fe6c9c13f09b4711c1297a8010..28e9df236ca4c1ea2300d228d5b201f567bf191f 100644 (file)
@@ -283,7 +283,7 @@ static int diva_pri_cleanup_adapter(diva_os_xdi_adapter_t * a)
                    && a->resources.pci.addr[bar]) {
                        divasa_unmap_pci_bar(a->resources.pci.addr[bar]);
                        a->resources.pci.bar[bar] = 0;
-                       a->resources.pci.addr[bar] = 0;
+                       a->resources.pci.addr[bar] = NULL;
                }
        }
 
@@ -294,7 +294,7 @@ static int diva_pri_cleanup_adapter(diva_os_xdi_adapter_t * a)
        diva_os_cancel_soft_isr(&a->xdi_adapter.req_soft_isr);
 
        diva_os_remove_soft_isr(&a->xdi_adapter.req_soft_isr);
-       a->xdi_adapter.isr_soft_isr.object = 0;
+       a->xdi_adapter.isr_soft_isr.object = NULL;
 
        diva_os_destroy_spin_lock(&a->xdi_adapter.isr_spin_lock, "rm");
        diva_os_destroy_spin_lock(&a->xdi_adapter.data_spin_lock, "rm");
@@ -304,7 +304,7 @@ static int diva_pri_cleanup_adapter(diva_os_xdi_adapter_t * a)
         */
        if (a->xdi_adapter.e_tbl) {
                diva_os_free(0, a->xdi_adapter.e_tbl);
-               a->xdi_adapter.e_tbl = 0;
+               a->xdi_adapter.e_tbl = NULL;
        }
        a->xdi_adapter.Channels = 0;
        a->xdi_adapter.e_max = 0;
@@ -316,7 +316,7 @@ static int diva_pri_cleanup_adapter(diva_os_xdi_adapter_t * a)
        diva_free_dma_map(a->resources.pci.hdev,
                          (struct _diva_dma_map_entry *) a->xdi_adapter.
                          dma_map);
-       a->xdi_adapter.dma_map = 0;
+       a->xdi_adapter.dma_map = NULL;
 
 
        /*
@@ -576,7 +576,7 @@ static int diva_pri_stop_adapter(diva_os_xdi_adapter_t * a)
 
        if (a->clear_interrupts_proc) {
                diva_pri_clear_interrupts(a);
-               a->clear_interrupts_proc = 0;
+               a->clear_interrupts_proc = NULL;
                DBG_ERR(("A: A(%d) no final interrupt from PRI adapter",
                         IoAdapter->ANum))
        }
index decb8989c34c4c1e73c565023eaa041ec48b141e..6563db998d061388afea1eda81f68af3fcd43838 100644 (file)
@@ -188,9 +188,9 @@ static void cleanup_adapter(diva_um_idi_adapter_t * a)
    ------------------------------------------------------------------------ */
 static void cleanup_entity(divas_um_idi_entity_t * e)
 {
-       e->os_ref = 0;
+       e->os_ref = NULL;
        e->status = 0;
-       e->adapter = 0;
+       e->adapter = NULL;
        e->e.Id = 0;
        e->rc_count = 0;
 
@@ -218,20 +218,20 @@ void *divas_um_idi_create_entity(dword adapter_nr, void *file)
                     diva_os_malloc(0, diva_os_get_context_size()))) {
                        DBG_LOG(("E(%08x) no memory for os context", e));
                        diva_os_free(0, e);
-                       return (0);
+                       return NULL;
                }
                memset(e->os_context, 0x00, diva_os_get_context_size());
 
                if ((diva_data_q_init(&e->data, 2048 + 512, 16))) {
                        diva_os_free(0, e->os_context);
                        diva_os_free(0, e);
-                       return (0);
+                       return NULL;
                }
                if ((diva_data_q_init(&e->rc, sizeof(diva_um_idi_ind_hdr_t), 2))) {
                        diva_data_q_finit(&e->data);
                        diva_os_free(0, e->os_context);
                        diva_os_free(0, e);
-                       return (0);
+                       return NULL;
                }
 
                diva_os_enter_spin_lock(&adapter_lock, &old_irql, "create_entity");
@@ -250,7 +250,7 @@ void *divas_um_idi_create_entity(dword adapter_nr, void *file)
                        diva_os_free(0, e->os_context);
                        diva_os_free(0, e);
 
-                       return (0);
+                       return NULL;
                }
 
                e->os_ref = file;       /* link to os handle */
@@ -608,9 +608,9 @@ static int process_idi_request(divas_um_idi_entity_t * e,
                        e->e.IndCh = 0;
                        e->e.XNum = 0;
                        e->e.RNum = 0;
-                       e->e.callback = 0;
-                       e->e.X = 0;
-                       e->e.R = 0;
+                       e->e.callback = NULL;
+                       e->e.X = NULL;
+                       e->e.R = NULL;
                        write_return_code(e, ASSIGN_RC | OUT_OF_RESOURCES);
                        return (-2);
                } else {
@@ -631,7 +631,7 @@ static int process_idi_rc(divas_um_idi_entity_t * e, byte rc)
                if (rc != ASSIGN_OK) {
                        DBG_ERR(("A: A(%d) E(%08x) ASSIGN failed",
                                 e->adapter->adapter_nr, e));
-                       e->e.callback = 0;
+                       e->e.callback = NULL;
                        e->e.Id = 0;
                        e->e.Req = 0;
                        e->e.ReqCh = 0;
@@ -639,8 +639,8 @@ static int process_idi_rc(divas_um_idi_entity_t * e, byte rc)
                        e->e.RcCh = 0;
                        e->e.Ind = 0;
                        e->e.IndCh = 0;
-                       e->e.X = 0;
-                       e->e.R = 0;
+                       e->e.X = NULL;
+                       e->e.R = NULL;
                        e->e.XNum = 0;
                        e->e.RNum = 0;
                }
@@ -651,7 +651,7 @@ static int process_idi_rc(divas_um_idi_entity_t * e, byte rc)
                return (0);     /* let us do it in the driver */
        }
        if ((e->e.Req == REMOVE) && (!e->e.Id)) {       /* REMOVE COMPLETE */
-               e->e.callback = 0;
+               e->e.callback = NULL;
                e->e.Id = 0;
                e->e.Req = 0;
                e->e.ReqCh = 0;
@@ -659,8 +659,8 @@ static int process_idi_rc(divas_um_idi_entity_t * e, byte rc)
                e->e.RcCh = 0;
                e->e.Ind = 0;
                e->e.IndCh = 0;
-               e->e.X = 0;
-               e->e.R = 0;
+               e->e.X = NULL;
+               e->e.R = NULL;
                e->e.XNum = 0;
                e->e.RNum = 0;
                e->rc_count = 0;
index b3a26ffd5dedc984d59119384a7b737adeb4ecab..ace5093d042d43160f32f7798a3318a3a52dab9a 100644 (file)
@@ -1586,7 +1586,7 @@ int hisax_register(struct hisax_d_if *hisax_d_if, struct hisax_b_if *b_if[],
        cards[i].protocol = protocol;
        sprintf(id, "%s%d", name, i);
        nrcards++;
-       retval = checkcard(i, id, 0, hisax_d_if->owner);
+       retval = checkcard(i, id, NULL, hisax_d_if->owner);
        if (retval == 0) { // yuck
                cards[i].typ = 0;
                nrcards--;
index 7471d4b87330eba76b039882cf0135aef64e815e..843ed75f82c2ea89a89aaf65a9d24fa5101d1598 100644 (file)
@@ -1158,7 +1158,7 @@ ready:
                cs->writeisacfifo = &MemWriteISACfifo_IPACX;
                cs->BC_Read_Reg  = &MemReadHSCX_IPACX;
                cs->BC_Write_Reg = &MemWriteHSCX_IPACX;
-               cs->BC_Send_Data = 0; // function located in ipacx module
+               cs->BC_Send_Data = NULL; // function located in ipacx module
                cs->irq_func = &diva_irq_ipacx_pci;
                printk(KERN_INFO "Diva: IPACX Design Id: %x\n", 
                        MemReadISAC_IPACX(cs, IPACX_ID) &0x3F);
index 479164b3a213c6f3adaae49360cfd63ba878a7f5..689c83395693a9d2ccc3ba124f302a4597244b86 100644 (file)
@@ -401,7 +401,7 @@ static void rs_interrupt_elsa(int irq, struct IsdnCardState *cs)
                if (status & UART_LSR_DR)
                        receive_chars(cs, &status);
                if (status & UART_LSR_THRE)
-                       transmit_chars(cs, 0);
+                       transmit_chars(cs, NULL);
                if (pass_counter++ > RS_ISR_PASS_LIMIT) {
                        printk("rs_single loop break.\n");
                        break;
index c95d91d58c1dcdcf83bcb5718ca6d6a7319109c8..4490c883f7559f92848520ab2470b34467b36061 100644 (file)
@@ -133,7 +133,7 @@ static const char *hfcusb_revision = "4.0";
 /**********/
 /* macros */
 /**********/
-#define write_usb(a,b,c) usb_control_msg((a)->dev,(a)->ctrl_out_pipe,0,0x40,(c),(b),0,0,HFC_CTRL_TIMEOUT)
+#define write_usb(a,b,c) usb_control_msg((a)->dev,(a)->ctrl_out_pipe,0,0x40,(c),(b),NULL,0,HFC_CTRL_TIMEOUT)
 #define read_usb(a,b,c) usb_control_msg((a)->dev,(a)->ctrl_in_pipe,1,0xC0,0,(b),(c),1,HFC_CTRL_TIMEOUT)
 
 /*************************************************/
@@ -353,7 +353,7 @@ vendor_data vdata[]=
        {0x8e3, 0x0301, "Olitec USB RNIS",              LED_SCHEME1,  LED_NORMAL,   {2,0,1,4}},           /* Olitec TA  */
        {0x675, 0x1688, "DrayTec USB ISDN TA",          LED_SCHEME1,  LED_NORMAL,   {4,0,2,1}},           /* Draytec TA */
        {0x7fa, 0x0846, "Bewan Modem RNIS USB",         LED_SCHEME1,  LED_INVERTED, {8,0x40,0x20,0x10}},  /* Bewan TA   */
-       {0,0,0}                    // EOL element
+       {0}                        // EOL element
 };
                                                                                
 /***************************************************/
index 30143651666b224d0c114330ca0ebf3dbfad9c5f..6056ac1d767326844f3e0eb9b4cd0997cffc3544 100644 (file)
@@ -239,7 +239,7 @@ tei_id_remove(struct FsmInst *fi, int event, void *arg)
        if ((st->l2.tei != -1) && ((tei == GROUP_TEI) || (tei == st->l2.tei))) {
                FsmDelTimer(&st->ma.t202, 5);
                FsmChangeState(&st->ma.tei_m, ST_TEI_NOP);
-               st->l3.l3l2(st, MDL_REMOVE | REQUEST, 0);
+               st->l3.l3l2(st, MDL_REMOVE | REQUEST, NULL);
                cs = (struct IsdnCardState *) st->l1.hardware;
                cs->cardmsg(cs, MDL_REMOVE | REQUEST, NULL);
        }
@@ -275,7 +275,7 @@ tei_id_req_tout(struct FsmInst *fi, int event, void *arg)
                FsmAddTimer(&st->ma.t202, st->ma.T202, EV_T202, NULL, 3);
        } else {
                st->ma.tei_m.printdebug(&st->ma.tei_m, "assign req failed");
-               st->l3.l3l2(st, MDL_ERROR | RESPONSE, 0);
+               st->l3.l3l2(st, MDL_ERROR | RESPONSE, NULL);
                cs = (struct IsdnCardState *) st->l1.hardware;
                cs->cardmsg(cs, MDL_REMOVE | REQUEST, NULL);
                FsmChangeState(fi, ST_TEI_NOP);
@@ -298,7 +298,7 @@ tei_id_ver_tout(struct FsmInst *fi, int event, void *arg)
        } else {
                st->ma.tei_m.printdebug(&st->ma.tei_m,
                        "verify req for tei %d failed", st->l2.tei);
-               st->l3.l3l2(st, MDL_REMOVE | REQUEST, 0);
+               st->l3.l3l2(st, MDL_REMOVE | REQUEST, NULL);
                cs = (struct IsdnCardState *) st->l1.hardware;
                cs->cardmsg(cs, MDL_REMOVE | REQUEST, NULL);
                FsmChangeState(fi, ST_TEI_NOP);
index bace9a557ed929276e06aa40ac3518cfbfc79e09..2e21ba46a7b885956c57f976ea1c0944cbb19e91 100644 (file)
@@ -959,7 +959,7 @@ isdn_read(struct file *file, char __user *buf, size_t count, loff_t * off)
                        interruptible_sleep_on(&(dev->info_waitq));
                }
                p = isdn_statstr();
-               file->private_data = 0;
+               file->private_data = NULL;
                if ((len = strlen(p)) <= count) {
                        if (copy_to_user(buf, p, len)) {
                                retval = -EFAULT;
@@ -992,7 +992,7 @@ isdn_read(struct file *file, char __user *buf, size_t count, loff_t * off)
                        retval = -ENOMEM;
                        goto out;
                }
-               len = isdn_readbchan(drvidx, chidx, p, 0, count,
+               len = isdn_readbchan(drvidx, chidx, p, NULL, count,
                                     &dev->drv[drvidx]->rcv_waitq[chidx]);
                *off += len;
                if (copy_to_user(buf,p,len)) 
index 87015695256d980fb6088e30f6556685dabdea83..443cb25e12703345f568b7afd20bfd40c77e9eff 100644 (file)
@@ -396,8 +396,8 @@ isdn_net_stat_callback(int idx, isdn_ctrl *c)
        if (p) {
                isdn_net_local *lp = p->local;
 #ifdef CONFIG_ISDN_X25
-               struct concap_proto *cprot = lp -> netdev -> cprot;
-               struct concap_proto_ops *pops = cprot ? cprot -> pops : 0;
+               struct concap_proto *cprot = lp->netdev->cprot;
+               struct concap_proto_ops *pops = cprot ? cprot->pops : NULL;
 #endif
                switch (cmd) {
                        case ISDN_STAT_BSENT:
@@ -617,7 +617,7 @@ isdn_net_dial(void)
                                                s = "dial suppressed: isdn system stopped";
                                        else
                                                s = "dial suppressed: dialmode `off'";
-                                       isdn_net_unreachable(&p->dev, 0, s);
+                                       isdn_net_unreachable(&p->dev, NULL, s);
                                        isdn_net_hangup(&p->dev);
                                        break;
                                }
@@ -645,7 +645,7 @@ isdn_net_dial(void)
                                                if (time_after(jiffies, lp->dialstarted + lp->dialtimeout)) {
                                                        lp->dialwait_timer = jiffies + lp->dialwait;
                                                        lp->dialstarted = 0;
-                                                       isdn_net_unreachable(&p->dev, 0, "dial: timed out");
+                                                       isdn_net_unreachable(&p->dev, NULL, "dial: timed out");
                                                        isdn_net_hangup(&p->dev);
                                                        break;
                                                }
@@ -675,7 +675,7 @@ isdn_net_dial(void)
                                                        if (lp->dialtimeout == 0) {
                                                                lp->dialwait_timer = jiffies + lp->dialwait;
                                                                lp->dialstarted = 0;
-                                                               isdn_net_unreachable(&p->dev, 0, "dial: tried all numbers dialmax times");
+                                                               isdn_net_unreachable(&p->dev, NULL, "dial: tried all numbers dialmax times");
                                                        }
                                                        isdn_net_hangup(&p->dev);
                                                        break;
@@ -827,8 +827,8 @@ isdn_net_hangup(struct net_device *d)
        isdn_net_local *lp = (isdn_net_local *) d->priv;
        isdn_ctrl cmd;
 #ifdef CONFIG_ISDN_X25
-       struct concap_proto *cprot = lp -> netdev -> cprot;
-       struct concap_proto_ops *pops = cprot ? cprot -> pops : 0;
+       struct concap_proto *cprot = lp->netdev->cprot;
+       struct concap_proto_ops *pops = cprot ? cprot->pops : NULL;
 #endif
 
        if (lp->flags & ISDN_NET_CONNECTED) {
@@ -1416,11 +1416,10 @@ isdn_net_ciscohdlck_alloc_skb(isdn_net_local *lp, int len)
        struct sk_buff *skb;
 
        skb = alloc_skb(hl + len, GFP_ATOMIC);
-       if (!skb) {
+       if (skb)
+               skb_reserve(skb, hl);
+       else 
                printk("isdn out of mem at %s:%d!\n", __FILE__, __LINE__);
-               return 0;
-       }
-       skb_reserve(skb, hl);
        return skb;
 }
 
@@ -2182,7 +2181,7 @@ isdn_net_find_icall(int di, int ch, int idx, setup_parm *setup)
                            *my_eaz == 'b' || *my_eaz == 'B')
                                 my_eaz++; /* skip to allow a match */
                         else
-                                my_eaz = 0; /* force non match */
+                                my_eaz = NULL; /* force non match */
                 } else { /* it's a DATA call, check if we allow it */
                         if (*my_eaz == 'b' || *my_eaz == 'B')
                                 my_eaz++; /* skip to allow a match */
index 3fc515dca012653e185c66f97d1b707ef486cf1f..d9768f000b79252ab5a380f39969cecb3977d107 100644 (file)
@@ -134,7 +134,7 @@ isdn_tty_readmodem(void)
                                                if (c > 0) {
                                                        r = isdn_readbchan(info->isdn_driver, info->isdn_channel,
                                                                           tty->flip.char_buf_ptr,
-                                                                          tty->flip.flag_buf_ptr, c, 0);
+                                                                          tty->flip.flag_buf_ptr, c, NULL);
                                                        /* CISCO AsyncPPP Hack */
                                                        if (!(info->emu.mdmreg[REG_CPPP] & BIT_CPPP))
                                                                memset(tty->flip.flag_buf_ptr, 0, r);
@@ -1751,7 +1751,7 @@ isdn_tty_close(struct tty_struct *tty, struct file *filp)
                tty->driver->flush_buffer(tty);
        if (tty->ldisc.flush_buffer)
                tty->ldisc.flush_buffer(tty);
-       info->tty = 0;
+       info->tty = NULL;
        info->ncarrier = 0;
        tty->closing = 0;
        module_put(info->owner);
@@ -1780,7 +1780,7 @@ isdn_tty_hangup(struct tty_struct *tty)
        isdn_tty_shutdown(info);
        info->count = 0;
        info->flags &= ~(ISDN_ASYNC_NORMAL_ACTIVE | ISDN_ASYNC_CALLOUT_ACTIVE);
-       info->tty = 0;
+       info->tty = NULL;
        wake_up_interruptible(&info->open_wait);
 }
 
@@ -1959,7 +1959,7 @@ isdn_tty_modem_init(void)
                isdn_tty_modem_reset_regs(info, 1);
                info->magic = ISDN_ASYNC_MAGIC;
                info->line = i;
-               info->tty = 0;
+               info->tty = NULL;
                info->x_char = 0;
                info->count = 0;
                info->blocked_open = 0;
@@ -2373,8 +2373,8 @@ isdn_tty_at_cout(char *msg, modem_info * info)
        char *p;
        char c;
        u_long flags;
-       struct sk_buff *skb = 0;
-       char *sp = 0;
+       struct sk_buff *skb = NULL;
+       char *sp = NULL;
 
        if (!msg) {
                printk(KERN_WARNING "isdn_tty: Null-Message in isdn_tty_at_cout\n");
index 1a0d6b8482dc7fe900cf735b2b1642cd02a780a9..c546ad3c81280315b43e449b2e87644d26fdbb70 100644 (file)
@@ -25,11 +25,11 @@ MODULE_LICENSE("GPL");
 MODULE_PARM(mem, "1-" __MODULE_STRING(MAX_PCBIT_CARDS) "i");
 MODULE_PARM(irq, "1-" __MODULE_STRING(MAX_PCBIT_CARDS) "i");
 
-static int mem[MAX_PCBIT_CARDS] = {0, };
-static int irq[MAX_PCBIT_CARDS] = {0, };
+static int mem[MAX_PCBIT_CARDS];
+static int irq[MAX_PCBIT_CARDS];
 
 static int num_boards;
-struct pcbit_dev * dev_pcbit[MAX_PCBIT_CARDS] = {0, };
+struct pcbit_dev * dev_pcbit[MAX_PCBIT_CARDS];
 
 extern void pcbit_terminate(int board);
 extern int pcbit_init_dev(int board, int mem_base, int irq);
index e37879a9acb557baf40a2ae5b8353f3421f7db06..b8844c98cd184799cc394d762d6cc4ff77618c64 100644 (file)
@@ -215,7 +215,7 @@ int startproc(int card)
                status = sendmessage(card, CMPID,cmReqType2,
                          cmReqClass0,
                          cmReqStartProc,
-                         0,0,0);
+                         0,0,NULL);
        pr_debug("%s: Sent startProc\n", sc_adapter[card]->devicename);
        
        return status;
index 70e0faadc906e78d433cd078e711b127fef71fc0..2cf7f00e6720eb4970933ef33d6f01f9c0151c50 100644 (file)
@@ -152,7 +152,7 @@ int sc_ioctl(int card, scs_ioctl *data)
                 * Get the switch type from the board
                 */
                status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0, 
-                       ceReqCallGetSwitchType, 0, 0, 0, rcvmsg, SAR_TIMEOUT);
+                       ceReqCallGetSwitchType, 0, 0, NULL, rcvmsg, SAR_TIMEOUT);
                if (!status && !(rcvmsg->rsp_status)) {
                        pr_debug("%s: SCIOCGETSWITCH: command successful\n",
                                        sc_adapter[card]->devicename);
@@ -193,7 +193,7 @@ int sc_ioctl(int card, scs_ioctl *data)
                 * Get the spid from the board
                 */
                status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0, ceReqCallGetSPID,
-                                       data->channel, 0, 0, rcvmsg, SAR_TIMEOUT);
+                                       data->channel, 0, NULL, rcvmsg, SAR_TIMEOUT);
                if (!status) {
                        pr_debug("%s: SCIOCGETSPID: command successful\n",
                                        sc_adapter[card]->devicename);
@@ -269,7 +269,7 @@ int sc_ioctl(int card, scs_ioctl *data)
                 * Get the dn from the board
                 */
                status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0, ceReqCallGetMyNumber,
-                                       data->channel, 0, 0, rcvmsg, SAR_TIMEOUT);
+                                       data->channel, 0, NULL, rcvmsg, SAR_TIMEOUT);
                if (!status) {
                        pr_debug("%s: SCIOCGETDN: command successful\n",
                                        sc_adapter[card]->devicename);
@@ -385,7 +385,7 @@ int sc_ioctl(int card, scs_ioctl *data)
                 * Get the speed from the board
                 */
                status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0, 
-                       ceReqCallGetCallType, data->channel, 0, 0, rcvmsg, SAR_TIMEOUT);
+                       ceReqCallGetCallType, data->channel, 0, NULL, rcvmsg, SAR_TIMEOUT);
                if (!status && !(rcvmsg->rsp_status)) {
                        pr_debug("%s: SCIOCGETSPEED: command successful\n",
                                sc_adapter[card]->devicename);