diff options
author | David Ahern <dsa@cumulusnetworks.com> | 2016-10-17 19:15:45 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-10-18 11:44:58 -0400 |
commit | b3208b2024c9089106df52ae25ebf39068d6f9fc (patch) | |
tree | f9c367022cb271f70f5ac414da790d43db529a95 /drivers/net/bonding/bond_main.c | |
parent | 1a3f060c1a47dba4e12ac21ce62b57666b9c4e95 (diff) | |
download | linux-b3208b2024c9089106df52ae25ebf39068d6f9fc.tar.gz linux-b3208b2024c9089106df52ae25ebf39068d6f9fc.tar.bz2 linux-b3208b2024c9089106df52ae25ebf39068d6f9fc.zip |
net: bonding: Flip to the new dev walk API
Convert alb_send_learning_packets and bond_has_this_ip to use the new
netdev_walk_all_upper_dev_rcu API. In both cases this is just a code
conversion; no functional change is intended.
v2
- removed typecast of data and simplified bond_upper_dev_walk
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding/bond_main.c')
-rw-r--r-- | drivers/net/bonding/bond_main.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 5fa36ebc0640..c9944d86d045 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -2270,22 +2270,23 @@ re_arm: } } +static int bond_upper_dev_walk(struct net_device *upper, void *data) +{ + __be32 ip = *((__be32 *)data); + + return ip == bond_confirm_addr(upper, 0, ip); +} + static bool bond_has_this_ip(struct bonding *bond, __be32 ip) { - struct net_device *upper; - struct list_head *iter; bool ret = false; if (ip == bond_confirm_addr(bond->dev, 0, ip)) return true; rcu_read_lock(); - netdev_for_each_all_upper_dev_rcu(bond->dev, upper, iter) { - if (ip == bond_confirm_addr(upper, 0, ip)) { - ret = true; - break; - } - } + if (netdev_walk_all_upper_dev_rcu(bond->dev, bond_upper_dev_walk, &ip)) + ret = true; rcu_read_unlock(); return ret; |