Re: [PATCH] netdev/ethernet: dev_alloc_skb to netdev_alloc_skb

From: Eric Dumazet
Date: Mon Jan 23 2012 - 04:45:29 EST


Le dimanche 22 janvier 2012 Ã 02:27 +0530, Pradeep A. Dalvi a Ãcrit :
> Replaced deprecating dev_alloc_skb with netdev_alloc_skb in drivers/net/ethernet
>

...


> diff --git a/drivers/net/ethernet/3com/3c515.c b/drivers/net/ethernet/3com/3c515.c
> index f67a5d3..68fd765 100644
> --- a/drivers/net/ethernet/3com/3c515.c
> +++ b/drivers/net/ethernet/3com/3c515.c
> @@ -826,7 +826,7 @@ static int corkscrew_open(struct net_device *dev)
> vp->rx_ring[i].next = 0;
> vp->rx_ring[i].status = 0; /* Clear complete bit. */
> vp->rx_ring[i].length = PKT_BUF_SZ | 0x80000000;
> - skb = dev_alloc_skb(PKT_BUF_SZ);
> + skb = netdev_alloc_skb(dev, PKT_BUF_SZ);
> vp->rx_skbuff[i] = skb;
> if (skb == NULL)
> break; /* Bad news! */


One of the difference between netdev_alloc_skb() and dev_alloc_skb() is
the former initializes skb->dev.

So you should remove the extra "skb->dev = dev;" lines that sometimes
are after the dev_alloc_skb() calls.

[ They were redundant anyway because eth_type_trans() also sets skb->dev
]



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/