ns8320: use netdev_alloc_skb
authorStephen Hemminger <shemminger@vyatta.com>
Wed, 16 Apr 2008 23:37:35 +0000 (16:37 -0700)
committerJeff Garzik <jgarzik@redhat.com>
Sat, 31 May 2008 02:19:22 +0000 (22:19 -0400)
Use netdev_alloc_skb. This sets skb->dev and allows arch specific
allocation.

Compile tested only.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/net/ns83820.c

index b42c05f84be15d78d59600362f7e8f8f5e0837d0..ff449619f047e57fd36be41805b33bf6b66ec113 100644 (file)
@@ -585,16 +585,13 @@ static inline int rx_refill(struct net_device *ndev, gfp_t gfp)
        for (i=0; i<NR_RX_DESC; i++) {
                struct sk_buff *skb;
                long res;
+
                /* extra 16 bytes for alignment */
-               skb = __dev_alloc_skb(REAL_RX_BUF_SIZE+16, gfp);
+               skb = __netdev_alloc_skb(ndev, REAL_RX_BUF_SIZE+16, gfp);
                if (unlikely(!skb))
                        break;
 
-               res = (long)skb->data & 0xf;
-               res = 0x10 - res;
-               res &= 0xf;
-               skb_reserve(skb, res);
-
+               skb_reserve(skb, skb->data - PTR_ALIGN(skb->data, 16));
                if (gfp != GFP_ATOMIC)
                        spin_lock_irqsave(&dev->rx_info.lock, flags);
                res = ns83820_add_rx_skb(dev, skb);