]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/isdn/capi/capidrv.c
Merge branch 'linus' into pci-for-jesse
[linux-2.6-omap-h63xx.git] / drivers / isdn / capi / capidrv.c
index 48c1775ef5b3de68404f90649b3ea9ede2d30d8a..d5b4cc357a3c77dff03b704070063e2bed0ac11c 100644 (file)
@@ -335,7 +335,7 @@ static capidrv_plci *new_plci(capidrv_contr * card, int chan)
 
        plcip = kzalloc(sizeof(capidrv_plci), GFP_ATOMIC);
 
-       if (plcip == 0)
+       if (plcip == NULL)
                return NULL;
 
        plcip->state = ST_PLCI_NONE;
@@ -404,7 +404,7 @@ static inline capidrv_ncci *new_ncci(capidrv_contr * card,
 
        nccip = kzalloc(sizeof(capidrv_ncci), GFP_ATOMIC);
 
-       if (nccip == 0)
+       if (nccip == NULL)
                return NULL;
 
        nccip->ncci = ncci;
@@ -426,7 +426,7 @@ static inline capidrv_ncci *find_ncci(capidrv_contr * card, u32 ncci)
        capidrv_plci *plcip;
        capidrv_ncci *p;
 
-       if ((plcip = find_plci_by_ncci(card, ncci)) == 0)
+       if ((plcip = find_plci_by_ncci(card, ncci)) == NULL)
                return NULL;
 
        for (p = plcip->ncci_list; p; p = p->next)
@@ -441,7 +441,7 @@ static inline capidrv_ncci *find_ncci_by_msgid(capidrv_contr * card,
        capidrv_plci *plcip;
        capidrv_ncci *p;
 
-       if ((plcip = find_plci_by_ncci(card, ncci)) == 0)
+       if ((plcip = find_plci_by_ncci(card, ncci)) == NULL)
                return NULL;
 
        for (p = plcip->ncci_list; p; p = p->next)
@@ -755,7 +755,7 @@ static inline int new_bchan(capidrv_contr * card)
 {
        int i;
        for (i = 0; i < card->nbchan; i++) {
-               if (card->bchans[i].plcip == 0) {
+               if (card->bchans[i].plcip == NULL) {
                        card->bchans[i].disconnecting = 0;
                        return i;
                }
@@ -877,7 +877,7 @@ static void handle_incoming_call(capidrv_contr * card, _cmsg * cmsg)
                return;
        }
        bchan = &card->bchans[chan];
-       if ((plcip = new_plci(card, chan)) == 0) {
+       if ((plcip = new_plci(card, chan)) == NULL) {
                printk(KERN_ERR "capidrv-%d: incoming call: no memory, sorry.\n", card->contrnr);
                return;
        }
@@ -1388,12 +1388,12 @@ static void capidrv_recv_message(struct capi20_appl *ap, struct sk_buff *skb)
                _cdebbuf *cdb = capi_cmsg2str(&s_cmsg);
 
                if (cdb) {
-                       printk(KERN_DEBUG "%s: applid=%d %s\n", __FUNCTION__,
+                       printk(KERN_DEBUG "%s: applid=%d %s\n", __func__,
                                ap->applid, cdb->buf);
                        cdebbuf_free(cdb);
                } else
                        printk(KERN_DEBUG "%s: applid=%d %s not traced\n",
-                               __FUNCTION__, ap->applid,
+                               __func__, ap->applid,
                                capi_cmd2str(s_cmsg.Command, s_cmsg.Subcommand));
        }
        if (s_cmsg.Command == CAPI_DATA_B3
@@ -1661,7 +1661,7 @@ static int capidrv_command(isdn_ctrl * c, capidrv_contr * card)
                                              NULL,     /* Useruserdata */
                                              NULL      /* Facilitydataarray */
                            );
-                       if ((plcip = new_plci(card, (c->arg % card->nbchan))) == 0) {
+                       if ((plcip = new_plci(card, (c->arg % card->nbchan))) == NULL) {
                                cmd.command = ISDN_STAT_DHUP;
                                cmd.driver = card->myid;
                                cmd.arg = (c->arg % card->nbchan);
@@ -1966,7 +1966,7 @@ static void enable_dchannel_trace(capidrv_contr *card)
                        card->name, errcode);
           return;
        }
-       if (strstr(manufacturer, "AVM") == 0) {
+       if (strstr(manufacturer, "AVM") == NULL) {
           printk(KERN_ERR "%s: not from AVM, no d-channel trace possible (%s)\n",
                        card->name, manufacturer);
           return;
@@ -2291,10 +2291,10 @@ static int __init capidrv_init(void)
        u32 ncontr, contr;
        u16 errcode;
 
-       if ((p = strchr(revision, ':')) != 0 && p[1]) {
+       if ((p = strchr(revision, ':')) != NULL && p[1]) {
                strncpy(rev, p + 2, sizeof(rev));
                rev[sizeof(rev)-1] = 0;
-               if ((p = strchr(rev, '$')) != 0 && p > rev)
+               if ((p = strchr(rev, '$')) != NULL && p > rev)
                   *(p-1) = 0;
        } else
                strcpy(rev, "1.0");
@@ -2332,13 +2332,14 @@ static int __init capidrv_init(void)
 
 static void __exit capidrv_exit(void)
 {
-       char rev[10];
+       char rev[32];
        char *p;
 
-       if ((p = strchr(revision, ':')) != 0) {
-               strcpy(rev, p + 1);
-               p = strchr(rev, '$');
-               *p = 0;
+       if ((p = strchr(revision, ':')) != NULL) {
+               strncpy(rev, p + 1, sizeof(rev));
+               rev[sizeof(rev)-1] = 0;
+               if ((p = strchr(rev, '$')) != NULL)
+                       *p = 0;
        } else {
                strcpy(rev, " ??? ");
        }