diff options
author | Wang Chen <wangchen@cn.fujitsu.com> | 2008-11-13 02:37:49 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-13 02:37:49 -0500 |
commit | 454d7c9b14e20fd1949e2686e9de4a2926e01476 (patch) | |
tree | fae8bd1bfb5fd496977a0639ad71c54a2ee278ae /drivers/net/bonding/bond_3ad.c | |
parent | 7a12122c7a00347da9669cfcde82954c9e3d6f5e (diff) |
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 <wangchen@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding/bond_3ad.c')
-rw-r--r-- | drivers/net/bonding/bond_3ad.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c index ba1372f2f144..78f645d6471a 100644 --- a/drivers/net/bonding/bond_3ad.c +++ b/drivers/net/bonding/bond_3ad.c | |||
@@ -2426,7 +2426,7 @@ int bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info) | |||
2426 | int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev) | 2426 | int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev) |
2427 | { | 2427 | { |
2428 | struct slave *slave, *start_at; | 2428 | struct slave *slave, *start_at; |
2429 | struct bonding *bond = dev->priv; | 2429 | struct bonding *bond = netdev_priv(dev); |
2430 | int slave_agg_no; | 2430 | int slave_agg_no; |
2431 | int slaves_in_agg; | 2431 | int slaves_in_agg; |
2432 | int agg_id; | 2432 | int agg_id; |
@@ -2506,7 +2506,7 @@ out: | |||
2506 | 2506 | ||
2507 | int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type* ptype, struct net_device *orig_dev) | 2507 | int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type* ptype, struct net_device *orig_dev) |
2508 | { | 2508 | { |
2509 | struct bonding *bond = dev->priv; | 2509 | struct bonding *bond = netdev_priv(dev); |
2510 | struct slave *slave = NULL; | 2510 | struct slave *slave = NULL; |
2511 | int ret = NET_RX_DROP; | 2511 | int ret = NET_RX_DROP; |
2512 | 2512 | ||
@@ -2517,7 +2517,8 @@ int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct net_device *dev, struct pac | |||
2517 | goto out; | 2517 | goto out; |
2518 | 2518 | ||
2519 | read_lock(&bond->lock); | 2519 | read_lock(&bond->lock); |
2520 | slave = bond_get_slave_by_dev((struct bonding *)dev->priv, orig_dev); | 2520 | slave = bond_get_slave_by_dev((struct bonding *)netdev_priv(dev), |
2521 | orig_dev); | ||
2521 | if (!slave) | 2522 | if (!slave) |
2522 | goto out_unlock; | 2523 | goto out_unlock; |
2523 | 2524 | ||