qemu/typedefs.h cleanup
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
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
@@ -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
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...Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- include/qemu/typedefs.h | 1 - 1 file changed, 1 deletion(-)include/qemu/typedefs.h +0
-0
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.
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
@@ -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
@@ -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
@@ -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
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
@@ -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
@@ -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
@@ -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
@@ -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
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.handhw/arm/pxa.h), let them include "hw/pcmcia.h" directly to simplifyqemu/typedefs.h.Signed-off-by Philippe Mathieu-Daudé <[email protected]>
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@@ -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 0x08000000include/hw/arm/pxa.h +1
-0@@ -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 0include/hw/ssi/ssi.h +1
-0@@ -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@@ -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
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
@@ -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
@@ -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
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".Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- 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@@ -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
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.