diff options
author | Li Zefan <lizf@cn.fujitsu.com> | 2008-02-08 04:19:24 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-08 09:22:29 -0800 |
commit | 0b858e6ff9a38b987a83d22e6f2a2f621c80608d (patch) | |
tree | 71bea1f83730b25ef1a18d56e9b5e69261b884c4 /kernel/time/clockevents.c | |
parent | 818c357802e2791880057fe752dc9ce9e210f772 (diff) |
clockevent: simplify list operations
list_for_each_safe() suffices here.
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: john stultz <johnstul@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/time/clockevents.c')
-rw-r--r-- | kernel/time/clockevents.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c index 3e59fce6dd4..1d327f6db42 100644 --- a/kernel/time/clockevents.c +++ b/kernel/time/clockevents.c @@ -218,6 +218,8 @@ void clockevents_exchange_device(struct clock_event_device *old, */ void clockevents_notify(unsigned long reason, void *arg) { + struct list_head *node, *tmp; + spin_lock(&clockevents_lock); clockevents_do_notify(reason, arg); @@ -227,13 +229,8 @@ void clockevents_notify(unsigned long reason, void *arg) * Unregister the clock event devices which were * released from the users in the notify chain. */ - while (!list_empty(&clockevents_released)) { - struct clock_event_device *dev; - - dev = list_entry(clockevents_released.next, - struct clock_event_device, list); - list_del(&dev->list); - } + list_for_each_safe(node, tmp, &clockevents_released) + list_del(node); break; default: break; |