All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cpu: remove unnecessary #ifdef CONFIG_TCG
@ 2021-12-17 10:49 Paolo Bonzini
  2021-12-18  0:27 ` Richard Henderson
  0 siblings, 1 reply; 2+ messages in thread
From: Paolo Bonzini @ 2021-12-17 10:49 UTC (permalink / raw)
  To: qemu-devel

"if (tcg_enabled())" allows elision of the code inside it; we only need
the prototype to exist, so that the code compile even for the --disable-tcg
case.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 cpu.c                  | 5 -----
 include/exec/cpu-all.h | 2 --
 2 files changed, 7 deletions(-)

diff --git a/cpu.c b/cpu.c
index 9bce67ef55..945dd3dded 100644
--- a/cpu.c
+++ b/cpu.c
@@ -137,12 +137,10 @@ void cpu_exec_realizefn(CPUState *cpu, Error **errp)
     if (!accel_cpu_realizefn(cpu, errp)) {
         return;
     }
-#ifdef CONFIG_TCG
     /* NB: errp parameter is unused currently */
     if (tcg_enabled()) {
         tcg_exec_realizefn(cpu, errp);
     }
-#endif /* CONFIG_TCG */
 
 #ifdef CONFIG_USER_ONLY
     assert(qdev_get_vmsd(DEVICE(cpu)) == NULL ||
@@ -169,12 +167,9 @@ void cpu_exec_unrealizefn(CPUState *cpu)
         vmstate_unregister(NULL, &vmstate_cpu_common, cpu);
     }
 #endif
-#ifdef CONFIG_TCG
-    /* NB: errp parameter is unused currently */
     if (tcg_enabled()) {
         tcg_exec_unrealizefn(cpu);
     }
-#endif /* CONFIG_TCG */
 
     cpu_list_remove(cpu);
 }
diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h
index 3c8e24292b..bb37239efa 100644
--- a/include/exec/cpu-all.h
+++ b/include/exec/cpu-all.h
@@ -437,12 +437,10 @@ void dump_opcount_info(GString *buf);
 
 #endif /* !CONFIG_USER_ONLY */
 
-#ifdef CONFIG_TCG
 /* accel/tcg/cpu-exec.c */
 int cpu_exec(CPUState *cpu);
 void tcg_exec_realizefn(CPUState *cpu, Error **errp);
 void tcg_exec_unrealizefn(CPUState *cpu);
-#endif /* CONFIG_TCG */
 
 /* Returns: 0 on success, -1 on error */
 int cpu_memory_rw_debug(CPUState *cpu, target_ulong addr,
-- 
2.33.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] cpu: remove unnecessary #ifdef CONFIG_TCG
  2021-12-17 10:49 [PATCH] cpu: remove unnecessary #ifdef CONFIG_TCG Paolo Bonzini
@ 2021-12-18  0:27 ` Richard Henderson
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Henderson @ 2021-12-18  0:27 UTC (permalink / raw)
  To: Paolo Bonzini, qemu-devel

On 12/17/21 2:49 AM, Paolo Bonzini wrote:
> "if (tcg_enabled())" allows elision of the code inside it; we only need
> the prototype to exist, so that the code compile even for the --disable-tcg
> case.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-18  0:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-17 10:49 [PATCH] cpu: remove unnecessary #ifdef CONFIG_TCG Paolo Bonzini
2021-12-18  0:27 ` Richard Henderson

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.