qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Anthony Liguori <aliguori@us.ibm.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@gmail.com>
Subject: [Qemu-devel] [PATCH 11/14] qemu-timer: simplify qemu_run_timers
Date: Sun, 23 Sep 2012 11:00:17 +0100	[thread overview]
Message-ID: <1348394420-28298-12-git-send-email-stefanha@gmail.com> (raw)
In-Reply-To: <1348394420-28298-1-git-send-email-stefanha@gmail.com>

From: Paolo Bonzini <pbonzini@redhat.com>

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>
---
 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

  parent reply	other threads:[~2012-09-23 10:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-23 10:00 [Qemu-devel] [PULL 00/14] Trivial patches for 15 to 23 September 2012 Stefan Hajnoczi
2012-09-23 10:00 ` [Qemu-devel] [PATCH 01/14] target-i386: Allow tsc-frequency to be larger then 2.147G Stefan Hajnoczi
2012-09-23 10:00 ` [Qemu-devel] [PATCH 02/14] qemu-ga: Remove unreachable code after g_error Stefan Hajnoczi
2012-09-23 10:00 ` [Qemu-devel] [PATCH 03/14] qemu-sockets: Fix potential memory leak Stefan Hajnoczi
2012-09-23 10:00 ` [Qemu-devel] [PATCH 04/14] cadence_uart: Fix buffer overflow Stefan Hajnoczi
2012-09-23 10:00 ` [Qemu-devel] [PATCH 05/14] lm4549: " Stefan Hajnoczi
2012-09-23 10:00 ` [Qemu-devel] [PATCH 06/14] ioh3420: Remove unreachable code Stefan Hajnoczi
2012-09-23 10:00 ` [Qemu-devel] [PATCH 07/14] pflash_cfi01: Fix warning caused by " Stefan Hajnoczi
2012-09-23 10:00 ` [Qemu-devel] [PATCH 08/14] dtrace backend: add function to reserved words Stefan Hajnoczi
2012-09-23 10:00 ` [Qemu-devel] [PATCH 09/14] curses: don't initialize curses when qemu is daemonized Stefan Hajnoczi
2012-09-23 10:00 ` [Qemu-devel] [PATCH 10/14] TextConsole: saturate escape parameter in TTY_STATE_CSI Stefan Hajnoczi
2012-09-23 10:00 ` Stefan Hajnoczi [this message]
2012-09-23 10:00 ` [Qemu-devel] [PATCH 12/14] linux-user: Remove redundant null check and replace free by g_free Stefan Hajnoczi
2012-09-23 10:00 ` [Qemu-devel] [PATCH 13/14] net/socket: Fix compiler warning (regression for MinGW) Stefan Hajnoczi
2012-09-23 10:00 ` [Qemu-devel] [PATCH 14/14] w32: Always use standard instead of native format strings Stefan Hajnoczi
2012-09-25 23:26 ` [Qemu-devel] [PULL 00/14] Trivial patches for 15 to 23 September 2012 Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1348394420-28298-12-git-send-email-stefanha@gmail.com \
    --to=stefanha@gmail.com \
    --cc=aliguori@us.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).