From cb8f1478cea68bc9c9bca8bded9617d9b0b7beb6 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Fri, 31 May 2019 18:27:08 +0200 Subject: 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 Signed-off-by: David S. Miller --- drivers/net/wan/hdlc_cisco.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'drivers/net/wan') diff --git a/drivers/net/wan/hdlc_cisco.c b/drivers/net/wan/hdlc_cisco.c index 320039d329c7..4976ca3f30c7 100644 --- a/drivers/net/wan/hdlc_cisco.c +++ b/drivers/net/wan/hdlc_cisco.c @@ -196,16 +196,15 @@ static int cisco_rx(struct sk_buff *skb) mask = ~cpu_to_be32(0); /* is the mask correct? */ if (in_dev != NULL) { - struct in_ifaddr **ifap = &in_dev->ifa_list; + const struct in_ifaddr *ifa; - while (*ifap != NULL) { + in_dev_for_each_ifa_rcu(ifa, in_dev) { if (strcmp(dev->name, - (*ifap)->ifa_label) == 0) { - addr = (*ifap)->ifa_local; - mask = (*ifap)->ifa_mask; + ifa->ifa_label) == 0) { + addr = ifa->ifa_local; + mask = ifa->ifa_mask; break; } - ifap = &(*ifap)->ifa_next; } cisco_keepalive_send(dev, CISCO_ADDR_REPLY, -- cgit v1.2.3