From 454d7c9b14e20fd1949e2686e9de4a2926e01476 Mon Sep 17 00:00:00 2001 From: Wang Chen Date: Wed, 12 Nov 2008 23:37:49 -0800 Subject: netdevice: safe convert to netdev_priv() #part-1 We have some reasons to kill netdev->priv: 1. netdev->priv is equal to netdev_priv(). 2. netdev_priv() wraps the calculation of netdev->priv's offset, obviously netdev_priv() is more flexible than netdev->priv. But we cann't kill netdev->priv, because so many drivers reference to it directly. This patch is a safe convert for netdev->priv to netdev_priv(netdev). Since all of the netdev->priv is only for read. But it is too big to be sent in one mail. I split it to 4 parts and make every part smaller than 100,000 bytes, which is max size allowed by vger. Signed-off-by: Wang Chen Signed-off-by: David S. Miller --- drivers/net/appletalk/ipddp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/net/appletalk/ipddp.c') diff --git a/drivers/net/appletalk/ipddp.c b/drivers/net/appletalk/ipddp.c index 1071144edd66..9a0be9b2eaad 100644 --- a/drivers/net/appletalk/ipddp.c +++ b/drivers/net/appletalk/ipddp.c @@ -108,7 +108,7 @@ static struct net_device * __init ipddp_init(void) */ static struct net_device_stats *ipddp_get_stats(struct net_device *dev) { - return dev->priv; + return netdev_priv(dev); } /* @@ -170,8 +170,8 @@ static int ipddp_xmit(struct sk_buff *skb, struct net_device *dev) skb->protocol = htons(ETH_P_ATALK); /* Protocol has changed */ - ((struct net_device_stats *) dev->priv)->tx_packets++; - ((struct net_device_stats *) dev->priv)->tx_bytes+=skb->len; + ((struct net_device_stats *) netdev_priv(dev))->tx_packets++; + ((struct net_device_stats *) netdev_priv(dev))->tx_bytes += skb->len; if(aarp_send_ddp(rt->dev, skb, &rt->at, NULL) < 0) dev_kfree_skb(skb); -- cgit v1.2.3-59-g8ed1b