提交 4e3828c4 编写于 作者: A Amerigo Wang 提交者: David S. Miller

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: NCong Wang <amwang@redhat.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 d30362c0
......@@ -206,21 +206,20 @@ static void br_poll_controller(struct net_device *br_dev)
static void br_netpoll_cleanup(struct net_device *dev)
{
struct net_bridge *br = netdev_priv(dev);
struct net_bridge_port *p, *n;
struct net_bridge_port *p;
list_for_each_entry_safe(p, n, &br->port_list, list) {
list_for_each_entry(p, &br->port_list, list)
br_netpoll_disable(p);
}
}
static int br_netpoll_setup(struct net_device *dev, struct netpoll_info *ni,
gfp_t gfp)
{
struct net_bridge *br = netdev_priv(dev);
struct net_bridge_port *p, *n;
struct net_bridge_port *p;
int err = 0;
list_for_each_entry_safe(p, n, &br->port_list, list) {
list_for_each_entry(p, &br->port_list, list) {
if (!p->dev)
continue;
err = br_netpoll_enable(p, gfp);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册