[RFC PATCH v2 01/14] target/m68k: clean-up includes in cpu.c

Alex Bennée posted 14 patches 1 month, 3 weeks ago
Maintainers: Richard Henderson <richard.henderson@linaro.org>, Thomas Huth <huth@tuxfamily.org>, Laurent Vivier <laurent@vivier.eu>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Eduardo Habkost <eduardo@habkost.net>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Yanan Wang <wangyanan55@huawei.com>, Zhao Liu <zhao1.liu@intel.com>, Peter Maydell <peter.maydell@linaro.org>, Aurelien Jarno <aurelien@aurel32.net>, Jiaxun Yang <jiaxun.yang@flygoat.com>, Aleksandar Rikalo <arikalo@gmail.com>, Bastian Koppelmann <kbastian@rumtueddeln.de>
[RFC PATCH v2 01/14] target/m68k: clean-up includes in cpu.c
Posted by Alex Bennée 1 month, 3 weeks ago
We don't need translation-block.h as the TB flags are local and the
only bits needed come from cpu-ops.h. The vmstate is a system only
concerns so we can guard against including it for linux-user.

Finally tidy up the order to keep things together with the local cpu.h
kept at the end.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 target/m68k/cpu.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c
index c721a23b966..d849a4a90fc 100644
--- a/target/m68k/cpu.c
+++ b/target/m68k/cpu.c
@@ -19,12 +19,15 @@
  */
 
 #include "qemu/osdep.h"
+#include "accel/tcg/cpu-ops.h"
+#include "fpu/softfloat.h"
 #include "qapi/error.h"
-#include "cpu.h"
+
+#ifndef CONFIG_USER_ONLY
 #include "migration/vmstate.h"
-#include "fpu/softfloat.h"
-#include "exec/translation-block.h"
-#include "accel/tcg/cpu-ops.h"
+#endif
+
+#include "cpu.h"
 
 static void m68k_cpu_set_pc(CPUState *cs, vaddr value)
 {
-- 
2.47.3


Re: [RFC PATCH v2 01/14] target/m68k: clean-up includes in cpu.c
Posted by Thomas Huth 1 month, 3 weeks ago
Am Thu, 19 Feb 2026 17:17:57 +0000
schrieb Alex Bennée <alex.bennee@linaro.org>:

> We don't need translation-block.h as the TB flags are local and the
> only bits needed come from cpu-ops.h. The vmstate is a system only
> concerns so we can guard against including it for linux-user.
> 
> Finally tidy up the order to keep things together with the local cpu.h
> kept at the end.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>  target/m68k/cpu.c | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c
> index c721a23b966..d849a4a90fc 100644
> --- a/target/m68k/cpu.c
> +++ b/target/m68k/cpu.c
> @@ -19,12 +19,15 @@
>   */
>  
>  #include "qemu/osdep.h"
> +#include "accel/tcg/cpu-ops.h"
> +#include "fpu/softfloat.h"
>  #include "qapi/error.h"
> -#include "cpu.h"
> +
> +#ifndef CONFIG_USER_ONLY
>  #include "migration/vmstate.h"
> -#include "fpu/softfloat.h"
> -#include "exec/translation-block.h"
> -#include "accel/tcg/cpu-ops.h"
> +#endif
> +
> +#include "cpu.h"
>  
>  static void m68k_cpu_set_pc(CPUState *cs, vaddr value)
>  {

Reviewed-by: Thomas Huth <huth@tuxfamily.org>
Re: [RFC PATCH v2 01/14] target/m68k: clean-up includes in cpu.c
Posted by Pierrick Bouvier 1 month, 3 weeks ago
On 2/19/26 9:17 AM, Alex Bennée wrote:
> We don't need translation-block.h as the TB flags are local and the
> only bits needed come from cpu-ops.h. The vmstate is a system only
> concerns so we can guard against including it for linux-user.
> 
> Finally tidy up the order to keep things together with the local cpu.h
> kept at the end.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>   target/m68k/cpu.c | 11 +++++++----
>   1 file changed, 7 insertions(+), 4 deletions(-)
> 

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>