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>
This commit is contained in:

committed by
David S. Miller

parent
cd5a411dba
commit
cb8f1478ce
@@ -3248,6 +3248,7 @@ netxen_config_indev_addr(struct netxen_adapter *adapter,
|
||||
struct net_device *dev, unsigned long event)
|
||||
{
|
||||
struct in_device *indev;
|
||||
struct in_ifaddr *ifa;
|
||||
|
||||
if (!netxen_destip_supported(adapter))
|
||||
return;
|
||||
@@ -3256,7 +3257,8 @@ netxen_config_indev_addr(struct netxen_adapter *adapter,
|
||||
if (!indev)
|
||||
return;
|
||||
|
||||
for_ifa(indev) {
|
||||
rcu_read_lock();
|
||||
in_dev_for_each_ifa_rcu(ifa, indev) {
|
||||
switch (event) {
|
||||
case NETDEV_UP:
|
||||
netxen_list_config_ip(adapter, ifa, NX_IP_UP);
|
||||
@@ -3267,8 +3269,8 @@ netxen_config_indev_addr(struct netxen_adapter *adapter,
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} endfor_ifa(indev);
|
||||
|
||||
}
|
||||
rcu_read_unlock();
|
||||
in_dev_put(indev);
|
||||
}
|
||||
|
||||
|
@@ -4119,13 +4119,14 @@ static void
|
||||
qlcnic_config_indev_addr(struct qlcnic_adapter *adapter,
|
||||
struct net_device *dev, unsigned long event)
|
||||
{
|
||||
const struct in_ifaddr *ifa;
|
||||
struct in_device *indev;
|
||||
|
||||
indev = in_dev_get(dev);
|
||||
if (!indev)
|
||||
return;
|
||||
|
||||
for_ifa(indev) {
|
||||
in_dev_for_each_ifa_rtnl(ifa, indev) {
|
||||
switch (event) {
|
||||
case NETDEV_UP:
|
||||
qlcnic_config_ipaddr(adapter,
|
||||
@@ -4138,7 +4139,7 @@ qlcnic_config_indev_addr(struct qlcnic_adapter *adapter,
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} endfor_ifa(indev);
|
||||
}
|
||||
|
||||
in_dev_put(indev);
|
||||
}
|
||||
|
Reference in New Issue
Block a user