diff options
author | Florian Westphal <fw@strlen.de> | 2019-05-31 19:27:08 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-06-03 04:06:26 +0300 |
commit | cb8f1478cea68bc9c9bca8bded9617d9b0b7beb6 (patch) | |
tree | 3c21f50e4bf992a2b691aabed609488143b5113a /drivers/infiniband/hw/i40iw | |
parent | cd5a411dbaeb9fd70e2a8241a74b6f52a1a572ca (diff) | |
download | linux-cb8f1478cea68bc9c9bca8bded9617d9b0b7beb6.tar.xz |
drivers: use in_dev_for_each_ifa_rtnl/rcu
Like previous patches, use the new iterator macros to avoid sparse
warnings once proper __rcu annotations are added.
Compile tested only.
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/infiniband/hw/i40iw')
-rw-r--r-- | drivers/infiniband/hw/i40iw/i40iw_cm.c | 7 | ||||
-rw-r--r-- | drivers/infiniband/hw/i40iw/i40iw_main.c | 6 |
2 files changed, 9 insertions, 4 deletions
diff --git a/drivers/infiniband/hw/i40iw/i40iw_cm.c b/drivers/infiniband/hw/i40iw/i40iw_cm.c index 8233f5a4e623..700a5d06b60c 100644 --- a/drivers/infiniband/hw/i40iw/i40iw_cm.c +++ b/drivers/infiniband/hw/i40iw/i40iw_cm.c @@ -1773,8 +1773,11 @@ static enum i40iw_status_code i40iw_add_mqh_4( if ((((rdma_vlan_dev_vlan_id(dev) < I40IW_NO_VLAN) && (rdma_vlan_dev_real_dev(dev) == iwdev->netdev)) || (dev == iwdev->netdev)) && (dev->flags & IFF_UP)) { + const struct in_ifaddr *ifa; + idev = in_dev_get(dev); - for_ifa(idev) { + + in_dev_for_each_ifa_rtnl(ifa, idev) { i40iw_debug(&iwdev->sc_dev, I40IW_DEBUG_CM, "Allocating child CM Listener forIP=%pI4, vlan_id=%d, MAC=%pM\n", @@ -1819,7 +1822,7 @@ static enum i40iw_status_code i40iw_add_mqh_4( cm_parent_listen_node->cm_core->stats_listen_nodes_created--; } } - endfor_ifa(idev); + in_dev_put(idev); } } diff --git a/drivers/infiniband/hw/i40iw/i40iw_main.c b/drivers/infiniband/hw/i40iw/i40iw_main.c index 10932baee279..d44cf33df81a 100644 --- a/drivers/infiniband/hw/i40iw/i40iw_main.c +++ b/drivers/infiniband/hw/i40iw/i40iw_main.c @@ -1222,8 +1222,10 @@ static void i40iw_add_ipv4_addr(struct i40iw_device *iwdev) if ((((rdma_vlan_dev_vlan_id(dev) < 0xFFFF) && (rdma_vlan_dev_real_dev(dev) == iwdev->netdev)) || (dev == iwdev->netdev)) && (dev->flags & IFF_UP)) { + const struct in_ifaddr *ifa; + idev = in_dev_get(dev); - for_ifa(idev) { + in_dev_for_each_ifa_rtnl(ifa, idev) { i40iw_debug(&iwdev->sc_dev, I40IW_DEBUG_CM, "IP=%pI4, vlan_id=%d, MAC=%pM\n", &ifa->ifa_address, rdma_vlan_dev_vlan_id(dev), dev->dev_addr); @@ -1235,7 +1237,7 @@ static void i40iw_add_ipv4_addr(struct i40iw_device *iwdev) true, I40IW_ARP_ADD); } - endfor_ifa(idev); + in_dev_put(idev); } } |