aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2009-11-09 13:07:28 -0500
committerDavid S. Miller <davem@davemloft.net>2009-11-10 23:54:43 -0500
commit246c65add098a5ec14310ea17f39fdd57ff8407d (patch)
tree93bb9ab5df89b2aa0d5d1ce1dd04e82f6c1c14d5 /drivers
parent292f4f3ce4b57f17a667cb34c72bca081dcc0281 (diff)
parisc: led: Use for_each_netdev_rcu()
Use for_each_netdev_rcu() and dont lock dev_base_lock anymore Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/parisc/led.c7
1 files changed, 2 insertions, 5 deletions
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)
352 352
353 rx_total = tx_total = 0; 353 rx_total = tx_total = 0;
354 354
355 /* we are running as a workqueue task, so locking dev_base 355 /* we are running as a workqueue task, so we can use an RCU lookup */
356 * for reading should be OK */
357 read_lock(&dev_base_lock);
358 rcu_read_lock(); 356 rcu_read_lock();
359 for_each_netdev(&init_net, dev) { 357 for_each_netdev_rcu(&init_net, dev) {
360 const struct net_device_stats *stats; 358 const struct net_device_stats *stats;
361 struct in_device *in_dev = __in_dev_get_rcu(dev); 359 struct in_device *in_dev = __in_dev_get_rcu(dev);
362 if (!in_dev || !in_dev->ifa_list) 360 if (!in_dev || !in_dev->ifa_list)
@@ -368,7 +366,6 @@ static __inline__ int led_get_net_activity(void)
368 tx_total += stats->tx_packets; 366 tx_total += stats->tx_packets;
369 } 367 }
370 rcu_read_unlock(); 368 rcu_read_unlock();
371 read_unlock(&dev_base_lock);
372 369
373 retval = 0; 370 retval = 0;
374 371