* [PATCH 2/6] clockevent: simplify list operations
@ 2007-11-29 7:35 Li Zefan
0 siblings, 0 replies; only message in thread
From: Li Zefan @ 2007-11-29 7:35 UTC (permalink / raw)
To: Andrew Morton; +Cc: LKML, tglx
list_for_each_safe() suffices here.
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
---
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 822beeb..68fbe73 100644
--- a/kernel/time/clockevents.c
+++ b/kernel/time/clockevents.c
@@ -200,6 +200,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);
@@ -209,13 +211,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;
--
1.5.3.rc7
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2007-11-29 7:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-29 7:35 [PATCH 2/6] clockevent: simplify list operations Li Zefan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).