From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59933) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TFizY-0004SH-2R for qemu-devel@nongnu.org; Sun, 23 Sep 2012 06:00:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TFizX-0007iE-4E for qemu-devel@nongnu.org; Sun, 23 Sep 2012 06:00:47 -0400 Received: from mail-we0-f173.google.com ([74.125.82.173]:56749) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TFizW-0007Xh-U1 for qemu-devel@nongnu.org; Sun, 23 Sep 2012 06:00:47 -0400 Received: by mail-we0-f173.google.com with SMTP id t11so2574474wey.4 for ; Sun, 23 Sep 2012 03:00:46 -0700 (PDT) From: Stefan Hajnoczi Date: Sun, 23 Sep 2012 11:00:17 +0100 Message-Id: <1348394420-28298-12-git-send-email-stefanha@gmail.com> In-Reply-To: <1348394420-28298-1-git-send-email-stefanha@gmail.com> References: <1348394420-28298-1-git-send-email-stefanha@gmail.com> Subject: [Qemu-devel] [PATCH 11/14] qemu-timer: simplify qemu_run_timers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Paolo Bonzini , qemu-devel@nongnu.org, Stefan Hajnoczi From: Paolo Bonzini ptimer_head is an invariant pointer to clock->active_timers. Remove it, and just reference clock->active_timers directly. Signed-off-by: Paolo Bonzini Signed-off-by: Stefan Hajnoczi --- qemu-timer.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/qemu-timer.c b/qemu-timer.c index c7a1551..908a103 100644 --- a/qemu-timer.c +++ b/qemu-timer.c @@ -372,21 +372,20 @@ bool qemu_timer_expired(QEMUTimer *timer_head, int64_t current_time) void qemu_run_timers(QEMUClock *clock) { - QEMUTimer **ptimer_head, *ts; + QEMUTimer *ts; int64_t current_time; if (!clock->enabled) return; current_time = qemu_get_clock_ns(clock); - ptimer_head = &clock->active_timers; for(;;) { - ts = *ptimer_head; + ts = clock->active_timers; if (!qemu_timer_expired_ns(ts, current_time)) { break; } /* remove timer from the list before calling the callback */ - *ptimer_head = ts->next; + clock->active_timers = ts->next; ts->next = NULL; /* run the callback (the timer list can be modified) */ -- 1.7.10.4