diff mbox

[qom-cpu,v2,05/29] cpus: Change cpu_thread_is_idle() argument to CPUState

Message ID 1371398269-6213-6-git-send-email-afaerber@suse.de
State New
Headers show

Commit Message

Andreas Färber June 16, 2013, 3:57 p.m. UTC
It no longer needs CPUArchState.

Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 cpus.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Comments

Richard Henderson June 17, 2013, 8 p.m. UTC | #1
On 06/16/2013 08:57 AM, Andreas Färber wrote:
> It no longer needs CPUArchState.
> 
> Signed-off-by: Andreas Färber <afaerber@suse.de>

Reviewed-by: Richard Henderson <rth@twiddle.net>


r~
diff mbox

Patch

diff --git a/cpus.c b/cpus.c
index ab0eb4f..17cc85b 100644
--- a/cpus.c
+++ b/cpus.c
@@ -62,10 +62,8 @@ 
 
 static CPUArchState *next_cpu;
 
-static bool cpu_thread_is_idle(CPUArchState *env)
+static bool cpu_thread_is_idle(CPUState *cpu)
 {
-    CPUState *cpu = ENV_GET_CPU(env);
-
     if (cpu->stop || cpu->queued_work_first) {
         return false;
     }
@@ -84,7 +82,7 @@  static bool all_cpu_threads_idle(void)
     CPUArchState *env;
 
     for (env = first_cpu; env != NULL; env = env->next_cpu) {
-        if (!cpu_thread_is_idle(env)) {
+        if (!cpu_thread_is_idle(ENV_GET_CPU(env))) {
             return false;
         }
     }
@@ -723,7 +721,7 @@  static void qemu_kvm_wait_io_event(CPUArchState *env)
 {
     CPUState *cpu = ENV_GET_CPU(env);
 
-    while (cpu_thread_is_idle(env)) {
+    while (cpu_thread_is_idle(cpu)) {
         qemu_cond_wait(cpu->halt_cond, &qemu_global_mutex);
     }