From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ME8ol-0007e0-Br for qemu-devel@nongnu.org; Tue, 09 Jun 2009 17:25:15 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ME8og-0007am-Bx for qemu-devel@nongnu.org; Tue, 09 Jun 2009 17:25:14 -0400 Received: from [199.232.76.173] (port=43479 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ME8og-0007aZ-5I for qemu-devel@nongnu.org; Tue, 09 Jun 2009 17:25:10 -0400 Received: from mx2.redhat.com ([66.187.237.31]:39283) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1ME8of-0003C9-Kl for qemu-devel@nongnu.org; Tue, 09 Jun 2009 17:25:09 -0400 Date: Tue, 9 Jun 2009 18:24:57 -0300 From: Luiz Capitulino Message-ID: <20090609182457.2d7a22dc@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH] Fix "defined but not used" warning List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com The function qemu_calculate_timeout() is only used when CONFIG_IOTHREAD is not defined. When CONFIG_IOTHREAD is defined, we have the following warning: vl.c:4389: warning: =E2=80=98qemu_calculate_timeout=E2=80=99 defined but no= t used This change fixes that by moving the #ifdef/#endif from main_loop() into qemu_calculate_timeout(). This encapsulates the logic and allow us to use qemu_calculate_timeout() when CONFIG_IOTHREAD is defined or not (suggested by Glauber Costa). Signed-off-by: Luiz Capitulino --- vl.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/vl.c b/vl.c index f08f0f3..69a9f91 100644 --- a/vl.c +++ b/vl.c @@ -4388,6 +4388,7 @@ static int tcg_has_work(void) =20 static int qemu_calculate_timeout(void) { +#ifndef CONFIG_IOTHREAD int timeout; =20 if (!vm_running) @@ -4433,6 +4434,9 @@ static int qemu_calculate_timeout(void) } =20 return timeout; +#else /* CONFIG_IOTHREAD */ + return 1000; +#endif } =20 static int vm_can_run(void) @@ -4468,11 +4472,7 @@ static void main_loop(void) #ifdef CONFIG_PROFILER ti =3D profile_getclock(); #endif -#ifdef CONFIG_IOTHREAD - main_loop_wait(1000); -#else main_loop_wait(qemu_calculate_timeout()); -#endif #ifdef CONFIG_PROFILER dev_time +=3D profile_getclock() - ti; #endif --=20 1.6.3.GIT --=20 Luiz