Skip to contentSkip to conversation

qemu/typedefs.h cleanup

RFC PATCH In review Philippe Mathieu-Daudé 4 participants 8 messages May 8, 2018

lore
Share & tools
lore
#0 lore raw

cover qemu/typedefs.h cleanup

Hi Thomas, Michael,

This is a RFC cleanup following the "s390x: drop an unused include" thread:
http://lists.nongnu.org/archive/html/qemu-devel/2018-05/msg01649.html

I believe we can cut a good third of typedefs.h.

Sending a RFC PoC for comments before continuing in this direction.

Regards,

Phil.

Philippe Mathieu-Daudé (4):
typedefs: Remove PcGuestInfo from qemu/typedefs.h hw/pcmcia: Remove PCMCIACardState from qemu/typedefs.h hw/ssi: Remove SSIBus from qemu/typedefs.h hw/ide/ahci: Remove AllwinnerAHCIState from qemu/typedefs.h

 hw/arm/strongarm.h      | 1 +
 include/hw/arm/pxa.h    | 2 ++
 include/hw/ide/ahci.h   | 4 ++--
 include/hw/pcmcia.h     | 4 ++--
 include/hw/ssi/ssi.h    | 1 +
 include/qemu/typedefs.h | 4 ----
 6 files changed, 8 insertions(+), 8 deletions(-)
Signature · 1 line
2.17.0
#1 lore raw

RFC PATCH 1/4 typedefs: Remove PcGuestInfo from qemu/typedefs.h

It is long gone since e4e8ba04c2007 ...

---
 include/qemu/typedefs.h | 1 -
 1 file changed, 1 deletion(-)
include/qemu/typedefs.h +0 -1
index a46b0b347b..325c72de33 100644
@@ -62,7 +62,6 @@ typedef struct NetClientState NetClientState;
 typedef struct NetFilterState NetFilterState;
 typedef struct NICInfo NICInfo;
 typedef struct NumaNodeMem NumaNodeMem;
-typedef struct PcGuestInfo PcGuestInfo;
 typedef struct PCIBridge PCIBridge;
 typedef struct PCIBus PCIBus;
 typedef struct PCIDevice PCIDevice;
Signature · 1 line
2.17.0
Reviewed-by on v1 1/4
#2 lore raw

Re: [Qemu-devel] [RFC PATCH 1/4] typedefs: Remove PcGuestInfo from qemu/typedefs.h

Quoted 13 lines · Philippe Mathieu-Daudé

It is long gone since e4e8ba04c2007 ...

---
 include/qemu/typedefs.h | 1 -
 1 file changed, 1 deletion(-)
include/qemu/typedefs.h +0 -0
index a46b0b347b..325c72de33 100644

include/qemu/typedefs.h typedef struct NetClientState NetClientState; · line 67

Quoted 7 lines
include/qemu/typedefs.h +0 -1
@@ -62,7 +62,6 @@ typedef struct NetClientState NetClientState;
 typedef struct NetFilterState NetFilterState;
 typedef struct NICInfo NICInfo;
 typedef struct NumaNodeMem NumaNodeMem;
-typedef struct PcGuestInfo PcGuestInfo;
 typedef struct PCIBridge PCIBridge;
 typedef struct PCIBus PCIBus;
 typedef struct PCIDevice PCIDevice;

No need to mark this patch as RFC - this is certainly a good idea.

#3 lore raw

RFC PATCH 2/4 hw/pcmcia: Remove PCMCIACardState from qemu/typedefs.h

In reply to Philippe Mathieu-Daudé

There is only one file requiring this typedef (hw/arm/pxa.h), let it include "hw/pcmcia.h" directly to simplify qemu/typedefs.h.

---
 include/hw/arm/pxa.h    | 1 +
 include/hw/pcmcia.h     | 4 ++--
 include/qemu/typedefs.h | 1 -
 3 files changed, 3 insertions(+), 3 deletions(-)
include/hw/arm/pxa.h +1 -0
index 0df1199caa..f6dfb5c0cf 100644
@@ -12,6 +12,7 @@
 
 #include "exec/memory.h"
 #include "target/arm/cpu-qom.h"
+#include "hw/pcmcia.h"
 
 /* Interrupt numbers */
 # define PXA2XX_PIC_SSP3	0
include/hw/pcmcia.h +2 -2
index 79cac9c761..1b4080764f 100644
@@ -18,13 +18,13 @@ typedef struct PCMCIASocket {
 #define PCMCIA_CARD_CLASS(cls) \
     OBJECT_CLASS_CHECK(PCMCIACardClass, cls, TYPE_PCMCIA_CARD)
 
-struct PCMCIACardState {
+typedef struct PCMCIACardState {
     /*< private >*/
     DeviceState parent_obj;
     /*< public >*/
 
     PCMCIASocket *slot;
-};
+} PCMCIACardState;
 
 typedef struct PCMCIACardClass {
     /*< private >*/
include/qemu/typedefs.h +0 -1
index 325c72de33..c7a0159bd2 100644
@@ -76,7 +76,6 @@ typedef struct PCIHostDeviceAddress PCIHostDeviceAddress;
 typedef struct PCIHostState PCIHostState;
 typedef struct PCMachineClass PCMachineClass;
 typedef struct PCMachineState PCMachineState;
-typedef struct PCMCIACardState PCMCIACardState;
 typedef struct PixelFormat PixelFormat;
 typedef struct PostcopyDiscardState PostcopyDiscardState;
 typedef struct Property Property;
Signature · 1 line
2.17.0
#4 lore raw

RFC PATCH 3/4 hw/ssi: Remove SSIBus from qemu/typedefs.h

In reply to Philippe Mathieu-Daudé

There are only two files requiring this typedef (strongarm.h and hw/arm/pxa.h), let them include "hw/pcmcia.h" directly to simplify qemu/typedefs.h.

---
 hw/arm/strongarm.h      | 1 +
 include/hw/arm/pxa.h    | 1 +
 include/hw/ssi/ssi.h    | 1 +
 include/qemu/typedefs.h | 1 -
 4 files changed, 3 insertions(+), 1 deletion(-)
hw/arm/strongarm.h +1 -0
index e98840b461..ae51a1ae34 100644
@@ -3,6 +3,7 @@
 
 #include "exec/memory.h"
 #include "target/arm/cpu-qom.h"
+#include "hw/ssi/ssi.h"
 
 #define SA_CS0          0x00000000
 #define SA_CS1          0x08000000
include/hw/arm/pxa.h +1 -0
index f6dfb5c0cf..f184349f02 100644
@@ -13,6 +13,7 @@
 #include "exec/memory.h"
 #include "target/arm/cpu-qom.h"
 #include "hw/pcmcia.h"
+#include "hw/ssi/ssi.h"
 
 /* Interrupt numbers */
 # define PXA2XX_PIC_SSP3	0
include/hw/ssi/ssi.h +1 -0
index 6a0c3c3cdb..bdbf3c51f5 100644
@@ -13,6 +13,7 @@
 
 #include "hw/qdev.h"
 
+typedef struct SSIBus SSIBus;
 typedef struct SSISlave SSISlave;
 typedef struct SSISlaveClass SSISlaveClass;
 typedef enum SSICSMode SSICSMode;
include/qemu/typedefs.h +0 -1
index c7a0159bd2..b4dc63a466 100644
@@ -106,7 +106,6 @@ typedef struct Range Range;
 typedef struct SerialState SerialState;
 typedef struct SHPCDevice SHPCDevice;
 typedef struct SMBusDevice SMBusDevice;
-typedef struct SSIBus SSIBus;
 typedef struct uWireSlave uWireSlave;
 typedef struct VirtIODevice VirtIODevice;
 typedef struct Visitor Visitor;
Signature · 1 line
2.17.0
Reviewed-by on v1 3/4
#5 lore raw

Re: [Qemu-arm] [Qemu-devel] [RFC PATCH 3/4] hw/ssi: Remove SSIBus from qemu/typedefs.h

Quoted 5 lines · Philippe Mathieu-Daudé

There are only two files requiring this typedef (strongarm.h and hw/arm/pxa.h), let them include "hw/pcmcia.h" directly to simplify qemu/typedefs.h.

I think this is heading in the right direction.

Alistair

Quoted 59 lines
---
 hw/arm/strongarm.h      | 1 +
 include/hw/arm/pxa.h    | 1 +
 include/hw/ssi/ssi.h    | 1 +
 include/qemu/typedefs.h | 1 -
 4 files changed, 3 insertions(+), 1 deletion(-)
hw/arm/strongarm.h +1 -0
index e98840b461..ae51a1ae34 100644
@@ -3,6 +3,7 @@
 
 #include "exec/memory.h"
 #include "target/arm/cpu-qom.h"
+#include "hw/ssi/ssi.h"
 
 #define SA_CS0          0x00000000
 #define SA_CS1          0x08000000
include/hw/arm/pxa.h +1 -0
index f6dfb5c0cf..f184349f02 100644
@@ -13,6 +13,7 @@
 #include "exec/memory.h"
 #include "target/arm/cpu-qom.h"
 #include "hw/pcmcia.h"
+#include "hw/ssi/ssi.h"
 
 /* Interrupt numbers */
 # define PXA2XX_PIC_SSP3       0
include/hw/ssi/ssi.h +1 -0
index 6a0c3c3cdb..bdbf3c51f5 100644
@@ -13,6 +13,7 @@
 
 #include "hw/qdev.h"
 
+typedef struct SSIBus SSIBus;
 typedef struct SSISlave SSISlave;
 typedef struct SSISlaveClass SSISlaveClass;
 typedef enum SSICSMode SSICSMode;
include/qemu/typedefs.h +0 -2
index c7a0159bd2..b4dc63a466 100644
@@ -106,7 +106,6 @@ typedef struct Range Range;
 typedef struct SerialState SerialState;
 typedef struct SHPCDevice SHPCDevice;
 typedef struct SMBusDevice SMBusDevice;
-typedef struct SSIBus SSIBus;
 typedef struct uWireSlave uWireSlave;
 typedef struct VirtIODevice VirtIODevice;
 typedef struct Visitor Visitor;
--

2.17.0

#6 lore raw

RFC PATCH 4/4 hw/ide/ahci: Remove AllwinnerAHCIState from qemu/typedefs.h

In reply to Philippe Mathieu-Daudé

Files requiring AllwinnerAHCIState already include "hw/ide/ahci.h".

---
 include/hw/ide/ahci.h   | 4 ++--
 include/qemu/typedefs.h | 1 -
 2 files changed, 2 insertions(+), 3 deletions(-)
include/hw/ide/ahci.h +2 -2
index b7bb2b02d6..b44e3000cf 100644
@@ -73,13 +73,13 @@ typedef struct SysbusAHCIState {
 #define ALLWINNER_AHCI_MMIO_OFF  0x80
 #define ALLWINNER_AHCI_MMIO_SIZE 0x80
 
-struct AllwinnerAHCIState {
+typedef struct AllwinnerAHCIState {
     /*< private >*/
     SysbusAHCIState parent_obj;
     /*< public >*/
 
     MemoryRegion mmio;
     uint32_t regs[ALLWINNER_AHCI_MMIO_SIZE/4];
-};
+} AllwinnerAHCIState;
 
 #endif /* HW_IDE_AHCI_H */
include/qemu/typedefs.h +0 -1
index b4dc63a466..6baadfbd49 100644
@@ -8,7 +8,6 @@
 typedef struct AdapterInfo AdapterInfo;
 typedef struct AddressSpace AddressSpace;
 typedef struct AioContext AioContext;
-typedef struct AllwinnerAHCIState AllwinnerAHCIState;
 typedef struct AudioState AudioState;
 typedef struct BdrvDirtyBitmap BdrvDirtyBitmap;
 typedef struct BdrvDirtyBitmapIter BdrvDirtyBitmapIter;
Signature · 1 line
2.17.0
Acked-by on v1 4/4
#7 lore raw

Re: [Qemu-devel] [RFC PATCH 4/4] hw/ide/ahci: Remove AllwinnerAHCIState from qemu/typedefs.h

Quoted 34 lines · Philippe Mathieu-Daudé

Files requiring AllwinnerAHCIState already include "hw/ide/ahci.h".

---
 include/hw/ide/ahci.h   | 4 ++--
 include/qemu/typedefs.h | 1 -
 2 files changed, 2 insertions(+), 3 deletions(-)
include/hw/ide/ahci.h +2 -2
index b7bb2b02d6..b44e3000cf 100644
@@ -73,13 +73,13 @@ typedef struct SysbusAHCIState {
 #define ALLWINNER_AHCI_MMIO_OFF  0x80
 #define ALLWINNER_AHCI_MMIO_SIZE 0x80
 
-struct AllwinnerAHCIState {
+typedef struct AllwinnerAHCIState {
     /*< private >*/
     SysbusAHCIState parent_obj;
     /*< public >*/
 
     MemoryRegion mmio;
     uint32_t regs[ALLWINNER_AHCI_MMIO_SIZE/4];
-};
+} AllwinnerAHCIState;
 
 #endif /* HW_IDE_AHCI_H */
include/qemu/typedefs.h +0 -0
index b4dc63a466..6baadfbd49 100644

include/qemu/typedefs.h line 13

Quoted 7 lines
include/qemu/typedefs.h +0 -1
@@ -8,7 +8,6 @@
 typedef struct AdapterInfo AdapterInfo;
 typedef struct AddressSpace AddressSpace;
 typedef struct AioContext AioContext;
-typedef struct AllwinnerAHCIState AllwinnerAHCIState;
 typedef struct AudioState AudioState;
 typedef struct BdrvDirtyBitmap BdrvDirtyBitmap;
 typedef struct BdrvDirtyBitmapIter BdrvDirtyBitmapIter;

Hm, sure; I suppose we don't need QEMU-wide definitions of these sorts of things.