From 8063396bf3459a810d24e3efd6110b8480f0de5b Mon Sep 17 00:00:00 2001 From: Eduardo Habkost Date: Wed, 16 Sep 2020 14:25:19 -0400 Subject: Use OBJECT_DECLARE_SIMPLE_TYPE when possible This converts existing DECLARE_INSTANCE_CHECKER usage to OBJECT_DECLARE_SIMPLE_TYPE when possible. $ ./scripts/codeconverter/converter.py -i \ --pattern=AddObjectDeclareSimpleType $(git grep -l '' -- '*.[ch]') Signed-off-by: Eduardo Habkost Acked-by: Paul Durrant Message-Id: <20200916182519.415636-6-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- hw/pci-host/bonito.c | 6 ++---- hw/pci-host/grackle.c | 4 +--- hw/pci-host/i440fx.c | 4 +--- hw/pci-host/ppce500.c | 8 ++------ hw/pci-host/prep.c | 4 +--- 5 files changed, 7 insertions(+), 19 deletions(-) (limited to 'hw/pci-host') diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c index d10fbd3..a99eced 100644 --- a/hw/pci-host/bonito.c +++ b/hw/pci-host/bonito.c @@ -240,12 +240,10 @@ struct BonitoState { }; #define TYPE_BONITO_PCI_HOST_BRIDGE "Bonito-pcihost" -DECLARE_INSTANCE_CHECKER(BonitoState, BONITO_PCI_HOST_BRIDGE, - TYPE_BONITO_PCI_HOST_BRIDGE) +OBJECT_DECLARE_SIMPLE_TYPE(BonitoState, BONITO_PCI_HOST_BRIDGE) #define TYPE_PCI_BONITO "Bonito" -DECLARE_INSTANCE_CHECKER(PCIBonitoState, PCI_BONITO, - TYPE_PCI_BONITO) +OBJECT_DECLARE_SIMPLE_TYPE(PCIBonitoState, PCI_BONITO) static void bonito_writel(void *opaque, hwaddr addr, uint64_t val, unsigned size) diff --git a/hw/pci-host/grackle.c b/hw/pci-host/grackle.c index fd7d6dc..57c29b2 100644 --- a/hw/pci-host/grackle.c +++ b/hw/pci-host/grackle.c @@ -35,9 +35,7 @@ #include "trace.h" #include "qom/object.h" -typedef struct GrackleState GrackleState; -DECLARE_INSTANCE_CHECKER(GrackleState, GRACKLE_PCI_HOST_BRIDGE, - TYPE_GRACKLE_PCI_HOST_BRIDGE) +OBJECT_DECLARE_SIMPLE_TYPE(GrackleState, GRACKLE_PCI_HOST_BRIDGE) struct GrackleState { PCIHostState parent_obj; diff --git a/hw/pci-host/i440fx.c b/hw/pci-host/i440fx.c index 93c6223..aecbcc2 100644 --- a/hw/pci-host/i440fx.c +++ b/hw/pci-host/i440fx.c @@ -42,9 +42,7 @@ * https://wiki.qemu.org/File:29054901.pdf */ -typedef struct I440FXState I440FXState; -DECLARE_INSTANCE_CHECKER(I440FXState, I440FX_PCI_HOST_BRIDGE, - TYPE_I440FX_PCI_HOST_BRIDGE) +OBJECT_DECLARE_SIMPLE_TYPE(I440FXState, I440FX_PCI_HOST_BRIDGE) struct I440FXState { PCIHostState parent_obj; diff --git a/hw/pci-host/ppce500.c b/hw/pci-host/ppce500.c index f376374..9517aab 100644 --- a/hw/pci-host/ppce500.c +++ b/hw/pci-host/ppce500.c @@ -92,9 +92,7 @@ struct pci_inbound { #define TYPE_PPC_E500_PCI_HOST_BRIDGE "e500-pcihost" -typedef struct PPCE500PCIState PPCE500PCIState; -DECLARE_INSTANCE_CHECKER(PPCE500PCIState, PPC_E500_PCI_HOST_BRIDGE, - TYPE_PPC_E500_PCI_HOST_BRIDGE) +OBJECT_DECLARE_SIMPLE_TYPE(PPCE500PCIState, PPC_E500_PCI_HOST_BRIDGE) struct PPCE500PCIState { PCIHostState parent_obj; @@ -116,9 +114,7 @@ struct PPCE500PCIState { }; #define TYPE_PPC_E500_PCI_BRIDGE "e500-host-bridge" -typedef struct PPCE500PCIBridgeState PPCE500PCIBridgeState; -DECLARE_INSTANCE_CHECKER(PPCE500PCIBridgeState, PPC_E500_PCI_BRIDGE, - TYPE_PPC_E500_PCI_BRIDGE) +OBJECT_DECLARE_SIMPLE_TYPE(PPCE500PCIBridgeState, PPC_E500_PCI_BRIDGE) struct PPCE500PCIBridgeState { /*< private >*/ diff --git a/hw/pci-host/prep.c b/hw/pci-host/prep.c index b234fd7..d0323fe 100644 --- a/hw/pci-host/prep.c +++ b/hw/pci-host/prep.c @@ -43,9 +43,7 @@ #define TYPE_RAVEN_PCI_DEVICE "raven" #define TYPE_RAVEN_PCI_HOST_BRIDGE "raven-pcihost" -typedef struct RavenPCIState RavenPCIState; -DECLARE_INSTANCE_CHECKER(RavenPCIState, RAVEN_PCI_DEVICE, - TYPE_RAVEN_PCI_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(RavenPCIState, RAVEN_PCI_DEVICE) struct RavenPCIState { PCIDevice dev; -- cgit v1.1