* [Qemu-devel] [PATCH]: Fix "defined but not used" warning
@ 2009-06-04 18:29 Luiz Capitulino
0 siblings, 0 replies; 5+ messages in thread
From: Luiz Capitulino @ 2009-06-04 18:29 UTC (permalink / raw)
To: qemu-devel; +Cc: aliguori, glommer
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: ‘qemu_calculate_timeout’ defined but not 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 <lcapitulino@redhat.com>
diff --git a/vl.c b/vl.c
index fcf8532..9e5cf4c 100644
--- a/vl.c
+++ b/vl.c
@@ -4388,6 +4388,7 @@ static int tcg_has_work(void)
static int qemu_calculate_timeout(void)
{
+#ifndef CONFIG_IOTHREAD
int timeout;
if (!vm_running)
@@ -4433,6 +4434,9 @@ static int qemu_calculate_timeout(void)
}
return timeout;
+#else /* CONFIG_IOTHREAD */
+ return 1000;
+#endif
}
static int vm_can_run(void)
@@ -4468,11 +4472,7 @@ static void main_loop(void)
#ifdef CONFIG_PROFILER
ti = profile_getclock();
#endif
-#ifdef CONFIG_IOTHREAD
- main_loop_wait(1000);
-#else
main_loop_wait(qemu_calculate_timeout());
-#endif
#ifdef CONFIG_PROFILER
dev_time += profile_getclock() - ti;
#endif
--
Luiz
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] Fix "defined but not used" warning
2009-06-09 21:24 [Qemu-devel] [PATCH] " Luiz Capitulino
2009-06-09 21:53 ` Mark McLoughlin
2009-06-10 0:30 ` Marcelo Tosatti
@ 2009-06-10 17:00 ` Blue Swirl
2 siblings, 0 replies; 5+ messages in thread
From: Blue Swirl @ 2009-06-10 17:00 UTC (permalink / raw)
To: Luiz Capitulino; +Cc: aliguori, qemu-devel
On 6/10/09, Luiz Capitulino <lcapitulino@redhat.com> wrote:
>
> 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: ‘qemu_calculate_timeout’ defined but not 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 <lcapitulino@redhat.com>
Thanks, applied.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] Fix "defined but not used" warning
2009-06-09 21:24 [Qemu-devel] [PATCH] " Luiz Capitulino
2009-06-09 21:53 ` Mark McLoughlin
@ 2009-06-10 0:30 ` Marcelo Tosatti
2009-06-10 17:00 ` Blue Swirl
2 siblings, 0 replies; 5+ messages in thread
From: Marcelo Tosatti @ 2009-06-10 0:30 UTC (permalink / raw)
To: Luiz Capitulino; +Cc: aliguori, qemu-devel
On Tue, Jun 09, 2009 at 06:24:57PM -0300, Luiz Capitulino wrote:
>
> 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: ‘qemu_calculate_timeout’ defined but not 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).
ACK
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] Fix "defined but not used" warning
2009-06-09 21:24 [Qemu-devel] [PATCH] " Luiz Capitulino
@ 2009-06-09 21:53 ` Mark McLoughlin
2009-06-10 0:30 ` Marcelo Tosatti
2009-06-10 17:00 ` Blue Swirl
2 siblings, 0 replies; 5+ messages in thread
From: Mark McLoughlin @ 2009-06-09 21:53 UTC (permalink / raw)
To: Luiz Capitulino; +Cc: aliguori, qemu-devel
On Tue, 2009-06-09 at 18:24 -0300, Luiz Capitulino wrote:
> 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: ‘qemu_calculate_timeout’ defined but not 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 <lcapitulino@redhat.com>
Looks correct and is a good cleanup too. Moves us closer to being able
to build with --enable-werror always :-)
Reviewed-by: Mark McLoughlin <markmc@redhat.com>
Cheers,
Mark.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Qemu-devel] [PATCH] Fix "defined but not used" warning
@ 2009-06-09 21:24 Luiz Capitulino
2009-06-09 21:53 ` Mark McLoughlin
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Luiz Capitulino @ 2009-06-09 21:24 UTC (permalink / raw)
To: qemu-devel; +Cc: aliguori
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: ‘qemu_calculate_timeout’ defined but not 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 <lcapitulino@redhat.com>
---
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)
static int qemu_calculate_timeout(void)
{
+#ifndef CONFIG_IOTHREAD
int timeout;
if (!vm_running)
@@ -4433,6 +4434,9 @@ static int qemu_calculate_timeout(void)
}
return timeout;
+#else /* CONFIG_IOTHREAD */
+ return 1000;
+#endif
}
static int vm_can_run(void)
@@ -4468,11 +4472,7 @@ static void main_loop(void)
#ifdef CONFIG_PROFILER
ti = profile_getclock();
#endif
-#ifdef CONFIG_IOTHREAD
- main_loop_wait(1000);
-#else
main_loop_wait(qemu_calculate_timeout());
-#endif
#ifdef CONFIG_PROFILER
dev_time += profile_getclock() - ti;
#endif
--
1.6.3.GIT
--
Luiz
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-06-10 17:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-04 18:29 [Qemu-devel] [PATCH]: Fix "defined but not used" warning Luiz Capitulino
2009-06-09 21:24 [Qemu-devel] [PATCH] " Luiz Capitulino
2009-06-09 21:53 ` Mark McLoughlin
2009-06-10 0:30 ` Marcelo Tosatti
2009-06-10 17:00 ` Blue Swirl
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.