From 1bc7e522d9cf1b58f2de9c8f1737be0bb5129c35 Mon Sep 17 00:00:00 2001 From: Igor Mammedov Date: Mon, 25 Jul 2016 11:59:19 +0200 Subject: exec: Reduce CONFIG_USER_ONLY ifdeffenery Signed-off-by: Igor Mammedov Reviewed-by: David Gibson Signed-off-by: Eduardo Habkost --- exec.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'exec.c') diff --git a/exec.c b/exec.c index 60cf46a5b5..2f57c624a5 100644 --- a/exec.c +++ b/exec.c @@ -642,23 +642,17 @@ void cpu_exec_exit(CPUState *cpu) { CPUClass *cc = CPU_GET_CLASS(cpu); -#if defined(CONFIG_USER_ONLY) cpu_list_lock(); -#endif if (cpu->cpu_index == -1) { /* cpu_index was never allocated by this @cpu or was already freed. */ -#if defined(CONFIG_USER_ONLY) cpu_list_unlock(); -#endif return; } QTAILQ_REMOVE(&cpus, cpu, node); cpu_release_index(cpu); cpu->cpu_index = -1; -#if defined(CONFIG_USER_ONLY) cpu_list_unlock(); -#endif if (cc->vmsd != NULL) { vmstate_unregister(NULL, cc->vmsd, cpu); @@ -670,7 +664,7 @@ void cpu_exec_exit(CPUState *cpu) void cpu_exec_init(CPUState *cpu, Error **errp) { - CPUClass *cc = CPU_GET_CLASS(cpu); + CPUClass *cc ATTRIBUTE_UNUSED = CPU_GET_CLASS(cpu); Error *local_err = NULL; cpu->as = NULL; @@ -694,22 +688,17 @@ void cpu_exec_init(CPUState *cpu, Error **errp) object_ref(OBJECT(cpu->memory)); #endif -#if defined(CONFIG_USER_ONLY) cpu_list_lock(); -#endif cpu->cpu_index = cpu_get_free_index(&local_err); if (local_err) { error_propagate(errp, local_err); -#if defined(CONFIG_USER_ONLY) cpu_list_unlock(); -#endif return; } QTAILQ_INSERT_TAIL(&cpus, cpu, node); -#if defined(CONFIG_USER_ONLY) - (void) cc; cpu_list_unlock(); -#else + +#ifndef CONFIG_USER_ONLY if (qdev_get_vmsd(DEVICE(cpu)) == NULL) { vmstate_register(NULL, cpu->cpu_index, &vmstate_cpu_common, cpu); } -- cgit v1.2.3