aboutsummaryrefslogtreecommitdiff
path: root/qemu-timer.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-09-19 15:52:44 +0200
committerStefan Hajnoczi <stefanha@gmail.com>2012-09-23 07:11:29 +0100
commit144b97c26cdef7fecd62dae2db6ce312cd493751 (patch)
tree0c20892fe9e783961b475ff9f3e2985d136122b8 /qemu-timer.c
parentc10600af60865ba6c60987be313102ebb5fcee57 (diff)
qemu-timer: simplify qemu_run_timers
ptimer_head is an invariant pointer to clock->active_timers. Remove it, and just reference clock->active_timers directly. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Diffstat (limited to 'qemu-timer.c')
-rw-r--r--qemu-timer.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/qemu-timer.c b/qemu-timer.c
index c7a1551a36..908a1030b6 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) */