]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
timer: use an inline function for free
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Fri, 27 Jan 2017 08:54:50 +0000 (12:54 +0400)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Tue, 28 Feb 2017 20:09:28 +0000 (00:09 +0400)
Similarly to allocation, do it from an inline function. This allows
tests to only use the headers for allocation/free of timer.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
include/qemu/timer.h
util/qemu-timer.c

index 9abed51ae85fd6e97669f7fc4fad1db73019982b..26e628584c30762f804c6c59ceab0d482a8d478d 100644 (file)
@@ -610,7 +610,10 @@ void timer_deinit(QEMUTimer *ts);
  *
  * Free a timer (it must not be on the active list)
  */
-void timer_free(QEMUTimer *ts);
+static inline void timer_free(QEMUTimer *ts)
+{
+    g_free(ts);
+}
 
 /**
  * timer_del:
index ff620ecff7d87e885da66e70bf4c822f06cb5254..6cf70b96f6336f97514fbfa402cedcc13a44ba1a 100644 (file)
@@ -355,11 +355,6 @@ void timer_deinit(QEMUTimer *ts)
     ts->timer_list = NULL;
 }
 
-void timer_free(QEMUTimer *ts)
-{
-    g_free(ts);
-}
-
 static void timer_del_locked(QEMUTimerList *timer_list, QEMUTimer *ts)
 {
     QEMUTimer **pt, *t;