Skip to content

Commit

Permalink
parisc: led: Use for_each_netdev_rcu()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Nov 11, 2009
1 parent 292f4f3 commit 246c65a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/parisc/led.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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;

Expand Down

0 comments on commit 246c65a

Please sign in to comment.