[PATCH 10/13] clockevent: use list_move() instead of list_del()/list_add() combination

From: Kirill A. Shutemov
Date: Tue Mar 15 2011 - 18:54:17 EST


Signed-off-by: Kirill A. Shutemov <kirill@xxxxxxxxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
---
kernel/time/clockevents.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c
index d7395fd..b1fa45d 100644
--- a/kernel/time/clockevents.c
+++ b/kernel/time/clockevents.c
@@ -168,8 +168,7 @@ static void clockevents_notify_released(void)
while (!list_empty(&clockevents_released)) {
dev = list_entry(clockevents_released.next,
struct clock_event_device, list);
- list_del(&dev->list);
- list_add(&dev->list, &clockevent_devices);
+ list_move(&dev->list, &clockevent_devices);
clockevents_do_notify(CLOCK_EVT_NOTIFY_ADD, dev);
}
}
@@ -221,8 +220,7 @@ void clockevents_exchange_device(struct clock_event_device *old,
*/
if (old) {
clockevents_set_mode(old, CLOCK_EVT_MODE_UNUSED);
- list_del(&old->list);
- list_add(&old->list, &clockevents_released);
+ list_move(&old->list, &clockevents_released);
}

if (new) {
--
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/