Skip to contentSkip to conversation

Cleanup unused included header in core.c & cluster.c

PATCH In review Zhao Liu 2 participants 6 messages Nov 27, 2023 – Jan 3, 2024

lore
Share & tools
lore

Zhao Liu

author
#0 lore raw

cover Cleanup unused included header in core.c & cluster.c

From: Zhao Liu <[email protected]>

Remove unused header in core.c and cluster.c, and reorder the remaining header files (except qemu/osdep.h) in alphabetical order.

Tested by "./configure" and then "make".

---
Zhao Liu (2):
hw/cpu/core: Cleanup unused included header in core.c hw/cpu/cluster: Cleanup unused included header in cluster.c

 hw/cpu/cluster.c | 5 ++---
 hw/cpu/core.c    | 7 +++----
 2 files changed, 5 insertions(+), 7 deletions(-)
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH 1/2 hw/cpu/core: Cleanup unused included header in core.c

From: Zhao Liu <[email protected]>

Remove unused header (qemu/module.h and sysemu/cpus.h) in core.c, and reorder the remaining header files (except qemu/osdep.h) in alphabetical order.

Tested by "./configure" and then "make".

---
 hw/cpu/core.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
hw/cpu/core.c +3 -4
index 987607515574..495a5c30ffe1 100644
@@ -8,12 +8,11 @@
  */
 
 #include "qemu/osdep.h"
+
+#include "hw/boards.h"
 #include "hw/cpu/core.h"
-#include "qapi/visitor.h"
-#include "qemu/module.h"
 #include "qapi/error.h"
-#include "sysemu/cpus.h"
-#include "hw/boards.h"
+#include "qapi/visitor.h"
 
 static void core_prop_get_core_id(Object *obj, Visitor *v, const char *name,
                                   void *opaque, Error **errp)
Signature · 1 line
2.34.1
Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] hw/cpu/core: Cleanup unused included header in core.c

Quoted 6 lines · Zhao Liu

From: Zhao Liu <[email protected]>

Remove unused header (qemu/module.h and sysemu/cpus.h) in core.c, and reorder the remaining header files (except qemu/osdep.h) in alphabetical order.

Quoted 6 lines

Tested by "./configure" and then "make".

---
  hw/cpu/core.c | 7 +++----
  1 file changed, 3 insertions(+), 4 deletions(-)
author
#3 lore raw

PATCH 2/2 hw/cpu/cluster: Cleanup unused included header in cluster.c

In reply to Zhao Liu

From: Zhao Liu <[email protected]>

Remove unused header (qemu/module.h and qemu/cutils.h) in cluster.c, and reorder the remaining header files (except qemu/osdep.h) in alphabetical order.

Tested by "./configure" and then "make".

---
 hw/cpu/cluster.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
hw/cpu/cluster.c +2 -3
index e444b7c29d1b..61289a840d46 100644
@@ -19,12 +19,11 @@
  */
 
 #include "qemu/osdep.h"
+
+#include "hw/core/cpu.h"
 #include "hw/cpu/cluster.h"
 #include "hw/qdev-properties.h"
-#include "hw/core/cpu.h"
 #include "qapi/error.h"
-#include "qemu/module.h"
-#include "qemu/cutils.h"
 
 static Property cpu_cluster_properties[] = {
     DEFINE_PROP_UINT32("cluster-id", CPUClusterState, cluster_id, 0),
Signature · 1 line
2.34.1
Reviewed-by on v1 2/2
#4 lore raw

Re: [PATCH 2/2] hw/cpu/cluster: Cleanup unused included header in cluster.c

Quoted 6 lines · Zhao Liu

From: Zhao Liu <[email protected]>

Remove unused header (qemu/module.h and qemu/cutils.h) in cluster.c, and reorder the remaining header files (except qemu/osdep.h) in alphabetical order.

Quoted 6 lines

Tested by "./configure" and then "make".

---
  hw/cpu/cluster.c | 5 ++---
  1 file changed, 2 insertions(+), 3 deletions(-)
author
#5 lore raw

Re: [PATCH 2/2] hw/cpu/cluster: Cleanup unused included header in cluster.c

Quoted 12 lines · Philippe Mathieu-Daudé

Date: Tue, 28 Nov 2023 11:02:00 +0100
From: Philippe Mathieu-Daudé <[email protected]>
Subject: Re: [PATCH 2/2] hw/cpu/cluster: Cleanup unused included header in
cluster.c

Quoted 6 lines · Zhao Liu

From: Zhao Liu <[email protected]>

Remove unused header (qemu/module.h and qemu/cutils.h) in cluster.c, and reorder the remaining header files (except qemu/osdep.h) in alphabetical order.

Quoted 9 lines
Quoted 6 lines

Tested by "./configure" and then "make".

---
  hw/cpu/cluster.c | 5 ++---
  1 file changed, 2 insertions(+), 3 deletions(-)

Thanks Philippe!

BTW, could these two patches be merged into your next tree?

I also find these 2 headers are included in many cases, maybe I can go further and do a more thorough cleaning.

Regards,
Zhao