perf_counter: use list_move_tail()
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Fri, 13 Mar 2009 11:21:29 +0000 (12:21 +0100)
committerIngo Molnar <mingo@elte.hu>
Mon, 6 Apr 2009 07:29:31 +0000 (09:29 +0200)
Instead of del/add use a move list-op.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/perf_counter.c

index b2e838959f3e46b1c850170596632bbe2f07cc62..0fe22c916e29401f9c1170f29c32bfefcd73e7f6 100644 (file)
@@ -89,8 +89,7 @@ list_del_counter(struct perf_counter *counter, struct perf_counter_context *ctx)
        list_for_each_entry_safe(sibling, tmp,
                                 &counter->sibling_list, list_entry) {
 
-               list_del_init(&sibling->list_entry);
-               list_add_tail(&sibling->list_entry, &ctx->counter_list);
+               list_move_tail(&sibling->list_entry, &ctx->counter_list);
                sibling->group_leader = sibling;
        }
 }
@@ -959,8 +958,7 @@ static void rotate_ctx(struct perf_counter_context *ctx)
         */
        perf_flags = hw_perf_save_disable();
        list_for_each_entry(counter, &ctx->counter_list, list_entry) {
-               list_del(&counter->list_entry);
-               list_add_tail(&counter->list_entry, &ctx->counter_list);
+               list_move_tail(&counter->list_entry, &ctx->counter_list);
                break;
        }
        hw_perf_restore(perf_flags);