diff options
author | Amerigo Wang <amwang@redhat.com> | 2012-08-09 21:24:44 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-08-14 17:33:31 -0400 |
commit | 4e3828c4bfd90b00a951cad7c8da27d1966beefe (patch) | |
tree | 032e34b6d572d279c9f015816bb674257e0b4ad0 /net/bridge | |
parent | d30362c0712eb567334b3b66de7c40d4372f2c6f (diff) |
bridge: use list_for_each_entry() in netpoll functions
We don't delete 'p' from the list in the loop,
so we can just use list_for_each_entry().
Cc: David Miller <davem@davemloft.net>
Cc: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Cong Wang <amwang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge')
-rw-r--r-- | net/bridge/br_device.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c index f41ba4048c9a..32211fa5b506 100644 --- a/net/bridge/br_device.c +++ b/net/bridge/br_device.c | |||
@@ -206,21 +206,20 @@ static void br_poll_controller(struct net_device *br_dev) | |||
206 | static void br_netpoll_cleanup(struct net_device *dev) | 206 | static void br_netpoll_cleanup(struct net_device *dev) |
207 | { | 207 | { |
208 | struct net_bridge *br = netdev_priv(dev); | 208 | struct net_bridge *br = netdev_priv(dev); |
209 | struct net_bridge_port *p, *n; | 209 | struct net_bridge_port *p; |
210 | 210 | ||
211 | list_for_each_entry_safe(p, n, &br->port_list, list) { | 211 | list_for_each_entry(p, &br->port_list, list) |
212 | br_netpoll_disable(p); | 212 | br_netpoll_disable(p); |
213 | } | ||
214 | } | 213 | } |
215 | 214 | ||
216 | static int br_netpoll_setup(struct net_device *dev, struct netpoll_info *ni, | 215 | static int br_netpoll_setup(struct net_device *dev, struct netpoll_info *ni, |
217 | gfp_t gfp) | 216 | gfp_t gfp) |
218 | { | 217 | { |
219 | struct net_bridge *br = netdev_priv(dev); | 218 | struct net_bridge *br = netdev_priv(dev); |
220 | struct net_bridge_port *p, *n; | 219 | struct net_bridge_port *p; |
221 | int err = 0; | 220 | int err = 0; |
222 | 221 | ||
223 | list_for_each_entry_safe(p, n, &br->port_list, list) { | 222 | list_for_each_entry(p, &br->port_list, list) { |
224 | if (!p->dev) | 223 | if (!p->dev) |
225 | continue; | 224 | continue; |
226 | err = br_netpoll_enable(p, gfp); | 225 | err = br_netpoll_enable(p, gfp); |