diff options
author | Wang Chen <wangchen@cn.fujitsu.com> | 2008-11-13 02:39:10 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-13 02:39:10 -0500 |
commit | 524ad0a79126efabf58d0a49eace6155ab5b4549 (patch) | |
tree | 927e79d7d28d2c563c5beba74f06527df564e31c /net/bridge | |
parent | 8f15ea42b64941001a401cf855a0869e24f3a845 (diff) |
netdevice: safe convert to netdev_priv() #part-4
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 'net/bridge')
-rw-r--r-- | net/bridge/br_if.c | 2 | ||||
-rw-r--r-- | net/bridge/br_sysfs_br.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c index 0a09ccf68c1c..ee3a8dd13f55 100644 --- a/net/bridge/br_if.c +++ b/net/bridge/br_if.c | |||
@@ -460,7 +460,7 @@ void br_net_exit(struct net *net) | |||
460 | restart: | 460 | restart: |
461 | for_each_netdev(net, dev) { | 461 | for_each_netdev(net, dev) { |
462 | if (dev->priv_flags & IFF_EBRIDGE) { | 462 | if (dev->priv_flags & IFF_EBRIDGE) { |
463 | del_br(dev->priv); | 463 | del_br(netdev_priv(dev)); |
464 | goto restart; | 464 | goto restart; |
465 | } | 465 | } |
466 | } | 466 | } |
diff --git a/net/bridge/br_sysfs_br.c b/net/bridge/br_sysfs_br.c index 158dee8b4965..603d89248e71 100644 --- a/net/bridge/br_sysfs_br.c +++ b/net/bridge/br_sysfs_br.c | |||
@@ -22,7 +22,7 @@ | |||
22 | #include "br_private.h" | 22 | #include "br_private.h" |
23 | 23 | ||
24 | #define to_dev(obj) container_of(obj, struct device, kobj) | 24 | #define to_dev(obj) container_of(obj, struct device, kobj) |
25 | #define to_bridge(cd) ((struct net_bridge *)(to_net_dev(cd)->priv)) | 25 | #define to_bridge(cd) ((struct net_bridge *)netdev_priv(to_net_dev(cd))) |
26 | 26 | ||
27 | /* | 27 | /* |
28 | * Common code for storing bridge parameters. | 28 | * Common code for storing bridge parameters. |