#define MAX_DO_DEV_PER_LOOP 100
int do_dev = MAX_DO_DEV_PER_LOOP;
- struct net_device *dev;
- LIST_HEAD(wrk);
/* Give urgent case more budget */
if (urgent_only)
clear_bit(LW_URGENT, &linkwatch_flags);
spin_lock_irq(&lweventlist_lock);
- list_splice_init(&lweventlist, &wrk);
+ while (!list_empty(&lweventlist) && do_dev > 0) {
+ struct net_device *dev;
- while (!list_empty(&wrk) && do_dev > 0) {
-
- dev = list_first_entry(&wrk, struct net_device, link_watch_list);
+ dev = list_first_entry(&lweventlist, struct net_device,
+ link_watch_list);
list_del_init(&dev->link_watch_list);
if (!netif_device_present(dev) ||
spin_lock_irq(&lweventlist_lock);
}
- /* Add the remaining work back to lweventlist */
- list_splice_init(&wrk, &lweventlist);
-
if (!list_empty(&lweventlist))
linkwatch_schedule_work(0);
spin_unlock_irq(&lweventlist_lock);