From: Eric Dumazet Date: Mon, 9 Nov 2009 18:07:28 +0000 (+0000) Subject: parisc: led: Use for_each_netdev_rcu() X-Git-Tag: firefly_0821_release~9833^2~3968^2~425 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=246c65add098a5ec14310ea17f39fdd57ff8407d;p=firefly-linux-kernel-4.4.55.git parisc: led: Use for_each_netdev_rcu() Use for_each_netdev_rcu() and dont lock dev_base_lock anymore Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller --- diff --git a/drivers/parisc/led.c b/drivers/parisc/led.c index 9581d3619450..79caf1ca4a29 100644 --- a/drivers/parisc/led.c +++ b/drivers/parisc/led.c @@ -352,11 +352,9 @@ static __inline__ int led_get_net_activity(void) rx_total = tx_total = 0; - /* we are running as a workqueue task, so locking dev_base - * for reading should be OK */ - read_lock(&dev_base_lock); + /* we are running as a workqueue task, so we can use an RCU lookup */ rcu_read_lock(); - for_each_netdev(&init_net, dev) { + for_each_netdev_rcu(&init_net, dev) { const struct net_device_stats *stats; struct in_device *in_dev = __in_dev_get_rcu(dev); if (!in_dev || !in_dev->ifa_list) @@ -368,7 +366,6 @@ static __inline__ int led_get_net_activity(void) tx_total += stats->tx_packets; } rcu_read_unlock(); - read_unlock(&dev_base_lock); retval = 0;