Re: [PATCH for-6.2 12/12] [automated] Use OBJECT_DECLARE_SIMPLE_TYPE when possible
On Fri, Aug 06 2021, Eduardo Habkost wrote: > Replace typedef + DECLARE_INSTANCE_CHECKER with > equivalent OBJECT_DECLARE_SIMPLE_TYPE macro. > > Generated using: > > $ ./scripts/codeconverter/converter.py -i \ > --pattern=AddObjectDeclareSimpleType $(git grep -l '' -- '*.[ch]') > > Signed-off-by: Eduardo Habkost > --- > Cc: Thomas Huth > Cc: Paul Burton > Cc: Aleksandar Rikalo > Cc: "Philippe Mathieu-Daudé" > Cc: Aurelien Jarno > Cc: Jiaxun Yang > Cc: Havard Skinnemoen > Cc: Tyrone Ting > Cc: Pavel Pisa > Cc: Vikram Garhwal > Cc: Jason Wang > Cc: Keith Busch > Cc: Klaus Jensen > Cc: "Michael S. Tsirkin" > Cc: Richard Henderson > Cc: David Hildenbrand > Cc: Cornelia Huck > Cc: Halil Pasic > Cc: Christian Borntraeger > Cc: Gerd Hoffmann > Cc: Vijai Kumar K > Cc: Alistair Francis > Cc: Bin Meng > Cc: Palmer Dabbelt > Cc: "Edgar E. Iglesias" > Cc: Peter Maydell > Cc: Laurent Vivier > Cc: "Cédric Le Goater" > Cc: Andrew Jeffery > Cc: Joel Stanley > Cc: Andrew Baumann > Cc: Francisco Iglesias > Cc: David Gibson > Cc: Greg Kurz > Cc: Bastian Koppelmann > Cc: qemu-de...@nongnu.org > Cc: qemu-...@nongnu.org > Cc: qemu-block@nongnu.org > Cc: qemu-s3...@nongnu.org > Cc: qemu-ri...@nongnu.org > Cc: qemu-...@nongnu.org > --- > hw/nvme/nvme.h | 10 +++--- > hw/usb/hcd-xhci-pci.h | 4 +--- > hw/usb/hcd-xhci-sysbus.h| 4 +--- > include/hw/adc/npcm7xx_adc.h| 4 +--- > include/hw/char/shakti_uart.h | 4 +--- > include/hw/dma/sifive_pdma.h| 4 +--- > include/hw/dma/xlnx_csu_dma.h | 4 +--- > include/hw/gpio/sifive_gpio.h | 4 +--- > include/hw/intc/m68k_irqc.h | 4 +--- > include/hw/intc/sifive_clint.h | 4 +--- > include/hw/intc/sifive_plic.h | 4 +--- > include/hw/misc/aspeed_lpc.h| 4 +--- > include/hw/misc/bcm2835_cprman_internals.h | 12 > include/hw/misc/led.h | 3 +-- > include/hw/misc/mchp_pfsoc_dmc.h| 8 ++-- > include/hw/misc/mchp_pfsoc_ioscb.h | 4 +--- > include/hw/misc/mchp_pfsoc_sysreg.h | 4 +--- > include/hw/misc/npcm7xx_clk.h | 3 +-- > include/hw/misc/npcm7xx_gcr.h | 4 +--- > include/hw/misc/npcm7xx_mft.h | 4 +--- > include/hw/misc/npcm7xx_pwm.h | 3 +-- > include/hw/misc/sifive_e_prci.h | 4 +--- > include/hw/misc/sifive_test.h | 4 +--- > include/hw/misc/sifive_u_otp.h | 4 +--- > include/hw/misc/sifive_u_prci.h | 4 +--- > include/hw/misc/xlnx-versal-xramc.h | 4 +--- > include/hw/net/npcm7xx_emc.h| 4 +--- > include/hw/net/xlnx-zynqmp-can.h| 4 +--- > include/hw/ppc/spapr_drc.h | 4 +--- > include/hw/register.h | 3 +-- > include/hw/riscv/microchip_pfsoc.h | 4 +--- > include/hw/riscv/shakti_c.h | 8 ++-- > include/hw/riscv/sifive_e.h | 4 +--- > include/hw/riscv/sifive_u.h | 4 +--- > include/hw/sd/cadence_sdhci.h | 4 +--- > include/hw/ssi/sifive_spi.h | 4 +--- > include/hw/timer/npcm7xx_timer.h| 3 +-- > include/hw/tricore/tricore_testdevice.h | 4 +--- > include/hw/usb/hcd-dwc3.h | 4 +--- > include/hw/usb/xlnx-versal-usb2-ctrl-regs.h | 4 +--- > hw/m68k/mcf5206.c | 4 +--- > hw/mips/boston.c| 4 +--- > hw/misc/npcm7xx_clk.c | 9 +++-- > hw/net/can/ctucan_pci.c | 4 +--- > hw/s390x/vhost-user-fs-ccw.c| 4 +--- > hw/sensor/adm1272.c | 4 +--- > hw/sensor/max34451.c| 4 +--- > 47 files changed, 56 insertions(+), 154 deletions(-) Acked-by: Cornelia Huck
Re: [PATCH for-6.2 12/12] [automated] Use OBJECT_DECLARE_SIMPLE_TYPE when possible
On 8/6/21 11:11 PM, Eduardo Habkost wrote: > Replace typedef + DECLARE_INSTANCE_CHECKER with > equivalent OBJECT_DECLARE_SIMPLE_TYPE macro. > > Generated using: > > $ ./scripts/codeconverter/converter.py -i \ > --pattern=AddObjectDeclareSimpleType $(git grep -l '' -- '*.[ch]') > > Signed-off-by: Eduardo Habkost > --- > Cc: Thomas Huth > Cc: Paul Burton > Cc: Aleksandar Rikalo > Cc: "Philippe Mathieu-Daudé" > Cc: Aurelien Jarno > Cc: Jiaxun Yang > Cc: Havard Skinnemoen > Cc: Tyrone Ting > Cc: Pavel Pisa > Cc: Vikram Garhwal > Cc: Jason Wang > Cc: Keith Busch > Cc: Klaus Jensen > Cc: "Michael S. Tsirkin" > Cc: Richard Henderson > Cc: David Hildenbrand > Cc: Cornelia Huck > Cc: Halil Pasic > Cc: Christian Borntraeger > Cc: Gerd Hoffmann > Cc: Vijai Kumar K > Cc: Alistair Francis > Cc: Bin Meng > Cc: Palmer Dabbelt > Cc: "Edgar E. Iglesias" > Cc: Peter Maydell > Cc: Laurent Vivier > Cc: "Cédric Le Goater" > Cc: Andrew Jeffery > Cc: Joel Stanley > Cc: Andrew Baumann > Cc: Francisco Iglesias > Cc: David Gibson > Cc: Greg Kurz > Cc: Bastian Koppelmann > Cc: qemu-de...@nongnu.org > Cc: qemu-...@nongnu.org > Cc: qemu-block@nongnu.org > Cc: qemu-s3...@nongnu.org > Cc: qemu-ri...@nongnu.org > Cc: qemu-...@nongnu.org > --- > hw/nvme/nvme.h | 10 +++--- > hw/usb/hcd-xhci-pci.h | 4 +--- > hw/usb/hcd-xhci-sysbus.h| 4 +--- > include/hw/adc/npcm7xx_adc.h| 4 +--- > include/hw/char/shakti_uart.h | 4 +--- > include/hw/dma/sifive_pdma.h| 4 +--- > include/hw/dma/xlnx_csu_dma.h | 4 +--- > include/hw/gpio/sifive_gpio.h | 4 +--- > include/hw/intc/m68k_irqc.h | 4 +--- > include/hw/intc/sifive_clint.h | 4 +--- > include/hw/intc/sifive_plic.h | 4 +--- > include/hw/misc/aspeed_lpc.h| 4 +--- > include/hw/misc/bcm2835_cprman_internals.h | 12 > include/hw/misc/led.h | 3 +-- > include/hw/misc/mchp_pfsoc_dmc.h| 8 ++-- > include/hw/misc/mchp_pfsoc_ioscb.h | 4 +--- > include/hw/misc/mchp_pfsoc_sysreg.h | 4 +--- > include/hw/misc/npcm7xx_clk.h | 3 +-- > include/hw/misc/npcm7xx_gcr.h | 4 +--- > include/hw/misc/npcm7xx_mft.h | 4 +--- > include/hw/misc/npcm7xx_pwm.h | 3 +-- > include/hw/misc/sifive_e_prci.h | 4 +--- > include/hw/misc/sifive_test.h | 4 +--- > include/hw/misc/sifive_u_otp.h | 4 +--- > include/hw/misc/sifive_u_prci.h | 4 +--- > include/hw/misc/xlnx-versal-xramc.h | 4 +--- > include/hw/net/npcm7xx_emc.h| 4 +--- > include/hw/net/xlnx-zynqmp-can.h| 4 +--- > include/hw/ppc/spapr_drc.h | 4 +--- > include/hw/register.h | 3 +-- > include/hw/riscv/microchip_pfsoc.h | 4 +--- > include/hw/riscv/shakti_c.h | 8 ++-- > include/hw/riscv/sifive_e.h | 4 +--- > include/hw/riscv/sifive_u.h | 4 +--- > include/hw/sd/cadence_sdhci.h | 4 +--- > include/hw/ssi/sifive_spi.h | 4 +--- > include/hw/timer/npcm7xx_timer.h| 3 +-- > include/hw/tricore/tricore_testdevice.h | 4 +--- > include/hw/usb/hcd-dwc3.h | 4 +--- > include/hw/usb/xlnx-versal-usb2-ctrl-regs.h | 4 +--- > hw/m68k/mcf5206.c | 4 +--- > hw/mips/boston.c| 4 +--- > hw/misc/npcm7xx_clk.c | 9 +++-- > hw/net/can/ctucan_pci.c | 4 +--- > hw/s390x/vhost-user-fs-ccw.c| 4 +--- > hw/sensor/adm1272.c | 4 +--- > hw/sensor/max34451.c| 4 +--- > 47 files changed, 56 insertions(+), 154 deletions(-) > diff --git a/include/hw/usb/xlnx-versal-usb2-ctrl-regs.h > b/include/hw/usb/xlnx-versal-usb2-ctrl-regs.h > index 701302ad044..2576193e673 100644 > --- a/include/hw/usb/xlnx-versal-usb2-ctrl-regs.h > +++ b/include/hw/usb/xlnx-versal-usb2-ctrl-regs.h > @@ -29,9 +29,7 @@ > > #define TYPE_XILINX_VERSAL_USB2_CTRL_REGS "xlnx.versal-usb2-ctrl-regs" > > -typedef struct VersalUsb2CtrlRegs VersalUsb2CtrlRegs; > -DECLARE_INSTANCE_CHECKER(VersalUsb2CtrlRegs, XILINX_VERSAL_USB2_CTRL_REGS, > - TYPE_XILINX_VERSAL_USB2_CTRL_REGS) > +OBJECT_DECLARE_SIMPLE_TYPE(VersalUsb2CtrlRegs, XILINX_VERSAL_USB2_CTRL_REGS) Unrelated to this patch, we should remove the _regs suffix from this model. Reviewed-by: Philippe Mathieu-Daudé
[PATCH for-6.2 12/12] [automated] Use OBJECT_DECLARE_SIMPLE_TYPE when possible
Replace typedef + DECLARE_INSTANCE_CHECKER with equivalent OBJECT_DECLARE_SIMPLE_TYPE macro. Generated using: $ ./scripts/codeconverter/converter.py -i \ --pattern=AddObjectDeclareSimpleType $(git grep -l '' -- '*.[ch]') Signed-off-by: Eduardo Habkost --- Cc: Thomas Huth Cc: Paul Burton Cc: Aleksandar Rikalo Cc: "Philippe Mathieu-Daudé" Cc: Aurelien Jarno Cc: Jiaxun Yang Cc: Havard Skinnemoen Cc: Tyrone Ting Cc: Pavel Pisa Cc: Vikram Garhwal Cc: Jason Wang Cc: Keith Busch Cc: Klaus Jensen Cc: "Michael S. Tsirkin" Cc: Richard Henderson Cc: David Hildenbrand Cc: Cornelia Huck Cc: Halil Pasic Cc: Christian Borntraeger Cc: Gerd Hoffmann Cc: Vijai Kumar K Cc: Alistair Francis Cc: Bin Meng Cc: Palmer Dabbelt Cc: "Edgar E. Iglesias" Cc: Peter Maydell Cc: Laurent Vivier Cc: "Cédric Le Goater" Cc: Andrew Jeffery Cc: Joel Stanley Cc: Andrew Baumann Cc: Francisco Iglesias Cc: David Gibson Cc: Greg Kurz Cc: Bastian Koppelmann Cc: qemu-de...@nongnu.org Cc: qemu-...@nongnu.org Cc: qemu-block@nongnu.org Cc: qemu-s3...@nongnu.org Cc: qemu-ri...@nongnu.org Cc: qemu-...@nongnu.org --- hw/nvme/nvme.h | 10 +++--- hw/usb/hcd-xhci-pci.h | 4 +--- hw/usb/hcd-xhci-sysbus.h| 4 +--- include/hw/adc/npcm7xx_adc.h| 4 +--- include/hw/char/shakti_uart.h | 4 +--- include/hw/dma/sifive_pdma.h| 4 +--- include/hw/dma/xlnx_csu_dma.h | 4 +--- include/hw/gpio/sifive_gpio.h | 4 +--- include/hw/intc/m68k_irqc.h | 4 +--- include/hw/intc/sifive_clint.h | 4 +--- include/hw/intc/sifive_plic.h | 4 +--- include/hw/misc/aspeed_lpc.h| 4 +--- include/hw/misc/bcm2835_cprman_internals.h | 12 include/hw/misc/led.h | 3 +-- include/hw/misc/mchp_pfsoc_dmc.h| 8 ++-- include/hw/misc/mchp_pfsoc_ioscb.h | 4 +--- include/hw/misc/mchp_pfsoc_sysreg.h | 4 +--- include/hw/misc/npcm7xx_clk.h | 3 +-- include/hw/misc/npcm7xx_gcr.h | 4 +--- include/hw/misc/npcm7xx_mft.h | 4 +--- include/hw/misc/npcm7xx_pwm.h | 3 +-- include/hw/misc/sifive_e_prci.h | 4 +--- include/hw/misc/sifive_test.h | 4 +--- include/hw/misc/sifive_u_otp.h | 4 +--- include/hw/misc/sifive_u_prci.h | 4 +--- include/hw/misc/xlnx-versal-xramc.h | 4 +--- include/hw/net/npcm7xx_emc.h| 4 +--- include/hw/net/xlnx-zynqmp-can.h| 4 +--- include/hw/ppc/spapr_drc.h | 4 +--- include/hw/register.h | 3 +-- include/hw/riscv/microchip_pfsoc.h | 4 +--- include/hw/riscv/shakti_c.h | 8 ++-- include/hw/riscv/sifive_e.h | 4 +--- include/hw/riscv/sifive_u.h | 4 +--- include/hw/sd/cadence_sdhci.h | 4 +--- include/hw/ssi/sifive_spi.h | 4 +--- include/hw/timer/npcm7xx_timer.h| 3 +-- include/hw/tricore/tricore_testdevice.h | 4 +--- include/hw/usb/hcd-dwc3.h | 4 +--- include/hw/usb/xlnx-versal-usb2-ctrl-regs.h | 4 +--- hw/m68k/mcf5206.c | 4 +--- hw/mips/boston.c| 4 +--- hw/misc/npcm7xx_clk.c | 9 +++-- hw/net/can/ctucan_pci.c | 4 +--- hw/s390x/vhost-user-fs-ccw.c| 4 +--- hw/sensor/adm1272.c | 4 +--- hw/sensor/max34451.c| 4 +--- 47 files changed, 56 insertions(+), 154 deletions(-) diff --git a/hw/nvme/nvme.h b/hw/nvme/nvme.h index c4c43da5c17..a9ee5c4f1de 100644 --- a/hw/nvme/nvme.h +++ b/hw/nvme/nvme.h @@ -42,9 +42,7 @@ typedef struct NvmeBus { } NvmeBus; #define TYPE_NVME_SUBSYS "nvme-subsys" -typedef struct NvmeSubsystem NvmeSubsystem; -DECLARE_INSTANCE_CHECKER(NvmeSubsystem, NVME_SUBSYS, - TYPE_NVME_SUBSYS) +OBJECT_DECLARE_SIMPLE_TYPE(NvmeSubsystem, NVME_SUBSYS) struct NvmeSubsystem { DeviceState parent_obj; @@ -83,8 +81,7 @@ static inline NvmeNamespace *nvme_subsys_ns(NvmeSubsystem *subsys, } #define TYPE_NVME_NS "nvme-ns" -DECLARE_INSTANCE_CHECKER(NvmeNamespace, NVME_NS, - TYPE_NVME_NS) +OBJECT_DECLARE_SIMPLE_TYPE(NvmeNamespace, NVME_NS) typedef struct NvmeZone { NvmeZoneDescr d; @@ -377,8 +374,7 @@ typedef struct NvmeCQueue { } NvmeCQueue; #define TYPE_NVME "nvme" -DECLARE_INSTANCE_CHECKER(NvmeCtrl, NVME, - TYPE_NVME) +OBJECT_DECLARE_SIMPLE_TYPE(NvmeCtrl, NVME) typedef struct NvmeParams { char *serial; diff --git a/hw/usb/hcd-xhci-pci.h b/hw/usb/hcd-xhci-pci.h index d83aad82e04..2ad2eeefb7f 100644 --- a/hw/usb/hcd-xhci-pci.h +++