]> err.no Git - linux-2.6/blobdiff - drivers/net/wan/cycx_x25.c
Pull osi into release branch
[linux-2.6] / drivers / net / wan / cycx_x25.c
index 5b48cd8568f51bd757913cae533d9239f6fa8e86..a8af28b273d3f162f2394698990891713b57cbab 100644 (file)
@@ -78,6 +78,7 @@
 
 #define CYCLOMX_X25_DEBUG 1
 
+#include <linux/ctype.h>       /* isdigit() */
 #include <linux/errno.h>       /* return codes */
 #include <linux/if_arp.h>       /* ARPHRD_HWX25 */
 #include <linux/kernel.h>      /* printk(), and other useful stuff */
@@ -375,11 +376,10 @@ static int cycx_wan_new_if(struct wan_device *wandev, struct net_device *dev,
        }
 
        /* allocate and initialize private data */
-       chan = kmalloc(sizeof(struct cycx_x25_channel), GFP_KERNEL);
+       chan = kzalloc(sizeof(struct cycx_x25_channel), GFP_KERNEL);
        if (!chan)
                return -ENOMEM;
 
-       memset(chan, 0, sizeof(*chan));
        strcpy(chan->name, conf->name);
        chan->card = card;
        chan->link = conf->port;
@@ -418,7 +418,7 @@ static int cycx_wan_new_if(struct wan_device *wandev, struct net_device *dev,
 
                /* Set channel timeouts (default if not specified) */
                chan->idle_tmout = conf->idle_timeout ? conf->idle_timeout : 90;
-       } else if (is_digit(conf->addr[0])) {   /* PVC */
+       } else if (isdigit(conf->addr[0])) {    /* PVC */
                s16 lcn = dec_to_uint(conf->addr, 0);
 
                if (lcn >= card->u.x.lo_pvc && lcn <= card->u.x.hi_pvc)
@@ -436,9 +436,7 @@ static int cycx_wan_new_if(struct wan_device *wandev, struct net_device *dev,
        }
 
        if (err) {
-               if (chan->local_addr)
-                       kfree(chan->local_addr);
-
+               kfree(chan->local_addr);
                kfree(chan);
                return err;
        }
@@ -458,9 +456,7 @@ static int cycx_wan_del_if(struct wan_device *wandev, struct net_device *dev)
                struct cycx_x25_channel *chan = dev->priv;
 
                if (chan->svc) {
-                       if (chan->local_addr)
-                               kfree(chan->local_addr);
-
+                       kfree(chan->local_addr);
                        if (chan->state == WAN_CONNECTED)
                                del_timer(&chan->timer);
                }
@@ -837,7 +833,7 @@ static void cycx_x25_irq_rx(struct cycx_device *card, struct cycx_x25_cmd *cmd)
        ++chan->ifstats.rx_packets;
        chan->ifstats.rx_bytes += pktlen;
 
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
        netif_rx(skb);
        dev->last_rx = jiffies;         /* timestamp */
 }
@@ -1535,7 +1531,7 @@ static unsigned dec_to_uint(u8 *str, int len)
        if (!len)
                len = strlen(str);
 
-       for (; len && is_digit(*str); ++str, --len)
+       for (; len && isdigit(*str); ++str, --len)
                val = (val * 10) + (*str - (unsigned) '0');
 
        return val;