Skip to contentSkip to conversation

qom: Automated conversion of type checking boilerplate

PATCH Superseded Eduardo Habkost 10 participants 103 messages Aug 13, 2020 – Aug 25, 2020 Page 1 of 3

Subsystems (16)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

cover qom: Automated conversion of type checking boilerplate

This is an extension of the series previously submitted by Daniel[1], including a script that will convert existing type checker macros automatically.

The series is divided in the following sections:

Constant renaming
-----------------

Patches 1-10 will just rename existing constants that will conflict with the type checker function names.

Fix and cleanups of existing code
---------------------------------

Patches 11-25 are changes to existing code
that will either fix existing issues, delete unused and broken macros, or move typedefs around to make code conversion easier.

Original patches from Daniel
----------------------------

Patches 24-25 are the ones originally submitted by Daniel.

They introduce the macros:
* OBJECT_DECLARE_TYPE
* OBJECT_DECLARE_SIMPLE_TYPE
* OBJECT_DEFINE_TYPE
* OBJECT_DEFINE_TYPE_WITH_INTERFACES
* OBJECT_DEFINE_ABSTRACT_TYPE

Changes to new macros
---------------------

Patches 26-31 extend the macros introduced by Daniel. It includes small bug fixes, change the arguments to a few macros, and introduce a few new macros:

* DECLARE_INSTANCE_CHECKER
* DECLARE_CLASS_CHECKERS
* DECLARE_OBJ_CHECKERS
* TYPE_INFO

Automated code conversion
-------------------------

Patch 32 is the code conversion script that will look for common patterns and change them to use the new macros.

Patches 33-39 are all automatically generated by that script, to gradually transform existing code into DECLARE_*CHECKER or OBJECT_DECLARE*_TYPE macros.

Original crypto QOM patches from Daniel
---------------------------------------

Patches 40-41 are the patches originally sent by Daniel to convert the crypto QOM code to use the new macros, rebased and updated to pass additional arguments to OBJECT_DECLARE_*.

[1] https://lore.kernel.org/qemu-devel/20200723181410.3145233-1-berrange@redh=
at.com/

Daniel P. Berrang=C3=A9 (4):
qom: make object_ref/unref use a void * instead of Object *.
qom: provide convenient macros for declaring and defining types
crypto: use QOM macros for declaration/definition of secret types
crypto: use QOM macros for declaration/definition of TLS creds types

Eduardo Habkost (37):
pl1110: Rename PL1110 enum
e1000: Rename QOM class cast macros
megasas: Rename QOM class cast macros
vmw_pvscsi: Rename QOM class cast macros
aspeed_timer: Fix ASPEED_TIMER macro definition
allwinner-h3: Rename memmap enum constants
aspeed_soc: Rename memmap/irqmap enum constants
opentitan: Rename memmap enum constants
sifive_e: Rename memmap enum constants
sifive_u: Rename memmap enum constants
versatile: Fix typo in PCI_VPB_HOST definition
virtio-ccw: Fix definition of VIRTIO_CCW_BUS_GET_CLASS
hvf: Add missing include
hcd-dwc2: Rename USB_*CLASS macros for consistency
tulip: Move TulipState typedef to header
throttle-groups: Move ThrottleGroup typedef to header
pci: Move PCIBusClass typedef to pci.h
i8254: Move PITCommonState/PITCommonClass typedefs to i8254.h
hvf: Move HVFState typedef to hvf.h
mcf_fec: Move mcf_fec_state typedef to header
s390_flic: Move KVMS390FLICState typedef to header
can_emu: Delete macros for non-existing typedef
nubus: Delete unused NUBUS_BRIDGE macro
platform-bus: Delete macros for non-existing typedef
qom: Fix G_DEFINE_AUTOPTR_CLEANUP_FUNC
qom: Allow class type name to be specified in OBJECT_DECLARE*
qom: DECLARE_*_CHECKERS macros
qom: Make type checker functions accept const pointers
qom: TYPE_INFO macro
codeconverter: script for automating QOM code cleanups [automated] Delete duplicate QOM typedefs [automated] Use TYPE_INFO macro
[automated] Move QOM typedefs and add missing includes [automated] Use DECLARE_*CHECKER* macros
[automated] Use DECLARE_*CHECKER* when possible (--force mode) [automated] Use OBJECT_DECLARE_TYPE where possible [automated] Use OBJECT_DECLARE_SIMPLE_TYPE when possible

 .../codeconverter/codeconverter/__init__.py   |   0
 .../codeconverter/codeconverter/patching.py   | 369 +++++++++++
 .../codeconverter/codeconverter/qom_macros.py | 614 ++++++++++++++++++
 .../codeconverter/qom_type_info.py            | 314 +++++++++
 .../codeconverter/codeconverter/regexps.py    |  89 +++
 .../codeconverter/test_patching.py            |  98 +++
 .../codeconverter/test_regexps.py             | 272 ++++++++
 scripts/codeconverter/codeconverter/utils.py  |  65 ++
 scripts/codeconverter/converter.py            | 113 ++++
 chardev/chardev-internal.h                    |   8 +-
 hw/9pfs/virtio-9p.h                           |  11 +-
 hw/audio/intel-hda.h                          |  20 +-
 hw/avr/atmega.h                               |   9 +-
 hw/block/nvme.h                               |  10 +-
 hw/display/ati_int.h                          |   9 +-
 hw/display/qxl.h                              |   9 +-
 hw/display/virtio-vga.h                       |  17 +-
 hw/i386/amd_iommu.h                           |  10 +-
 hw/ide/ahci_internal.h                        |   8 +-
 hw/misc/tmp105.h                              |   9 +-
 hw/net/fsl_etsec/etsec.h                      |  10 +-
 hw/net/tulip.h                                |   5 +-
 hw/net/vmxnet3_defs.h                         |   9 +-
 hw/ppc/e500-ccsr.h                            |   9 +-
 hw/ppc/e500.h                                 |  19 +-
 hw/ppc/mac.h                                  |  19 +-
 hw/rdma/vmw/pvrdma.h                          |   9 +-
 hw/s390x/ccw-device.h                         |  17 +-
 hw/s390x/ipl.h                                |   6 +-
 hw/s390x/s390-pci-bus.h                       |  34 +-
 hw/s390x/virtio-ccw.h                         | 141 ++--
 hw/usb/ccid.h                                 |  14 +-
 hw/usb/hcd-dwc2.h                             |   9 +-
 hw/usb/hcd-ehci.h                             |  36 +-
 hw/usb/hcd-ohci.h                             |   9 +-
 hw/usb/hcd-xhci.h                             |   7 +-
 hw/virtio/virtio-mem-pci.h                    |   5 +-
 hw/virtio/virtio-pci.h                        |  24 +-
 hw/virtio/virtio-pmem-pci.h                   |   5 +-
 hw/xen/xen_pt.h                               |   5 +-
 include/authz/base.h                          |  15 +-
 include/authz/list.h                          |  17 +-
 include/authz/listfile.h                      |  17 +-
 include/authz/pamacct.h                       |  17 +-
 include/authz/simple.h                        |  17 +-
 include/block/throttle-groups.h               |   5 +-
 include/chardev/char-fd.h                     |   9 +-
 include/chardev/char-win.h                    |   9 +-
 include/chardev/char.h                        |  12 +-
 include/chardev/spice.h                       |   9 +-
 include/crypto/secret.h                       |  11 +-
 include/crypto/secret_common.h                |  12 +-
 include/crypto/secret_keyring.h               |  24 +-
 include/crypto/tls-cipher-suites.h            |   9 +-
 include/crypto/tlscreds.h                     |  13 +-
 include/crypto/tlscredsanon.h                 |  15 +-
 include/crypto/tlscredspsk.h                  |  14 +-
 include/crypto/tlscredsx509.h                 |  14 +-
 include/exec/memory.h                         |  19 +-
 include/hw/acpi/acpi_dev_interface.h          |  13 +-
 include/hw/acpi/generic_event_device.h        |  10 +-
 include/hw/acpi/vmgenid.h                     |   9 +-
 include/hw/adc/stm32f2xx_adc.h                |  10 +-
 include/hw/arm/allwinner-a10.h                |   9 +-
 include/hw/arm/allwinner-h3.h                 |  70 +-
 include/hw/arm/armsse.h                       |  11 +-
 include/hw/arm/armv7m.h                       |  17 +-
 include/hw/arm/aspeed.h                       |  14 +-
 include/hw/arm/aspeed_soc.h                   | 110 ++--
 include/hw/arm/bcm2835_peripherals.h          |  10 +-
 include/hw/arm/bcm2836.h                      |  18 +-
 include/hw/arm/digic.h                        |   9 +-
 include/hw/arm/exynos4210.h                   |  10 +-
 include/hw/arm/fsl-imx25.h                    |   9 +-
 include/hw/arm/fsl-imx31.h                    |   9 +-
 include/hw/arm/fsl-imx6.h                     |   9 +-
 include/hw/arm/fsl-imx6ul.h                   |   9 +-
 include/hw/arm/fsl-imx7.h                     |   9 +-
 include/hw/arm/linux-boot-if.h                |  11 +-
 include/hw/arm/msf2-soc.h                     |   9 +-
 include/hw/arm/nrf51_soc.h                    |  10 +-
 include/hw/arm/omap.h                         |  20 +-
 include/hw/arm/smmu-common.h                  |  18 +-
 include/hw/arm/smmuv3.h                       |  18 +-
 include/hw/arm/stm32f205_soc.h                |  10 +-
 include/hw/arm/stm32f405_soc.h                |  10 +-
 include/hw/arm/virt.h                         |  19 +-
 include/hw/arm/xlnx-versal.h                  |   9 +-
 include/hw/arm/xlnx-zynqmp.h                  |  10 +-
 include/hw/block/flash.h                      |  13 +-
 include/hw/block/swim.h                       |  12 +-
 include/hw/boards.h                           |   8 +-
 include/hw/char/avr_usart.h                   |  10 +-
 include/hw/char/bcm2835_aux.h                 |   9 +-
 include/hw/char/cadence_uart.h                |  10 +-
 include/hw/char/cmsdk-apb-uart.h              |  10 +-
 include/hw/char/digic-uart.h                  |  10 +-
 include/hw/char/escc.h                        |   9 +-
 include/hw/char/ibex_uart.h                   |  10 +-
 include/hw/char/imx_serial.h                  |   9 +-
 include/hw/char/nrf51_uart.h                  |   9 +-
 include/hw/char/pl011.h                       |   9 +-
 include/hw/char/renesas_sci.h                 |   9 +-
 include/hw/char/serial.h                      |  25 +-
 include/hw/char/stm32f2xx_usart.h             |  10 +-
 include/hw/clock.h                            |   5 +-
 include/hw/core/cpu.h                         |  10 +-
 include/hw/core/generic-loader.h              |  10 +-
 include/hw/core/split-irq.h                   |   3 +-
 include/hw/cpu/a15mpcore.h                    |  10 +-
 include/hw/cpu/a9mpcore.h                     |  10 +-
 include/hw/cpu/arm11mpcore.h                  |  10 +-
 include/hw/cpu/cluster.h                      |  10 +-
 include/hw/cpu/core.h                         |  10 +-
 include/hw/display/bcm2835_fb.h               |   9 +-
 include/hw/display/dpcd.h                     |   4 +-
 include/hw/display/i2c-ddc.h                  |   4 +-
 include/hw/display/macfb.h                    |  22 +-
 include/hw/display/xlnx_dp.h                  |   9 +-
 include/hw/dma/bcm2835_dma.h                  |  10 +-
 include/hw/dma/pl080.h                        |   9 +-
 include/hw/dma/xlnx-zdma.h                    |  10 +-
 include/hw/dma/xlnx-zynq-devcfg.h             |  10 +-
 include/hw/dma/xlnx_dpdma.h                   |   4 +-
 include/hw/fw-path-provider.h                 |  11 +-
 include/hw/gpio/aspeed_gpio.h                 |  18 +-
 include/hw/gpio/bcm2835_gpio.h                |  10 +-
 include/hw/gpio/imx_gpio.h                    |   9 +-
 include/hw/gpio/nrf51_gpio.h                  |   9 +-
 include/hw/hotplug.h                          |  11 +-
 include/hw/hyperv/vmbus-bridge.h              |   9 +-
 include/hw/hyperv/vmbus.h                     |  14 +-
 include/hw/i2c/arm_sbcon_i2c.h                |  10 +-
 include/hw/i2c/aspeed_i2c.h                   |  19 +-
 include/hw/i2c/i2c.h                          |  19 +-
 include/hw/i2c/imx_i2c.h                      |   9 +-
 include/hw/i2c/microbit_i2c.h                 |  10 +-
 include/hw/i2c/ppc4xx_i2c.h                   |   9 +-
 include/hw/i2c/smbus_slave.h                  |  15 +-
 include/hw/i386/apic_internal.h               |  17 +-
 include/hw/i386/ich9.h                        |  10 +-
 include/hw/i386/intel_iommu.h                 |   7 +-
 include/hw/i386/ioapic_internal.h             |  16 +-
 include/hw/i386/microvm.h                     |  19 +-
 include/hw/i386/pc.h                          |  14 +-
 include/hw/i386/x86-iommu.h                   |   5 +-
 include/hw/i386/x86.h                         |  19 +-
 include/hw/ide/internal.h                     |  19 +-
 include/hw/ide/pci.h                          |   9 +-
 include/hw/input/adb.h                        |  16 +-
 include/hw/intc/allwinner-a10-pic.h           |   9 +-
 include/hw/intc/arm_gic.h                     |  14 +-
 include/hw/intc/arm_gic_common.h              |  21 +-
 include/hw/intc/arm_gicv3.h                   |  13 +-
 include/hw/intc/arm_gicv3_common.h            |  16 +-
 include/hw/intc/arm_gicv3_its_common.h        |  11 +-
 include/hw/intc/armv7m_nvic.h                 |  10 +-
 include/hw/intc/aspeed_vic.h                  |   9 +-
 include/hw/intc/bcm2835_ic.h                  |   9 +-
 include/hw/intc/bcm2836_control.h             |  10 +-
 include/hw/intc/heathrow_pic.h                |   9 +-
 include/hw/intc/ibex_plic.h                   |  10 +-
 include/hw/intc/imx_avic.h                    |   9 +-
 include/hw/intc/imx_gpcv2.h                   |   9 +-
 include/hw/intc/intc.h                        |  11 +-
 include/hw/intc/mips_gic.h                    |   6 +-
 include/hw/intc/realview_gic.h                |  10 +-
 include/hw/intc/rx_icu.h                      |   4 +-
 include/hw/intc/xlnx-pmu-iomod-intc.h         |  10 +-
 include/hw/intc/xlnx-zynqmp-ipi.h             |  10 +-
 include/hw/ipack/ipack.h                      |  14 +-
 include/hw/ipmi/ipmi.h                        |  36 +-
 include/hw/isa/i8259_internal.h               |  15 +-
 include/hw/isa/isa.h                          |  28 +-
 include/hw/isa/pc87312.h                      |   9 +-
 include/hw/isa/superio.h                      |  19 +-
 include/hw/m68k/mcf_fec.h                     |   5 +-
 include/hw/mem/memory-device.h                |  11 +-
 include/hw/mem/nvdimm.h                       |  11 +-
 include/hw/mem/pc-dimm.h                      |  17 +-
 include/hw/mips/cps.h                         |   9 +-
 include/hw/misc/a9scu.h                       |   9 +-
 include/hw/misc/allwinner-cpucfg.h            |   9 +-
 include/hw/misc/allwinner-h3-ccu.h            |   9 +-
 include/hw/misc/allwinner-h3-dramc.h          |   9 +-
 include/hw/misc/allwinner-h3-sysctrl.h        |   9 +-
 include/hw/misc/allwinner-sid.h               |   9 +-
 include/hw/misc/arm11scu.h                    |   9 +-
 include/hw/misc/armsse-cpuid.h                |   9 +-
 include/hw/misc/armsse-mhu.h                  |   9 +-
 include/hw/misc/aspeed_scu.h                  |  18 +-
 include/hw/misc/aspeed_sdmc.h                 |  18 +-
 include/hw/misc/aspeed_xdma.h                 |   9 +-
 include/hw/misc/auxbus.h                      |   8 +-
 include/hw/misc/avr_power.h                   |   9 +-
 include/hw/misc/bcm2835_mbox.h                |  10 +-
 include/hw/misc/bcm2835_mphi.h                |   5 +-
 include/hw/misc/bcm2835_property.h            |  10 +-
 include/hw/misc/bcm2835_rng.h                 |  10 +-
 include/hw/misc/bcm2835_thermal.h             |  10 +-
 include/hw/misc/grlib_ahb_apb_pnp.h           |   9 +-
 include/hw/misc/imx25_ccm.h                   |   9 +-
 include/hw/misc/imx31_ccm.h                   |   9 +-
 include/hw/misc/imx6_ccm.h                    |   9 +-
 include/hw/misc/imx6_src.h                    |   9 +-
 include/hw/misc/imx6ul_ccm.h                  |   9 +-
 include/hw/misc/imx7_ccm.h                    |  17 +-
 include/hw/misc/imx7_gpr.h                    |   9 +-
 include/hw/misc/imx7_snvs.h                   |   9 +-
 include/hw/misc/imx_ccm.h                     |  11 +-
 include/hw/misc/imx_rngc.h                    |   9 +-
 include/hw/misc/iotkit-secctl.h               |   6 +-
 include/hw/misc/iotkit-sysctl.h               |  10 +-
 include/hw/misc/iotkit-sysinfo.h              |  10 +-
 include/hw/misc/mac_via.h                     |  27 +-
 include/hw/misc/macio/cuda.h                  |  18 +-
 include/hw/misc/macio/gpio.h                  |   9 +-
 include/hw/misc/macio/macio.h                 |  43 +-
 include/hw/misc/macio/pmu.h                   |  18 +-
 include/hw/misc/max111x.h                     |  10 +-
 include/hw/misc/mips_cmgcr.h                  |   6 +-
 include/hw/misc/mips_cpc.h                    |   9 +-
 include/hw/misc/mips_itu.h                    |   9 +-
 include/hw/misc/mos6522.h                     |  11 +-
 include/hw/misc/mps2-fpgaio.h                 |   9 +-
 include/hw/misc/mps2-scc.h                    |   9 +-
 include/hw/misc/msf2-sysreg.h                 |   9 +-
 include/hw/misc/nrf51_rng.h                   |   9 +-
 include/hw/misc/pca9552.h                     |   9 +-
 include/hw/misc/stm32f2xx_syscfg.h            |  10 +-
 include/hw/misc/stm32f4xx_exti.h              |  10 +-
 include/hw/misc/stm32f4xx_syscfg.h            |  10 +-
 include/hw/misc/tz-mpc.h                      |   6 +-
 include/hw/misc/tz-msc.h                      |   9 +-
 include/hw/misc/tz-ppc.h                      |   6 +-
 include/hw/misc/unimp.h                       |  10 +-
 include/hw/misc/vmcoreinfo.h                  |   9 +-
 include/hw/misc/zynq-xadc.h                   |  10 +-
 include/hw/net/allwinner-sun8i-emac.h         |   9 +-
 include/hw/net/allwinner_emac.h               |   9 +-
 include/hw/net/cadence_gem.h                  |   9 +-
 include/hw/net/ftgmac100.h                    |  17 +-
 include/hw/net/imx_fec.h                      |   9 +-
 include/hw/net/lance.h                        |  10 +-
 include/hw/net/lasi_82596.h                   |  10 +-
 include/hw/net/msf2-emac.h                    |  10 +-
 include/hw/nmi.h                              |  11 +-
 include/hw/nubus/mac-nubus-bridge.h           |  10 +-
 include/hw/nubus/nubus.h                      |  19 +-
 include/hw/nvram/fw_cfg.h                     |  21 +-
 include/hw/nvram/nrf51_nvm.h                  |   9 +-
 include/hw/or-irq.h                           |   3 +-
 include/hw/pci-bridge/simba.h                 |  10 +-
 include/hw/pci-host/designware.h              |  16 +-
 include/hw/pci-host/gpex.h                    |  19 +-
 include/hw/pci-host/i440fx.h                  |  10 +-
 include/hw/pci-host/pnv_phb3.h                |  20 +-
 include/hw/pci-host/pnv_phb4.h                |  21 +-
 include/hw/pci-host/q35.h                     |  19 +-
 include/hw/pci-host/sabre.h                   |  19 +-
 include/hw/pci-host/spapr.h                   |   7 +-
 include/hw/pci-host/uninorth.h                |  31 +-
 include/hw/pci-host/xilinx-pcie.h             |  19 +-
 include/hw/pci/pci.h                          |  20 +-
 include/hw/pci/pci_bridge.h                   |   4 +-
 include/hw/pci/pci_bus.h                      |   4 +-
 include/hw/pci/pci_host.h                     |  14 +-
 include/hw/pci/pcie_host.h                    |   5 +-
 include/hw/pci/pcie_port.h                    |  18 +-
 include/hw/pcmcia.h                           |  19 +-
 include/hw/platform-bus.h                     |   9 +-
 include/hw/ppc/mac_dbdma.h                    |   9 +-
 include/hw/ppc/openpic.h                      |   9 +-
 include/hw/ppc/pnv.h                          |  75 +--
 include/hw/ppc/pnv_core.h                     |  26 +-
 include/hw/ppc/pnv_homer.h                    |  22 +-
 include/hw/ppc/pnv_lpc.h                      |  28 +-
 include/hw/ppc/pnv_occ.h                      |  22 +-
 include/hw/ppc/pnv_pnor.h                     |   9 +-
 include/hw/ppc/pnv_psi.h                      |  35 +-
 include/hw/ppc/pnv_xive.h                     |  16 +-
 include/hw/ppc/pnv_xscom.h                    |  10 +-
 include/hw/ppc/spapr.h                        |  23 +-
 include/hw/ppc/spapr_cpu_core.h               |  17 +-
 include/hw/ppc/spapr_drc.h                    |  80 +--
 include/hw/ppc/spapr_irq.h                    |  12 +-
 include/hw/ppc/spapr_tpm_proxy.h              |   9 +-
 include/hw/ppc/spapr_vio.h                    |  19 +-
 include/hw/ppc/spapr_xive.h                   |  16 +-
 include/hw/ppc/xics.h                         |  31 +-
 include/hw/ppc/xics_spapr.h                   |   4 +-
 include/hw/ppc/xive.h                         |  77 ++-
 include/hw/qdev-core.h                        |  15 +-
 include/hw/rdma/rdma.h                        |   5 +-
 include/hw/register.h                         |   4 +-
 include/hw/resettable.h                       |  11 +-
 include/hw/riscv/opentitan.h                  |  48 +-
 include/hw/riscv/riscv_hart.h                 |  10 +-
 include/hw/riscv/sifive_clint.h               |  10 +-
 include/hw/riscv/sifive_e.h                   |  57 +-
 include/hw/riscv/sifive_e_prci.h              |  10 +-
 include/hw/riscv/sifive_gpio.h                |   9 +-
 include/hw/riscv/sifive_plic.h                |  10 +-
 include/hw/riscv/sifive_test.h                |  10 +-
 include/hw/riscv/sifive_u.h                   |  49 +-
 include/hw/riscv/sifive_u_otp.h               |  10 +-
 include/hw/riscv/sifive_u_prci.h              |  10 +-
 include/hw/riscv/sifive_uart.h                |  10 +-
 include/hw/riscv/virt.h                       |  10 +-
 include/hw/rtc/allwinner-rtc.h                |  18 +-
 include/hw/rtc/aspeed_rtc.h                   |   9 +-
 include/hw/rtc/goldfish_rtc.h                 |  10 +-
 include/hw/rtc/m48t59.h                       |  11 +-
 include/hw/rtc/mc146818rtc.h                  |   9 +-
 include/hw/rtc/pl031.h                        |   9 +-
 include/hw/rtc/xlnx-zynqmp-rtc.h              |  10 +-
 include/hw/rx/rx62n.h                         |   9 +-
 include/hw/s390x/3270-ccw.h                   |  19 +-
 include/hw/s390x/ap-device.h                  |  10 +-
 include/hw/s390x/css-bridge.h                 |  18 +-
 include/hw/s390x/event-facility.h             |  34 +-
 include/hw/s390x/s390-ccw.h                   |  19 +-
 include/hw/s390x/s390-virtio-ccw.h            |  11 +-
 include/hw/s390x/s390_flic.h                  |  31 +-
 include/hw/s390x/sclp.h                       |  14 +-
 include/hw/s390x/storage-attributes.h         |  37 +-
 include/hw/s390x/storage-keys.h               |  28 +-
 include/hw/s390x/tod.h                        |  18 +-
 include/hw/s390x/vfio-ccw.h                   |   7 +-
 include/hw/scsi/esp.h                         |   9 +-
 include/hw/scsi/scsi.h                        |  19 +-
 include/hw/sd/allwinner-sdhost.h              |  18 +-
 include/hw/sd/aspeed_sdhci.h                  |  10 +-
 include/hw/sd/bcm2835_sdhost.h                |  10 +-
 include/hw/sd/sd.h                            |  23 +-
 include/hw/sd/sdhci.h                         |  13 +-
 include/hw/sparc/sparc32_dma.h                |  34 +-
 include/hw/sparc/sun4m_iommu.h                |   9 +-
 include/hw/sparc/sun4u_iommu.h                |   9 +-
 include/hw/ssi/aspeed_smc.h                   |  18 +-
 include/hw/ssi/imx_spi.h                      |   9 +-
 include/hw/ssi/mss-spi.h                      |   9 +-
 include/hw/ssi/pl022.h                        |   9 +-
 include/hw/ssi/ssi.h                          |  11 +-
 include/hw/ssi/stm32f2xx_spi.h                |  10 +-
 include/hw/ssi/xilinx_spips.h                 |  32 +-
 include/hw/stream.h                           |  11 +-
 include/hw/sysbus.h                           |  17 +-
 include/hw/timer/a9gtimer.h                   |   6 +-
 include/hw/timer/allwinner-a10-pit.h          |   6 +-
 include/hw/timer/arm_mptimer.h                |  10 +-
 include/hw/timer/armv7m_systick.h             |   9 +-
 include/hw/timer/aspeed_timer.h               |  19 +-
 include/hw/timer/avr_timer16.h                |  10 +-
 include/hw/timer/bcm2835_systmr.h             |  10 +-
 include/hw/timer/cmsdk-apb-dualtimer.h        |   7 +-
 include/hw/timer/cmsdk-apb-timer.h            |  10 +-
 include/hw/timer/digic-timer.h                |   9 +-
 include/hw/timer/i8254.h                      |  11 +-
 include/hw/timer/i8254_internal.h             |   8 +-
 include/hw/timer/imx_epit.h                   |   9 +-
 include/hw/timer/imx_gpt.h                    |   9 +-
 include/hw/timer/mss-timer.h                  |  10 +-
 include/hw/timer/nrf51_timer.h                |   9 +-
 include/hw/timer/renesas_cmt.h                |   9 +-
 include/hw/timer/renesas_tmr.h                |   9 +-
 include/hw/timer/stm32f2xx_timer.h            |  10 +-
 include/hw/usb.h                              |  17 +-
 include/hw/usb/chipidea.h                     |   9 +-
 include/hw/usb/imx-usb-phy.h                  |   9 +-
 include/hw/vfio/vfio-amd-xgbe.h               |  11 +-
 include/hw/vfio/vfio-calxeda-xgmac.h          |  21 +-
 include/hw/vfio/vfio-platform.h               |  19 +-
 include/hw/virtio/vhost-scsi-common.h         |  10 +-
 include/hw/virtio/vhost-scsi.h                |  10 +-
 include/hw/virtio/vhost-user-blk.h            |  10 +-
 include/hw/virtio/vhost-user-fs.h             |  10 +-
 include/hw/virtio/vhost-user-scsi.h           |  10 +-
 include/hw/virtio/vhost-user-vsock.h          |  10 +-
 include/hw/virtio/vhost-vsock-common.h        |  10 +-
 include/hw/virtio/vhost-vsock.h               |  10 +-
 include/hw/virtio/virtio-balloon.h            |  10 +-
 include/hw/virtio/virtio-blk.h                |  10 +-
 include/hw/virtio/virtio-bus.h                |  15 +-
 include/hw/virtio/virtio-crypto.h             |  10 +-
 include/hw/virtio/virtio-gpu-pci.h            |   5 +-
 include/hw/virtio/virtio-gpu.h                |  26 +-
 include/hw/virtio/virtio-input.h              |  29 +-
 include/hw/virtio/virtio-iommu.h              |  10 +-
 include/hw/virtio/virtio-mem.h                |  17 +-
 include/hw/virtio/virtio-mmio.h               |  18 +-
 include/hw/virtio/virtio-net.h                |   7 +-
 include/hw/virtio/virtio-pmem.h               |  17 +-
 include/hw/virtio/virtio-rng.h                |  10 +-
 include/hw/virtio/virtio-scsi.h               |  19 +-
 include/hw/virtio/virtio-serial.h             |  18 +-
 include/hw/virtio/virtio.h                    |  14 +-
 include/hw/vmstate-if.h                       |  11 +-
 include/hw/watchdog/cmsdk-apb-watchdog.h      |  10 +-
 include/hw/watchdog/wdt_aspeed.h              |  19 +-
 include/hw/watchdog/wdt_diag288.h             |  19 +-
 include/hw/watchdog/wdt_imx2.h                |   9 +-
 include/hw/xen/xen-block.h                    |  39 +-
 include/hw/xen/xen-bus.h                      |  37 +-
 include/hw/xen/xen-legacy-backend.h           |   5 +-
 include/io/channel-buffer.h                   |   7 +-
 include/io/channel-command.h                  |   7 +-
 include/io/channel-file.h                     |   7 +-
 include/io/channel-socket.h                   |   7 +-
 include/io/channel-tls.h                      |   7 +-
 include/io/channel-websock.h                  |   7 +-
 include/io/channel.h                          |  12 +-
 include/io/dns-resolver.h                     |  13 +-
 include/io/net-listener.h                     |  14 +-
 include/net/can_emu.h                         |   8 +-
 include/net/can_host.h                        |  21 +-
 include/net/filter.h                          |  13 +-
 include/qom/object.h                          | 332 +++++++++-
 include/qom/object_interfaces.h               |  13 +-
 include/scsi/pr-manager.h                     |  16 +-
 include/sysemu/accel.h                        |  18 +-
 include/sysemu/cryptodev.h                    |  16 +-
 include/sysemu/hostmem.h                      |  10 +-
 include/sysemu/hvf.h                          |   8 +-
 include/sysemu/iothread.h                     |   9 +-
 include/sysemu/kvm_int.h                      |   5 +-
 include/sysemu/rng-random.h                   |   5 +-
 include/sysemu/rng.h                          |  10 +-
 include/sysemu/tpm.h                          |  11 +-
 include/sysemu/tpm_backend.h                  |  12 +-
 include/sysemu/vhost-user-backend.h           |  17 +-
 include/ui/console.h                          |  10 +-
 migration/migration.h                         |   6 +-
 target/alpha/cpu-qom.h                        |  14 +-
 target/arm/cpu-qom.h                          |  19 +-
 target/arm/idau.h                             |  11 +-
 target/avr/cpu-qom.h                          |  14 +-
 target/cris/cpu-qom.h                         |  14 +-
 target/hppa/cpu-qom.h                         |  14 +-
 target/i386/cpu-qom.h                         |  14 +-
 target/i386/hvf/hvf-i386.h                    |   4 +-
 target/lm32/cpu-qom.h                         |  14 +-
 target/m68k/cpu-qom.h                         |  14 +-
 target/microblaze/cpu-qom.h                   |  14 +-
 target/mips/cpu-qom.h                         |  14 +-
 target/moxie/cpu.h                            |  17 +-
 target/nios2/cpu.h                            |  17 +-
 target/openrisc/cpu.h                         |  17 +-
 target/ppc/cpu-qom.h                          |  14 +-
 target/ppc/cpu.h                              |  11 +-
 target/riscv/cpu.h                            |  17 +-
 target/rx/cpu-qom.h                           |   6 +-
 target/s390x/cpu-qom.h                        |  14 +-
 target/sh4/cpu-qom.h                          |  14 +-
 target/sparc/cpu-qom.h                        |  14 +-
 target/tilegx/cpu.h                           |  17 +-
 target/tricore/cpu-qom.h                      |  14 +-
 target/unicore32/cpu-qom.h                    |  14 +-
 target/xtensa/cpu-qom.h                       |  14 +-
 accel/accel.c                                 |   6 +-
 accel/kvm/kvm-all.c                           |   6 +-
 accel/qtest.c                                 |   6 +-
 accel/tcg/tcg-all.c                           |  15 +-
 accel/xen/xen-all.c                           |   6 +-
 authz/base.c                                  |   6 +-
 authz/list.c                                  |   7 +-
 authz/listfile.c                              |   7 +-
 authz/pamacct.c                               |   7 +-
 authz/simple.c                                |   7 +-
 backends/cryptodev-builtin.c                  |  15 +-
 backends/cryptodev-vhost-user.c               |  18 +-
 backends/cryptodev.c                          |   7 +-
 backends/dbus-vmstate.c                       |  23 +-
 backends/hostmem-file.c                       |  13 +-
 backends/hostmem-memfd.c                      |   9 +-
 backends/hostmem-ram.c                        |   6 +-
 backends/hostmem.c                            |   6 +-
 backends/rng-builtin.c                        |  15 +-
 backends/rng-egd.c                            |  16 +-
 backends/rng-random.c                         |   6 +-
 backends/rng.c                                |   6 +-
 backends/tpm/tpm_backend.c                    |   8 +-
 backends/tpm/tpm_emulator.c                   |  16 +-
 backends/tpm/tpm_passthrough.c                |  13 +-
 backends/vhost-user.c                         |   6 +-
 block/throttle-groups.c                       |  10 +-
 chardev/baum.c                                |  15 +-
 chardev/char-console.c                        |   6 +-
 chardev/char-fd.c                             |   6 +-
 chardev/char-mux.c                            |   6 +-
 chardev/char-null.c                           |   6 +-
 chardev/char-parallel.c                       |  23 +-
 chardev/char-pty.c                            |  15 +-
 chardev/char-ringbuf.c                        |  18 +-
 chardev/char-socket.c                         |  16 +-
 chardev/char-udp.c                            |  15 +-
 chardev/char-win-stdio.c                      |  16 +-
 chardev/char-win.c                            |   6 +-
 chardev/char.c                                |   6 +-
 chardev/msmouse.c                             |  16 +-
 chardev/spice.c                               |  10 +-
 chardev/testdev.c                             |  16 +-
 chardev/wctablet.c                            |  16 +-
 crypto/secret.c                               |  24 +-
 crypto/secret_common.c                        |  32 +-
 crypto/secret_keyring.c                       |  28 +-
 crypto/tls-cipher-suites.c                    |   6 +-
 crypto/tlscreds.c                             |  25 +-
 crypto/tlscredsanon.c                         |  23 +-
 crypto/tlscredspsk.c                          |  25 +-
 crypto/tlscredsx509.c                         |  29 +-
 gdbstub.c                                     |   6 +-
 hw/9pfs/virtio-9p-device.c                    |   6 +-
 hw/acpi/generic_event_device.c                |   6 +-
 hw/acpi/piix4.c                               |  16 +-
 hw/acpi/vmgenid.c                             |   6 +-
 hw/adc/stm32f2xx_adc.c                        |   6 +-
 hw/alpha/typhoon.c                            |  18 +-
 hw/arm/allwinner-a10.c                        |   6 +-
 hw/arm/allwinner-h3.c                         | 130 ++--
 hw/arm/armsse.c                               |   2 +-
 hw/arm/armv7m.c                               |   8 +-
 hw/arm/aspeed.c                               |   4 +-
 hw/arm/aspeed_ast2600.c                       | 208 +++---
 hw/arm/aspeed_soc.c                           | 228 +++----
 hw/arm/bcm2835_peripherals.c                  |   6 +-
 hw/arm/bcm2836.c                              |   2 +-
 hw/arm/boot.c                                 |   6 +-
 hw/arm/collie.c                               |  16 +-
 hw/arm/digic.c                                |   6 +-
 hw/arm/exynos4210.c                           |   6 +-
 hw/arm/exynos4_boards.c                       |   8 +-
 hw/arm/fsl-imx25.c                            |   6 +-
 hw/arm/fsl-imx31.c                            |   6 +-
 hw/arm/fsl-imx6.c                             |   6 +-
 hw/arm/fsl-imx6ul.c                           |   6 +-
 hw/arm/fsl-imx7.c                             |   6 +-
 hw/arm/gumstix.c                              |   8 +-
 hw/arm/highbank.c                             |  24 +-
 hw/arm/integratorcp.c                         |  38 +-
 hw/arm/microbit.c                             |  16 +-
 hw/arm/mps2-tz.c                              |  29 +-
 hw/arm/mps2.c                                 |  29 +-
 hw/arm/msf2-soc.c                             |   6 +-
 hw/arm/musca.c                                |  29 +-
 hw/arm/musicpal.c                             |  95 +--
 hw/arm/nrf51_soc.c                            |   6 +-
 hw/arm/nseries.c                              |   8 +-
 hw/arm/omap_sx1.c                             |   8 +-
 hw/arm/orangepi.c                             |   6 +-
 hw/arm/palm.c                                 |  16 +-
 hw/arm/pxa2xx.c                               |  49 +-
 hw/arm/pxa2xx_gpio.c                          |  13 +-
 hw/arm/pxa2xx_pic.c                           |  16 +-
 hw/arm/raspi.c                                |  19 +-
 hw/arm/realview.c                             |  12 +-
 hw/arm/sbsa-ref.c                             |  16 +-
 hw/arm/smmu-common.c                          |   6 +-
 hw/arm/spitz.c                                |  89 ++-
 hw/arm/stellaris.c                            |  46 +-
 hw/arm/stm32f205_soc.c                        |   6 +-
 hw/arm/stm32f405_soc.c                        |   6 +-
 hw/arm/strongarm.c                            |  65 +-
 hw/arm/tosa.c                                 |  28 +-
 hw/arm/versatilepb.c                          |  24 +-
 hw/arm/vexpress.c                             |  29 +-
 hw/arm/virt.c                                 |   6 +-
 hw/arm/xilinx_zynq.c                          |  16 +-
 hw/arm/xlnx-versal-virt.c                     |  16 +-
 hw/arm/xlnx-versal.c                          |   6 +-
 hw/arm/xlnx-zcu102.c                          |  16 +-
 hw/arm/xlnx-zynqmp.c                          |   6 +-
 hw/arm/z2.c                                   |  17 +-
 hw/audio/ac97.c                               |  10 +-
 hw/audio/adlib.c                              |   9 +-
 hw/audio/cs4231.c                             |  16 +-
 hw/audio/cs4231a.c                            |   9 +-
 hw/audio/es1370.c                             |  10 +-
 hw/audio/gus.c                                |   9 +-
 hw/audio/hda-codec.c                          |  16 +-
 hw/audio/intel-hda.c                          |  15 +-
 hw/audio/marvell_88w8618.c                    |  16 +-
 hw/audio/milkymist-ac97.c                     |  13 +-
 hw/audio/pcspk.c                              |  11 +-
 hw/audio/pl041.c                              |  15 +-
 hw/audio/sb16.c                               |   9 +-
 hw/audio/wm8750.c                             |  15 +-
 hw/avr/arduino.c                              |  19 +-
 hw/avr/atmega.c                               |  12 +-
 hw/block/fdc.c                                |  50 +-
 hw/block/m25p80.c                             |  21 +-
 hw/block/nand.c                               |  11 +-
 hw/block/nvme.c                               |   6 +-
 hw/block/onenand.c                            |  15 +-
 hw/block/pflash_cfi01.c                       |   6 +-
 hw/block/pflash_cfi02.c                       |   6 +-
 hw/block/swim.c                               |  10 +-
 hw/block/vhost-user-blk.c                     |   6 +-
 hw/block/virtio-blk.c                         |   6 +-
 hw/block/xen-block.c                          |  10 +-
 hw/char/avr_usart.c                           |   6 +-
 hw/char/bcm2835_aux.c                         |   6 +-
 hw/char/cadence_uart.c                        |   6 +-
 hw/char/cmsdk-apb-uart.c                      |   6 +-
 hw/char/debugcon.c                            |  16 +-
 hw/char/digic-uart.c                          |   6 +-
 hw/char/escc.c                                |   6 +-
 hw/char/etraxfs_ser.c                         |  16 +-
 hw/char/exynos4210_uart.c                     |  16 +-
 hw/char/grlib_apbuart.c                       |  16 +-
 hw/char/ibex_uart.c                           |   6 +-
 hw/char/imx_serial.c                          |   6 +-
 hw/char/ipoctal232.c                          |  11 +-
 hw/char/lm32_juart.c                          |  12 +-
 hw/char/lm32_uart.c                           |  12 +-
 hw/char/mcf_uart.c                            |  15 +-
 hw/char/milkymist-uart.c                      |  13 +-
 hw/char/nrf51_uart.c                          |   6 +-
 hw/char/parallel.c                            |  16 +-
 hw/char/pl011.c                               |   8 +-
 hw/char/renesas_sci.c                         |   6 +-
 hw/char/sclpconsole-lm.c                      |  16 +-
 hw/char/sclpconsole.c                         |  16 +-
 hw/char/serial-isa.c                          |  15 +-
 hw/char/serial-pci-multi.c                    |   8 +-
 hw/char/serial-pci.c                          |  15 +-
 hw/char/serial.c                              |  10 +-
 hw/char/spapr_vty.c                           |  12 +-
 hw/char/stm32f2xx_usart.c                     |   6 +-
 hw/char/terminal3270.c                        |  16 +-
 hw/char/virtio-console.c                      |  18 +-
 hw/char/virtio-serial-bus.c                   |  15 +-
 hw/char/xilinx_uartlite.c                     |  16 +-
 hw/core/bus.c                                 |   6 +-
 hw/core/clock.c                               |   6 +-
 hw/core/cpu.c                                 |   6 +-
 hw/core/fw-path-provider.c                    |   6 +-
 hw/core/generic-loader.c                      |   6 +-
 hw/core/hotplug.c                             |   6 +-
 hw/core/irq.c                                 |   9 +-
 hw/core/machine.c                             |   6 +-
 hw/core/nmi.c                                 |   6 +-
 hw/core/or-irq.c                              |   6 +-
 hw/core/platform-bus.c                        |   6 +-
 hw/core/qdev.c                                |   6 +-
 hw/core/register.c                            |   6 +-
 hw/core/resettable.c                          |   6 +-
 hw/core/split-irq.c                           |   6 +-
 hw/core/stream.c                              |   6 +-
 hw/core/sysbus.c                              |   8 +-
 hw/core/vmstate-if.c                          |   6 +-
 hw/cpu/a15mpcore.c                            |   6 +-
 hw/cpu/a9mpcore.c                             |   6 +-
 hw/cpu/arm11mpcore.c                          |   6 +-
 hw/cpu/cluster.c                              |   6 +-
 hw/cpu/core.c                                 |   6 +-
 hw/cpu/realview_mpcore.c                      |  16 +-
 hw/display/ads7846.c                          |  15 +-
 hw/display/artist.c                           |  15 +-
 hw/display/ati.c                              |   6 +-
 hw/display/bcm2835_fb.c                       |   6 +-
 hw/display/bochs-display.c                    |  16 +-
 hw/display/cg3.c                              |  15 +-
 hw/display/cirrus_vga.c                       |  16 +-
 hw/display/cirrus_vga_isa.c                   |  16 +-
 hw/display/dpcd.c                             |   6 +-
 hw/display/exynos4210_fimd.c                  |  16 +-
 hw/display/g364fb.c                           |  15 +-
 hw/display/i2c-ddc.c                          |   6 +-
 hw/display/jazz_led.c                         |  15 +-
 hw/display/macfb.c                            |   8 +-
 hw/display/milkymist-tmu2.c                   |  13 +-
 hw/display/milkymist-vgafb.c                  |  13 +-
 hw/display/next-fb.c                          |  12 +-
 hw/display/pl110.c                            |  31 +-
 hw/display/qxl.c                              |  10 +-
 hw/display/ramfb-standalone.c                 |  15 +-
 hw/display/sii9022.c                          |  15 +-
 hw/display/sm501.c                            |  26 +-
 hw/display/ssd0303.c                          |  15 +-
 hw/display/ssd0323.c                          |  15 +-
 hw/display/tcx.c                              |  15 +-
 hw/display/vga-isa.c                          |  15 +-
 hw/display/vga-pci.c                          |  19 +-
 hw/display/vhost-user-gpu-pci.c               |  10 +-
 hw/display/vhost-user-gpu.c                   |  11 +-
 hw/display/vhost-user-vga.c                   |  10 +-
 hw/display/virtio-gpu-base.c                  |   7 +-
 hw/display/virtio-gpu-pci.c                   |  12 +-
 hw/display/virtio-gpu.c                       |   6 +-
 hw/display/virtio-vga.c                       |  12 +-
 hw/display/vmware_vga.c                       |  11 +-
 hw/display/xlnx_dp.c                          |   6 +-
 hw/dma/bcm2835_dma.c                          |   6 +-
 hw/dma/i82374.c                               |  15 +-
 hw/dma/i8257.c                                |  11 +-
 hw/dma/pl080.c                                |   8 +-
 hw/dma/pl330.c                                |  10 +-
 hw/dma/puv3_dma.c                             |  15 +-
 hw/dma/pxa2xx_dma.c                           |  15 +-
 hw/dma/rc4030.c                               |  18 +-
 hw/dma/sparc32_dma.c                          |  12 +-
 hw/dma/xilinx_axidma.c                        |  29 +-
 hw/dma/xlnx-zdma.c                            |   6 +-
 hw/dma/xlnx-zynq-devcfg.c                     |   6 +-
 hw/dma/xlnx_dpdma.c                           |   6 +-
 hw/gpio/aspeed_gpio.c                         |  14 +-
 hw/gpio/bcm2835_gpio.c                        |   6 +-
 hw/gpio/gpio_key.c                            |  15 +-
 hw/gpio/imx_gpio.c                            |   6 +-
 hw/gpio/max7310.c                             |  15 +-
 hw/gpio/mpc8xxx.c                             |  15 +-
 hw/gpio/nrf51_gpio.c                          |   6 +-
 hw/gpio/omap_gpio.c                           |   8 +-
 hw/gpio/pl061.c                               |  17 +-
 hw/gpio/puv3_gpio.c                           |  15 +-
 hw/gpio/zaurus.c                              |  12 +-
 hw/hppa/dino.c                                |  16 +-
 hw/hppa/lasi.c                                |  16 +-
 hw/hyperv/hyperv.c                            |  15 +-
 hw/hyperv/hyperv_testdev.c                    |  11 +-
 hw/hyperv/vmbus.c                             |  14 +-
 hw/i2c/aspeed_i2c.c                           |  12 +-
 hw/i2c/bitbang_i2c.c                          |  15 +-
 hw/i2c/core.c                                 |   8 +-
 hw/i2c/exynos4210_i2c.c                       |  16 +-
 hw/i2c/imx_i2c.c                              |   6 +-
 hw/i2c/microbit_i2c.c                         |   6 +-
 hw/i2c/mpc_i2c.c                              |  16 +-
 hw/i2c/omap_i2c.c                             |   6 +-
 hw/i2c/ppc4xx_i2c.c                           |   6 +-
 hw/i2c/smbus_eeprom.c                         |  16 +-
 hw/i2c/smbus_ich9.c                           |  16 +-
 hw/i2c/smbus_slave.c                          |   6 +-
 hw/i2c/versatile_i2c.c                        |  13 +-
 hw/i386/amd_iommu.c                           |  10 +-
 hw/i386/intel_iommu.c                         |   8 +-
 hw/i386/kvm/apic.c                            |   6 +-
 hw/i386/kvm/clock.c                           |  15 +-
 hw/i386/kvm/i8254.c                           |  24 +-
 hw/i386/kvm/i8259.c                           |  18 +-
 hw/i386/kvm/ioapic.c                          |   6 +-
 hw/i386/kvmvapic.c                            |  15 +-
 hw/i386/microvm.c                             |   6 +-
 hw/i386/pc.c                                  |   6 +-
 hw/i386/pc_piix.c                             |   6 +-
 hw/i386/port92.c                              |  15 +-
 hw/i386/vmmouse.c                             |  16 +-
 hw/i386/vmport.c                              |  15 +-
 hw/i386/x86-iommu.c                           |   6 +-
 hw/i386/x86.c                                 |   6 +-
 hw/i386/xen/xen_apic.c                        |   6 +-
 hw/i386/xen/xen_platform.c                    |  16 +-
 hw/i386/xen/xen_pvdevice.c                    |  16 +-
 hw/ide/ahci-allwinner.c                       |  11 +-
 hw/ide/ahci.c                                 |   6 +-
 hw/ide/cmd646.c                               |   6 +-
 hw/ide/ich.c                                  |   6 +-
 hw/ide/isa.c                                  |  15 +-
 hw/ide/macio.c                                |   6 +-
 hw/ide/microdrive.c                           |  17 +-
 hw/ide/mmio.c                                 |  15 +-
 hw/ide/pci.c                                  |   6 +-
 hw/ide/piix.c                                 |  10 +-
 hw/ide/qdev.c                                 |  14 +-
 hw/ide/sii3112.c                              |  14 +-
 hw/ide/via.c                                  |   6 +-
 hw/input/adb-kbd.c                            |  24 +-
 hw/input/adb-mouse.c                          |  24 +-
 hw/input/adb.c                                |   8 +-
 hw/input/lm832x.c                             |  15 +-
 hw/input/milkymist-softusb.c                  |  13 +-
 hw/input/pckbd.c                              |  10 +-
 hw/input/pl050.c                              |  19 +-
 hw/input/vhost-user-input.c                   |   6 +-
 hw/input/virtio-input-hid.c                   |  12 +-
 hw/input/virtio-input-host.c                  |   6 +-
 hw/input/virtio-input.c                       |   6 +-
 hw/intc/allwinner-a10-pic.c                   |   6 +-
 hw/intc/apic.c                                |  11 +-
 hw/intc/apic_common.c                         |   6 +-
 hw/intc/arm_gic.c                             |   6 +-
 hw/intc/arm_gic_common.c                      |   6 +-
 hw/intc/arm_gic_kvm.c                         |  22 +-
 hw/intc/arm_gicv2m.c                          |  15 +-
 hw/intc/arm_gicv3.c                           |   6 +-
 hw/intc/arm_gicv3_common.c                    |   6 +-
 hw/intc/arm_gicv3_its_common.c                |   6 +-
 hw/intc/arm_gicv3_its_kvm.c                   |  19 +-
 hw/intc/arm_gicv3_kvm.c                       |  20 +-
 hw/intc/armv7m_nvic.c                         |   6 +-
 hw/intc/aspeed_vic.c                          |   6 +-
 hw/intc/bcm2835_ic.c                          |   6 +-
 hw/intc/bcm2836_control.c                     |   6 +-
 hw/intc/etraxfs_pic.c                         |  11 +-
 hw/intc/exynos4210_combiner.c                 |  16 +-
 hw/intc/exynos4210_gic.c                      |  31 +-
 hw/intc/grlib_irqmp.c                         |  15 +-
 hw/intc/heathrow_pic.c                        |   6 +-
 hw/intc/i8259.c                               |  16 +-
 hw/intc/i8259_common.c                        |   6 +-
 hw/intc/ibex_plic.c                           |   6 +-
 hw/intc/imx_avic.c                            |   6 +-
 hw/intc/imx_gpcv2.c                           |   6 +-
 hw/intc/intc.c                                |   6 +-
 hw/intc/ioapic.c                              |   6 +-
 hw/intc/ioapic_common.c                       |   6 +-
 hw/intc/lm32_pic.c                            |  12 +-
 hw/intc/loongson_liointc.c                    |  11 +-
 hw/intc/mips_gic.c                            |   6 +-
 hw/intc/nios2_iic.c                           |  16 +-
 hw/intc/omap_intc.c                           |  10 +-
 hw/intc/ompic.c                               |  12 +-
 hw/intc/openpic.c                             |   6 +-
 hw/intc/openpic_kvm.c                         |  16 +-
 hw/intc/pl190.c                               |  15 +-
 hw/intc/pnv_xive.c                            |   6 +-
 hw/intc/puv3_intc.c                           |  15 +-
 hw/intc/realview_gic.c                        |   6 +-
 hw/intc/rx_icu.c                              |   6 +-
 hw/intc/s390_flic.c                           |   8 +-
 hw/intc/s390_flic_kvm.c                       |  22 +-
 hw/intc/slavio_intctl.c                       |  16 +-
 hw/intc/spapr_xive.c                          |   6 +-
 hw/intc/xics.c                                |  10 +-
 hw/intc/xics_pnv.c                            |   6 +-
 hw/intc/xics_spapr.c                          |   6 +-
 hw/intc/xilinx_intc.c                         |  10 +-
 hw/intc/xive.c                                |  18 +-
 hw/intc/xlnx-pmu-iomod-intc.c                 |   6 +-
 hw/intc/xlnx-zynqmp-ipi.c                     |   6 +-
 hw/ipack/ipack.c                              |   8 +-
 hw/ipack/tpci200.c                            |  16 +-
 hw/ipmi/ipmi.c                                |   8 +-
 hw/ipmi/ipmi_bmc_extern.c                     |  10 +-
 hw/ipmi/ipmi_bmc_sim.c                        |   6 +-
 hw/ipmi/isa_ipmi_bt.c                         |  16 +-
 hw/ipmi/isa_ipmi_kcs.c                        |  16 +-
 hw/ipmi/pci_ipmi_bt.c                         |  16 +-
 hw/ipmi/pci_ipmi_kcs.c                        |  16 +-
 hw/ipmi/smbus_ipmi.c                          |  15 +-
 hw/isa/i82378.c                               |  16 +-
 hw/isa/isa-bus.c                              |  12 +-
 hw/isa/isa-superio.c                          |   8 +-
 hw/isa/lpc_ich9.c                             |   6 +-
 hw/isa/pc87312.c                              |   6 +-
 hw/isa/piix3.c                                |  15 +-
 hw/isa/piix4.c                                |  16 +-
 hw/isa/smc37c669-superio.c                    |   6 +-
 hw/isa/vt82c686.c                             |  51 +-
 hw/lm32/lm32_boards.c                         |   8 +-
 hw/m68k/mcf_intc.c                            |  15 +-
 hw/m68k/next-cube.c                           |  15 +-
 hw/m68k/next-kbd.c                            |  15 +-
 hw/m68k/q800.c                                |   6 +-
 hw/mem/memory-device.c                        |   6 +-
 hw/mem/nvdimm.c                               |   6 +-
 hw/mem/pc-dimm.c                              |   6 +-
 hw/microblaze/xlnx-zynqmp-pmu.c               |  16 +-
 hw/mips/boston.c                              |  15 +-
 hw/mips/cps.c                                 |   6 +-
 hw/mips/gt64xxx_pci.c                         |  18 +-
 hw/mips/jazz.c                                |   8 +-
 hw/mips/malta.c                               |  15 +-
 hw/misc/a9scu.c                               |   6 +-
 hw/misc/allwinner-cpucfg.c                    |   6 +-
 hw/misc/allwinner-h3-ccu.c                    |   6 +-
 hw/misc/allwinner-h3-dramc.c                  |   6 +-
 hw/misc/allwinner-h3-sysctrl.c                |   6 +-
 hw/misc/allwinner-sid.c                       |   6 +-
 hw/misc/applesmc.c                            |  12 +-
 hw/misc/arm11scu.c                            |   6 +-
 hw/misc/arm_integrator_debug.c                |  16 +-
 hw/misc/arm_l2x0.c                            |  15 +-
 hw/misc/arm_sysctl.c                          |  16 +-
 hw/misc/armsse-cpuid.c                        |   6 +-
 hw/misc/armsse-mhu.c                          |   6 +-
 hw/misc/aspeed_scu.c                          |  12 +-
 hw/misc/aspeed_sdmc.c                         |  12 +-
 hw/misc/aspeed_xdma.c                         |   6 +-
 hw/misc/auxbus.c                              |  14 +-
 hw/misc/avr_power.c                           |   6 +-
 hw/misc/bcm2835_mbox.c                        |   6 +-
 hw/misc/bcm2835_mphi.c                        |   6 +-
 hw/misc/bcm2835_property.c                    |   6 +-
 hw/misc/bcm2835_rng.c                         |   6 +-
 hw/misc/bcm2835_thermal.c                     |   6 +-
 hw/misc/debugexit.c                           |  16 +-
 hw/misc/eccmemctl.c                           |  15 +-
 hw/misc/edu.c                                 |   9 +-
 hw/misc/empty_slot.c                          |  15 +-
 hw/misc/exynos4210_clk.c                      |  12 +-
 hw/misc/exynos4210_pmu.c                      |  16 +-
 hw/misc/exynos4210_rng.c                      |  16 +-
 hw/misc/grlib_ahb_apb_pnp.c                   |   8 +-
 hw/misc/imx25_ccm.c                           |   6 +-
 hw/misc/imx31_ccm.c                           |   6 +-
 hw/misc/imx6_ccm.c                            |   6 +-
 hw/misc/imx6_src.c                            |   6 +-
 hw/misc/imx6ul_ccm.c                          |   6 +-
 hw/misc/imx7_ccm.c                            |   8 +-
 hw/misc/imx7_gpr.c                            |   6 +-
 hw/misc/imx7_snvs.c                           |   6 +-
 hw/misc/imx_ccm.c                             |   6 +-
 hw/misc/imx_rngc.c                            |   6 +-
 hw/misc/iotkit-secctl.c                       |   6 +-
 hw/misc/iotkit-sysctl.c                       |   6 +-
 hw/misc/iotkit-sysinfo.c                      |   6 +-
 hw/misc/ivshmem.c                             |  32 +-
 hw/misc/mac_via.c                             |  10 +-
 hw/misc/macio/cuda.c                          |   8 +-
 hw/misc/macio/gpio.c                          |   6 +-
 hw/misc/macio/mac_dbdma.c                     |   6 +-
 hw/misc/macio/macio.c                         |  12 +-
 hw/misc/macio/pmu.c                           |   8 +-
 hw/misc/max111x.c                             |  10 +-
 hw/misc/milkymist-hpdmc.c                     |  13 +-
 hw/misc/milkymist-pfpu.c                      |  13 +-
 hw/misc/mips_cmgcr.c                          |   6 +-
 hw/misc/mips_cpc.c                            |   6 +-
 hw/misc/mips_itu.c                            |   6 +-
 hw/misc/mos6522.c                             |   6 +-
 hw/misc/mps2-fpgaio.c                         |   6 +-
 hw/misc/mps2-scc.c                            |   6 +-
 hw/misc/msf2-sysreg.c                         |   6 +-
 hw/misc/mst_fpga.c                            |  16 +-
 hw/misc/nrf51_rng.c                           |   6 +-
 hw/misc/pc-testdev.c                          |  16 +-
 hw/misc/pca9552.c                             |  20 +-
 hw/misc/pci-testdev.c                         |  16 +-
 hw/misc/puv3_pm.c                             |  15 +-
 hw/misc/pvpanic.c                             |  16 +-
 hw/misc/sga.c                                 |  15 +-
 hw/misc/slavio_misc.c                         |  25 +-
 hw/misc/stm32f2xx_syscfg.c                    |   6 +-
 hw/misc/stm32f4xx_exti.c                      |   6 +-
 hw/misc/stm32f4xx_syscfg.c                    |   6 +-
 hw/misc/tmp105.c                              |   6 +-
 hw/misc/tmp421.c                              |  20 +-
 hw/misc/tz-mpc.c                              |   8 +-
 hw/misc/tz-msc.c                              |   6 +-
 hw/misc/tz-ppc.c                              |   6 +-
 hw/misc/unimp.c                               |   6 +-
 hw/misc/vmcoreinfo.c                          |   6 +-
 hw/misc/zynq-xadc.c                           |   6 +-
 hw/misc/zynq_slcr.c                           |  15 +-
 hw/net/allwinner-sun8i-emac.c                 |   6 +-
 hw/net/allwinner_emac.c                       |   6 +-
 hw/net/cadence_gem.c                          |   6 +-
 hw/net/can/can_kvaser_pci.c                   |  16 +-
 hw/net/can/can_mioe3680_pci.c                 |  16 +-
 hw/net/can/can_pcm3680_pci.c                  |  16 +-
 hw/net/dp8393x.c                              |  15 +-
 hw/net/e1000.c                                |  25 +-
 hw/net/e1000e.c                               |  15 +-
 hw/net/etraxfs_eth.c                          |  17 +-
 hw/net/fsl_etsec/etsec.c                      |   6 +-
 hw/net/ftgmac100.c                            |   8 +-
 hw/net/imx_fec.c                              |   8 +-
 hw/net/lan9118.c                              |  15 +-
 hw/net/lance.c                                |   6 +-
 hw/net/lasi_i82596.c                          |   6 +-
 hw/net/mcf_fec.c                              |  10 +-
 hw/net/milkymist-minimac2.c                   |  13 +-
 hw/net/mipsnet.c                              |  15 +-
 hw/net/msf2-emac.c                            |   6 +-
 hw/net/ne2000-isa.c                           |  15 +-
 hw/net/ne2000-pci.c                           |   6 +-
 hw/net/opencores_eth.c                        |  15 +-
 hw/net/pcnet-pci.c                            |  16 +-
 hw/net/rocker/rocker.c                        |  11 +-
 hw/net/rtl8139.c                              |  16 +-
 hw/net/smc91c111.c                            |  15 +-
 hw/net/spapr_llan.c                           |  12 +-
 hw/net/stellaris_enet.c                       |  16 +-
 hw/net/sungem.c                               |  15 +-
 hw/net/sunhme.c                               |  15 +-
 hw/net/tulip.c                                |  10 +-
 hw/net/virtio-net.c                           |   6 +-
 hw/net/vmxnet3.c                              |  14 +-
 hw/net/xgmac.c                                |  15 +-
 hw/net/xilinx_axienet.c                       |  29 +-
 hw/net/xilinx_ethlite.c                       |  11 +-
 hw/nubus/mac-nubus-bridge.c                   |   6 +-
 hw/nubus/nubus-bridge.c                       |   6 +-
 hw/nubus/nubus-bus.c                          |   6 +-
 hw/nubus/nubus-device.c                       |   6 +-
 hw/nvram/ds1225y.c                            |  15 +-
 hw/nvram/eeprom_at24c.c                       |  15 +-
 hw/nvram/fw_cfg.c                             |  12 +-
 hw/nvram/mac_nvram.c                          |   6 +-
 hw/nvram/nrf51_nvm.c                          |   6 +-
 hw/nvram/spapr_nvram.c                        |  16 +-
 hw/pci-bridge/dec.c                           |  19 +-
 hw/pci-bridge/gen_pcie_root_port.c            |  10 +-
 hw/pci-bridge/i82801b11.c                     |   6 +-
 hw/pci-bridge/ioh3420.c                       |   6 +-
 hw/pci-bridge/pci_bridge_dev.c                |  15 +-
 hw/pci-bridge/pci_expander_bridge.c           |  37 +-
 hw/pci-bridge/pcie_pci_bridge.c               |  16 +-
 hw/pci-bridge/pcie_root_port.c                |   6 +-
 hw/pci-bridge/simba.c                         |   6 +-
 hw/pci-bridge/xio3130_downstream.c            |   6 +-
 hw/pci-bridge/xio3130_upstream.c              |   6 +-
 hw/pci-host/bonito.c                          |  22 +-
 hw/pci-host/designware.c                      |   8 +-
 hw/pci-host/gpex.c                            |   8 +-
 hw/pci-host/grackle.c                         |  18 +-
 hw/pci-host/i440fx.c                          |  18 +-
 hw/pci-host/pnv_phb3.c                        |  17 +-
 hw/pci-host/pnv_phb3_msi.c                    |   6 +-
 hw/pci-host/pnv_phb3_pbcq.c                   |   6 +-
 hw/pci-host/pnv_phb4.c                        |  17 +-
 hw/pci-host/pnv_phb4_pec.c                    |   8 +-
 hw/pci-host/ppce500.c                         |  21 +-
 hw/pci-host/prep.c                            |  27 +-
 hw/pci-host/q35.c                             |   8 +-
 hw/pci-host/sabre.c                           |   8 +-
 hw/pci-host/uninorth.c                        |  18 +-
 hw/pci-host/versatile.c                       |  24 +-
 hw/pci-host/xen_igd_pt.c                      |   6 +-
 hw/pci-host/xilinx-pcie.c                     |   8 +-
 hw/pci/pci.c                                  |  14 +-
 hw/pci/pci_bridge.c                           |   6 +-
 hw/pci/pci_host.c                             |   6 +-
 hw/pci/pcie_host.c                            |   6 +-
 hw/pci/pcie_port.c                            |   8 +-
 hw/pcmcia/pcmcia.c                            |   6 +-
 hw/pcmcia/pxa2xx.c                            |  11 +-
 hw/ppc/e500.c                                 |   8 +-
 hw/ppc/e500plat.c                             |   6 +-
 hw/ppc/mac_newworld.c                         |   6 +-
 hw/ppc/mac_oldworld.c                         |   6 +-
 hw/ppc/mpc8544_guts.c                         |  12 +-
 hw/ppc/mpc8544ds.c                            |   6 +-
 hw/ppc/pnv_core.c                             |   6 +-
 hw/ppc/pnv_homer.c                            |  10 +-
 hw/ppc/pnv_lpc.c                              |  12 +-
 hw/ppc/pnv_occ.c                              |  10 +-
 hw/ppc/pnv_pnor.c                             |   6 +-
 hw/ppc/pnv_psi.c                              |  12 +-
 hw/ppc/pnv_xscom.c                            |   6 +-
 hw/ppc/ppc405_boards.c                        |   8 +-
 hw/ppc/ppc440_pcix.c                          |  16 +-
 hw/ppc/ppc440_uc.c                            |  16 +-
 hw/ppc/ppc4xx_pci.c                           |  15 +-
 hw/ppc/ppce500_spin.c                         |  15 +-
 hw/ppc/prep_systemio.c                        |  16 +-
 hw/ppc/rs6000_mc.c                            |  16 +-
 hw/ppc/spapr.c                                |   6 +-
 hw/ppc/spapr_drc.c                            |  16 +-
 hw/ppc/spapr_iommu.c                          |   8 +-
 hw/ppc/spapr_irq.c                            |   6 +-
 hw/ppc/spapr_pci.c                            |   6 +-
 hw/ppc/spapr_rng.c                            |  13 +-
 hw/ppc/spapr_rtc.c                            |   6 +-
 hw/ppc/spapr_tpm_proxy.c                      |   2 +-
 hw/ppc/spapr_vio.c                            |  10 +-
 hw/rdma/rdma.c                                |   6 +-
 hw/rdma/vmw/pvrdma_main.c                     |   6 +-
 hw/riscv/opentitan.c                          |  90 ++-
 hw/riscv/riscv_hart.c                         |   6 +-
 hw/riscv/sifive_clint.c                       |   6 +-
 hw/riscv/sifive_e.c                           |  94 ++-
 hw/riscv/sifive_e_prci.c                      |   6 +-
 hw/riscv/sifive_gpio.c                        |   6 +-
 hw/riscv/sifive_plic.c                        |   6 +-
 hw/riscv/sifive_test.c                        |   6 +-
 hw/riscv/sifive_u.c                           | 148 ++---
 hw/riscv/sifive_u_otp.c                       |   6 +-
 hw/riscv/sifive_u_prci.c                      |   6 +-
 hw/riscv/virt.c                               |   6 +-
 hw/rtc/allwinner-rtc.c                        |  12 +-
 hw/rtc/aspeed_rtc.c                           |   6 +-
 hw/rtc/ds1338.c                               |  15 +-
 hw/rtc/exynos4210_rtc.c                       |  16 +-
 hw/rtc/goldfish_rtc.c                         |   6 +-
 hw/rtc/m41t80.c                               |  15 +-
 hw/rtc/m48t59-isa.c                           |  23 +-
 hw/rtc/m48t59.c                               |  23 +-
 hw/rtc/mc146818rtc.c                          |   6 +-
 hw/rtc/pl031.c                                |   6 +-
 hw/rtc/sun4v-rtc.c                            |  15 +-
 hw/rtc/twl92230.c                             |  15 +-
 hw/rtc/xlnx-zynqmp-rtc.c                      |   6 +-
 hw/rx/rx-gdbsim.c                             |  19 +-
 hw/rx/rx62n.c                                 |  12 +-
 hw/s390x/3270-ccw.c                           |   6 +-
 hw/s390x/ap-bridge.c                          |   8 +-
 hw/s390x/ap-device.c                          |   6 +-
 hw/s390x/ccw-device.c                         |   6 +-
 hw/s390x/css-bridge.c                         |   8 +-
 hw/s390x/event-facility.c                     |  10 +-
 hw/s390x/ipl.c                                |   6 +-
 hw/s390x/s390-ccw.c                           |   6 +-
 hw/s390x/s390-pci-bus.c                       |  14 +-
 hw/s390x/s390-skeys-kvm.c                     |   6 +-
 hw/s390x/s390-skeys.c                         |   8 +-
 hw/s390x/s390-stattrib-kvm.c                  |   6 +-
 hw/s390x/s390-stattrib.c                      |   8 +-
 hw/s390x/s390-virtio-ccw.c                    |   6 +-
 hw/s390x/sclp.c                               |   6 +-
 hw/s390x/sclpcpu.c                            |   6 +-
 hw/s390x/sclpquiesce.c                        |   6 +-
 hw/s390x/tod-kvm.c                            |   6 +-
 hw/s390x/tod-qemu.c                           |   6 +-
 hw/s390x/tod.c                                |   6 +-
 hw/s390x/vhost-vsock-ccw.c                    |   6 +-
 hw/s390x/virtio-ccw-9p.c                      |   6 +-
 hw/s390x/virtio-ccw-balloon.c                 |   6 +-
 hw/s390x/virtio-ccw-blk.c                     |   6 +-
 hw/s390x/virtio-ccw-crypto.c                  |   6 +-
 hw/s390x/virtio-ccw-gpu.c                     |   6 +-
 hw/s390x/virtio-ccw-input.c                   |  14 +-
 hw/s390x/virtio-ccw-net.c                     |   6 +-
 hw/s390x/virtio-ccw-rng.c                     |   6 +-
 hw/s390x/virtio-ccw-scsi.c                    |   4 +-
 hw/s390x/virtio-ccw-serial.c                  |   6 +-
 hw/s390x/virtio-ccw.c                         |   8 +-
 hw/scsi/esp-pci.c                             |  27 +-
 hw/scsi/esp.c                                 |   6 +-
 hw/scsi/lsi53c895a.c                          |  18 +-
 hw/scsi/megasas.c                             |  29 +-
 hw/scsi/mptsas.c                              |   5 +-
 hw/scsi/scsi-bus.c                            |   8 +-
 hw/scsi/scsi-disk.c                           |  30 +-
 hw/scsi/scsi-generic.c                        |   6 +-
 hw/scsi/spapr_vscsi.c                         |  16 +-
 hw/scsi/vhost-scsi-common.c                   |   6 +-
 hw/scsi/vhost-scsi.c                          |   6 +-
 hw/scsi/vhost-user-scsi.c                     |   6 +-
 hw/scsi/virtio-scsi.c                         |   8 +-
 hw/scsi/vmw_pvscsi.c                          |  29 +-
 hw/sd/allwinner-sdhost.c                      |  17 +-
 hw/sd/aspeed_sdhci.c                          |   6 +-
 hw/sd/bcm2835_sdhost.c                        |  13 +-
 hw/sd/core.c                                  |   6 +-
 hw/sd/milkymist-memcard.c                     |  13 +-
 hw/sd/pl181.c                                 |  15 +-
 hw/sd/pxa2xx_mmci.c                           |  15 +-
 hw/sd/sd.c                                    |   6 +-
 hw/sd/sdhci-pci.c                             |   6 +-
 hw/sd/sdhci.c                                 |  16 +-
 hw/sd/ssi-sd.c                                |  15 +-
 hw/sh4/sh_pci.c                               |  18 +-
 hw/sparc/sun4m.c                              |  62 +-
 hw/sparc/sun4m_iommu.c                        |   8 +-
 hw/sparc64/niagara.c                          |   6 +-
 hw/sparc64/sun4u.c                            |  45 +-
 hw/sparc64/sun4u_iommu.c                      |   8 +-
 hw/ssi/aspeed_smc.c                           |   2 +-
 hw/ssi/imx_spi.c                              |   6 +-
 hw/ssi/mss-spi.c                              |   6 +-
 hw/ssi/pl022.c                                |   6 +-
 hw/ssi/ssi.c                                  |  12 +-
 hw/ssi/stm32f2xx_spi.c                        |   6 +-
 hw/ssi/xilinx_spi.c                           |  15 +-
 hw/ssi/xilinx_spips.c                         |  10 +-
 hw/timer/a9gtimer.c                           |   6 +-
 hw/timer/allwinner-a10-pit.c                  |   6 +-
 hw/timer/altera_timer.c                       |  16 +-
 hw/timer/arm_mptimer.c                        |   6 +-
 hw/timer/arm_timer.c                          |  26 +-
 hw/timer/armv7m_systick.c                     |   6 +-
 hw/timer/aspeed_timer.c                       |  12 +-
 hw/timer/avr_timer16.c                        |   6 +-
 hw/timer/bcm2835_systmr.c                     |   6 +-
 hw/timer/cadence_ttc.c                        |  16 +-
 hw/timer/cmsdk-apb-dualtimer.c                |   6 +-
 hw/timer/cmsdk-apb-timer.c                    |   6 +-
 hw/timer/digic-timer.c                        |   6 +-
 hw/timer/etraxfs_timer.c                      |  16 +-
 hw/timer/exynos4210_mct.c                     |  16 +-
 hw/timer/exynos4210_pwm.c                     |  16 +-
 hw/timer/grlib_gptimer.c                      |  13 +-
 hw/timer/hpet.c                               |  15 +-
 hw/timer/i8254.c                              |  16 +-
 hw/timer/i8254_common.c                       |   6 +-
 hw/timer/imx_epit.c                           |   6 +-
 hw/timer/imx_gpt.c                            |  12 +-
 hw/timer/lm32_timer.c                         |  12 +-
 hw/timer/milkymist-sysctl.c                   |  13 +-
 hw/timer/mss-timer.c                          |   6 +-
 hw/timer/nrf51_timer.c                        |   6 +-
 hw/timer/puv3_ost.c                           |  15 +-
 hw/timer/pxa2xx_timer.c                       |  17 +-
 hw/timer/renesas_cmt.c                        |   6 +-
 hw/timer/renesas_tmr.c                        |   6 +-
 hw/timer/slavio_timer.c                       |  16 +-
 hw/timer/stm32f2xx_timer.c                    |   6 +-
 hw/timer/xilinx_timer.c                       |  11 +-
 hw/tpm/tpm_crb.c                              |  15 +-
 hw/tpm/tpm_spapr.c                            |  16 +-
 hw/tpm/tpm_tis_isa.c                          |  15 +-
 hw/tpm/tpm_tis_sysbus.c                       |  15 +-
 hw/usb/bus.c                                  |   8 +-
 hw/usb/ccid-card-emulated.c                   |  13 +-
 hw/usb/ccid-card-passthru.c                   |  11 +-
 hw/usb/chipidea.c                             |   6 +-
 hw/usb/dev-audio.c                            |  11 +-
 hw/usb/dev-hid.c                              |  17 +-
 hw/usb/dev-hub.c                              |  15 +-
 hw/usb/dev-mtp.c                              |  10 +-
 hw/usb/dev-network.c                          |  15 +-
 hw/usb/dev-serial.c                           |  15 +-
 hw/usb/dev-smartcard-reader.c                 |  23 +-
 hw/usb/dev-storage.c                          |  19 +-
 hw/usb/dev-uas.c                              |  10 +-
 hw/usb/dev-wacom.c                            |  11 +-
 hw/usb/hcd-dwc2.c                             |  14 +-
 hw/usb/hcd-ehci-pci.c                         |   2 +-
 hw/usb/hcd-ehci-sysbus.c                      |  18 +-
 hw/usb/hcd-ohci-pci.c                         |  15 +-
 hw/usb/hcd-ohci.c                             |   6 +-
 hw/usb/hcd-uhci.c                             |   6 +-
 hw/usb/hcd-xhci-nec.c                         |   6 +-
 hw/usb/hcd-xhci.c                             |   8 +-
 hw/usb/host-libusb.c                          |  13 +-
 hw/usb/imx-usb-phy.c                          |   6 +-
 hw/usb/redirect.c                             |  10 +-
 hw/usb/tusb6010.c                             |  15 +-
 hw/vfio/amd-xgbe.c                            |   6 +-
 hw/vfio/ap.c                                  |  16 +-
 hw/vfio/calxeda-xgmac.c                       |   6 +-
 hw/vfio/ccw.c                                 |   6 +-
 hw/vfio/igd.c                                 |   6 +-
 hw/vfio/pci.c                                 |  12 +-
 hw/vfio/platform.c                            |   6 +-
 hw/virtio/vhost-scsi-pci.c                    |   5 +-
 hw/virtio/vhost-user-blk-pci.c                |   5 +-
 hw/virtio/vhost-user-fs-pci.c                 |   5 +-
 hw/virtio/vhost-user-fs.c                     |   6 +-
 hw/virtio/vhost-user-input-pci.c              |   5 +-
 hw/virtio/vhost-user-scsi-pci.c               |   5 +-
 hw/virtio/vhost-user-vsock-pci.c              |   5 +-
 hw/virtio/vhost-user-vsock.c                  |   6 +-
 hw/virtio/vhost-vsock-common.c                |   6 +-
 hw/virtio/vhost-vsock-pci.c                   |   5 +-
 hw/virtio/vhost-vsock.c                       |   6 +-
 hw/virtio/virtio-9p-pci.c                     |  10 +-
 hw/virtio/virtio-balloon-pci.c                |   5 +-
 hw/virtio/virtio-balloon.c                    |   6 +-
 hw/virtio/virtio-blk-pci.c                    |   5 +-
 hw/virtio/virtio-bus.c                        |   6 +-
 hw/virtio/virtio-crypto-pci.c                 |   5 +-
 hw/virtio/virtio-crypto.c                     |   6 +-
 hw/virtio/virtio-input-host-pci.c             |   5 +-
 hw/virtio/virtio-input-pci.c                  |  13 +-
 hw/virtio/virtio-iommu-pci.c                  |   5 +-
 hw/virtio/virtio-iommu.c                      |   8 +-
 hw/virtio/virtio-mem.c                        |   6 +-
 hw/virtio/virtio-mmio.c                       |   8 +-
 hw/virtio/virtio-net-pci.c                    |   5 +-
 hw/virtio/virtio-pci.c                        |   4 +-
 hw/virtio/virtio-pmem.c                       |   6 +-
 hw/virtio/virtio-rng-pci.c                    |   5 +-
 hw/virtio/virtio-rng.c                        |   6 +-
 hw/virtio/virtio-scsi-pci.c                   |   5 +-
 hw/virtio/virtio-serial-pci.c                 |   5 +-
 hw/virtio/virtio.c                            |   6 +-
 hw/watchdog/cmsdk-apb-watchdog.c              |   8 +-
 hw/watchdog/wdt_aspeed.c                      |   8 +-
 hw/watchdog/wdt_diag288.c                     |   2 +-
 hw/watchdog/wdt_i6300esb.c                    |   7 +-
 hw/watchdog/wdt_ib700.c                       |  11 +-
 hw/watchdog/wdt_imx2.c                        |   2 +-
 hw/xen/xen-bus.c                              |  10 +-
 hw/xen/xen-legacy-backend.c                   |  10 +-
 hw/xen/xen_pt.c                               |   6 +-
 hw/xtensa/xtfpga.c                            |  20 +-
 io/channel-buffer.c                           |   6 +-
 io/channel-command.c                          |   6 +-
 io/channel-file.c                             |   6 +-
 io/channel-socket.c                           |   6 +-
 io/channel-tls.c                              |   6 +-
 io/channel-websock.c                          |   6 +-
 io/channel.c                                  |   6 +-
 io/dns-resolver.c                             |   6 +-
 io/net-listener.c                             |   6 +-
 iothread.c                                    |  12 +-
 migration/migration.c                         |   6 +-
 migration/rdma.c                              |  13 +-
 net/can/can_core.c                            |   6 +-
 net/can/can_host.c                            |   6 +-
 net/can/can_socketcan.c                       |  16 +-
 net/colo-compare.c                            |  15 +-
 net/dump.c                                    |  13 +-
 net/filter-buffer.c                           |  15 +-
 net/filter-mirror.c                           |  25 +-
 net/filter-replay.c                           |  13 +-
 net/filter-rewriter.c                         |  17 +-
 net/filter.c                                  |   6 +-
 qom/container.c                               |   6 +-
 qom/object.c                                  |   6 +-
 scsi/pr-manager-helper.c                      |  17 +-
 scsi/pr-manager.c                             |   7 +-
 softmmu/memory.c                              |   8 +-
 target/arm/cpu.c                              |   4 +-
 target/arm/cpu64.c                            |   2 +-
 target/hppa/cpu.c                             |   6 +-
 target/i386/cpu.c                             |   8 +-
 target/i386/hax-all.c                         |   6 +-
 target/i386/hvf/hvf.c                         |   6 +-
 target/i386/sev.c                             |  14 +-
 target/i386/whpx-all.c                        |   6 +-
 target/microblaze/cpu.c                       |   6 +-
 target/mips/cpu.c                             |   2 +-
 target/nios2/cpu.c                            |   6 +-
 target/ppc/translate_init.inc.c               |   4 +-
 target/rx/cpu.c                               |   8 +-
 target/s390x/cpu.c                            |   6 +-
 target/s390x/cpu_models.c                     |   6 +-
 target/sparc/cpu.c                            |   2 +-
 target/tilegx/cpu.c                           |   6 +-
 target/xtensa/cpu.c                           |   6 +-
 tests/check-qom-interface.c                   |  11 +-
 tests/check-qom-proplist.c                    |  16 +-
 tests/test-qdev-global-props.c                |  13 +-
 ui/console.c                                  |  15 +-
 ui/gtk.c                                      |   8 +-
 ui/input-barrier.c                            |  20 +-
 ui/input-linux.c                              |  20 +-
 ui/spice-app.c                                |   9 +-
 1323 files changed, 9448 insertions(+), 9499 deletions(-)
 create mode 100644 scripts/codeconverter/codeconverter/__init__.py
 create mode 100644 scripts/codeconverter/codeconverter/patching.py
 create mode 100644 scripts/codeconverter/codeconverter/qom_macros.py
 create mode 100644 scripts/codeconverter/codeconverter/qom_type_info.py
 create mode 100644 scripts/codeconverter/codeconverter/regexps.py
 create mode 100644 scripts/codeconverter/codeconverter/test_patching.py
 create mode 100644 scripts/codeconverter/codeconverter/test_regexps.py
 create mode 100644 scripts/codeconverter/codeconverter/utils.py
 create mode 100755 scripts/codeconverter/converter.py

--=20
2.26.2

#1 lore raw

PATCH 1/41 pl1110: Rename PL1110 enum

The PL1110 enum value name will conflict with the PL1110 type cast checker, when we replace the existing macro with an inline function. Rename it to PL1110_STOCK.

---
 hw/display/pl110.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
hw/display/pl110.c +6 -6
index c2991a28d2..4664fde3f2 100644
@@ -42,7 +42,7 @@ enum pl110_bppmode
 /* The Versatile/PB uses a slightly modified PL110 controller.  */
 enum pl110_version
 {
-    PL110,
+    PL110_STOCK,
     PL110_VERSATILE,
     PL111
 };
@@ -372,12 +372,12 @@ static uint64_t pl110_read(void *opaque, hwaddr offset,
     case 5: /* LCDLPBASE */
         return s->lpbase;
     case 6: /* LCDIMSC */
-        if (s->version != PL110) {
+        if (s->version != PL110_STOCK) {
             return s->cr;
         }
         return s->int_mask;
     case 7: /* LCDControl */
-        if (s->version != PL110) {
+        if (s->version != PL110_STOCK) {
             return s->int_mask;
         }
         return s->cr;
@@ -437,7 +437,7 @@ static void pl110_write(void *opaque, hwaddr offset,
         s->lpbase = val;
         break;
     case 6: /* LCDIMSC */
-        if (s->version != PL110) {
+        if (s->version != PL110_STOCK) {
             goto control;
         }
     imsc:
@@ -445,7 +445,7 @@ static void pl110_write(void *opaque, hwaddr offset,
         pl110_update(s);
         break;
     case 7: /* LCDControl */
-        if (s->version != PL110) {
+        if (s->version != PL110_STOCK) {
             goto imsc;
         }
     control:
@@ -513,7 +513,7 @@ static void pl110_init(Object *obj)
 {
     PL110State *s = PL110(obj);
 
-    s->version = PL110;
+    s->version = PL110_STOCK;
 }
 
 static void pl110_versatile_init(Object *obj)
Signature · 1 line
2.26.2
#2 lore raw

Re: [PATCH 01/41] pl1110: Rename PL1110 enum

Quoted 3 lines · Eduardo Habkost

The PL1110 enum value name will conflict with the PL1110 type cast checker, when we replace the existing macro with an inline function. Rename it to PL1110_STOCK.

typo s/PL1110/PL110/ in subject and description.

Quoted 11 lines
---
 hw/display/pl110.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
hw/display/pl110.c +0 -0
index c2991a28d2..4664fde3f2 100644

hw/display/pl110.c enum pl110_bppmode · line 47

Quoted 7 lines
hw/display/pl110.c +1 -1
@@ -42,7 +42,7 @@ enum pl110_bppmode
 /* The Versatile/PB uses a slightly modified PL110 controller.  */
 enum pl110_version
 {
-    PL110,
+    PL110_STOCK,
     PL110_VERSATILE,
     PL111

For completeness I'd also rename PL111.

What about:

enum pl110_version

 {
    PL110_VERSION,
    PL110_VERSATILE_VERSION,
    PL111_VERSION

}

?

Quoted 44 lines
hw/display/pl110.c +5 -5
 };
@@ -372,12 +372,12 @@ static uint64_t pl110_read(void *opaque, hwaddr offset,
     case 5: /* LCDLPBASE */
         return s->lpbase;
     case 6: /* LCDIMSC */
-        if (s->version != PL110) {
+        if (s->version != PL110_STOCK) {
             return s->cr;
         }
         return s->int_mask;
     case 7: /* LCDControl */
-        if (s->version != PL110) {
+        if (s->version != PL110_STOCK) {
             return s->int_mask;
         }
         return s->cr;
@@ -437,7 +437,7 @@ static void pl110_write(void *opaque, hwaddr offset,
         s->lpbase = val;
         break;
     case 6: /* LCDIMSC */
-        if (s->version != PL110) {
+        if (s->version != PL110_STOCK) {
             goto control;
         }
     imsc:
@@ -445,7 +445,7 @@ static void pl110_write(void *opaque, hwaddr offset,
         pl110_update(s);
         break;
     case 7: /* LCDControl */
-        if (s->version != PL110) {
+        if (s->version != PL110_STOCK) {
             goto imsc;
         }
     control:
@@ -513,7 +513,7 @@ static void pl110_init(Object *obj)
 {
     PL110State *s = PL110(obj);
 
-    s->version = PL110;
+    s->version = PL110_STOCK;
 }
 
 static void pl110_versatile_init(Object *obj)
#3 lore raw

Re: [PATCH 01/41] pl1110: Rename PL1110 enum

CCing maintainer (pmaydell).

Quoted 6 lines · Philippe Mathieu-Daudé
Quoted 3 lines · Eduardo Habkost

The PL1110 enum value name will conflict with the PL1110 type cast checker, when we replace the existing macro with an inline function. Rename it to PL1110_STOCK.

typo s/PL1110/PL110/ in subject and description.

Thanks for spotting that! Will be fixed in v2.

Quoted 24 lines
Quoted 12 lines
---
 hw/display/pl110.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
hw/display/pl110.c +0 -0
index c2991a28d2..4664fde3f2 100644

hw/display/pl110.c enum pl110_bppmode · line 47

Quoted 7 lines
hw/display/pl110.c +1 -1
@@ -42,7 +42,7 @@ enum pl110_bppmode
 /* The Versatile/PB uses a slightly modified PL110 controller.  */
 enum pl110_version
 {
-    PL110,
+    PL110_STOCK,
     PL110_VERSATILE,
     PL111

For completeness I'd also rename PL111.

What about:

Quoted 8 lines

enum pl110_version

 {
    PL110_VERSION,
    PL110_VERSATILE_VERSION,
    PL111_VERSION

}

?

That would work too, although I'm more used to enum values to have a common prefix instead of a common suffix.

Any objections to:

  enum pl110_version
  {
      VERSION_PL110,
      VERSION_PL110_VERSATILE,
      VERSION_PL111
  }

?

Signature · 1 line
Eduardo
#4 lore raw

Re: [PATCH 01/41] pl1110: Rename PL1110 enum

Quoted 50 lines · Eduardo Habkost

CCing maintainer (pmaydell).

Quoted 6 lines · Philippe Mathieu-Daudé
Quoted 3 lines · Eduardo Habkost

The PL1110 enum value name will conflict with the PL1110 type cast checker, when we replace the existing macro with an inline function. Rename it to PL1110_STOCK.

typo s/PL1110/PL110/ in subject and description.

Thanks for spotting that! Will be fixed in v2.

Quoted 24 lines
Quoted 12 lines
---
 hw/display/pl110.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
hw/display/pl110.c +0 -0
index c2991a28d2..4664fde3f2 100644

hw/display/pl110.c enum pl110_bppmode · line 47

Quoted 7 lines
hw/display/pl110.c +1 -1
@@ -42,7 +42,7 @@ enum pl110_bppmode
 /* The Versatile/PB uses a slightly modified PL110 controller.  */
 enum pl110_version
 {
-    PL110,
+    PL110_STOCK,
     PL110_VERSATILE,
     PL111

For completeness I'd also rename PL111.

What about:

Quoted 8 lines

enum pl110_version

 {
    PL110_VERSION,
    PL110_VERSATILE_VERSION,
    PL111_VERSION

}

?

That would work too, although I'm more used to enum values to have a common prefix instead of a common suffix.

Any objections to:

Quoted 9 lines
  enum pl110_version
  {
      VERSION_PL110,
      VERSION_PL110_VERSATILE,
      VERSION_PL111
  }

?

Sounds good.

Quoted 4 lines

--
Eduardo

#5 lore raw

PATCH 2/41 e1000: Rename QOM class cast macros

In reply to Eduardo Habkost

Rename the E1000_DEVICE_CLASS() and E1000_DEVICE_GET_CLASS() macros to be consistent with the E1000() instance cast macro.

This will allow us to register the type cast macros using OBJECT_DECLARE_TYPE later.

---
 hw/net/e1000.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
hw/net/e1000.c +4 -4
index a18f80e369..c4d896a9e6 100644
@@ -151,9 +151,9 @@ typedef struct E1000BaseClass {
 #define E1000(obj) \
     OBJECT_CHECK(E1000State, (obj), TYPE_E1000_BASE)
 
-#define E1000_DEVICE_CLASS(klass) \
+#define E1000_CLASS(klass) \
      OBJECT_CLASS_CHECK(E1000BaseClass, (klass), TYPE_E1000_BASE)
-#define E1000_DEVICE_GET_CLASS(obj) \
+#define E1000_GET_CLASS(obj) \
     OBJECT_GET_CLASS(E1000BaseClass, (obj), TYPE_E1000_BASE)
 
 static void
@@ -365,7 +365,7 @@ e1000_autoneg_timer(void *opaque)
 static void e1000_reset(void *opaque)
 {
     E1000State *d = opaque;
-    E1000BaseClass *edc = E1000_DEVICE_GET_CLASS(d);
+    E1000BaseClass *edc = E1000_GET_CLASS(d);
     uint8_t *macaddr = d->conf.macaddr.a;
 
     timer_del(d->autoneg_timer);
@@ -1751,7 +1751,7 @@ static void e1000_class_init(ObjectClass *klass, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(klass);
     PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
-    E1000BaseClass *e = E1000_DEVICE_CLASS(klass);
+    E1000BaseClass *e = E1000_CLASS(klass);
     const E1000Info *info = data;
 
     k->realize = pci_e1000_realize;
Signature · 1 line
2.26.2
Reviewed-by on v1 2/41
#6 lore raw

Re: [PATCH 02/41] e1000: Rename QOM class cast macros

Quoted 10 lines · Eduardo Habkost

Rename the E1000_DEVICE_CLASS() and E1000_DEVICE_GET_CLASS() macros to be consistent with the E1000() instance cast macro.

This will allow us to register the type cast macros using OBJECT_DECLARE_TYPE later.

---
 hw/net/e1000.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#7 lore raw

PATCH 3/41 megasas: Rename QOM class cast macros

In reply to Eduardo Habkost

Rename the MEGASAS_DEVICE_CLASS() and MEGASAS_DEVICE_GET_CLASS() macros to be consistent with the MEGASAS() instance cast macro.

This will allow us to register the type cast macros using OBJECT_DECLARE_TYPE later.

---
 hw/scsi/megasas.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
hw/scsi/megasas.c +6 -6
index 5cfd1bf22e..390c2f2edb 100644
@@ -134,9 +134,9 @@ typedef struct MegasasBaseClass {
 #define MEGASAS(obj) \
     OBJECT_CHECK(MegasasState, (obj), TYPE_MEGASAS_BASE)
 
-#define MEGASAS_DEVICE_CLASS(oc) \
+#define MEGASAS_CLASS(oc) \
     OBJECT_CLASS_CHECK(MegasasBaseClass, (oc), TYPE_MEGASAS_BASE)
-#define MEGASAS_DEVICE_GET_CLASS(oc) \
+#define MEGASAS_GET_CLASS(oc) \
     OBJECT_GET_CLASS(MegasasBaseClass, (oc), TYPE_MEGASAS_BASE)
 
 #define MEGASAS_INTR_DISABLED_MASK 0xFFFFFFFF
@@ -733,7 +733,7 @@ static int megasas_ctrl_get_info(MegasasState *s, MegasasCmd *cmd)
 {
     PCIDevice *pci_dev = PCI_DEVICE(s);
     PCIDeviceClass *pci_class = PCI_DEVICE_GET_CLASS(pci_dev);
-    MegasasBaseClass *base_class = MEGASAS_DEVICE_GET_CLASS(s);
+    MegasasBaseClass *base_class = MEGASAS_GET_CLASS(s);
     struct mfi_ctrl_info info;
     size_t dcmd_size = sizeof(info);
     BusChild *kid;
@@ -1999,7 +1999,7 @@ static uint64_t megasas_mmio_read(void *opaque, hwaddr addr,
 {
     MegasasState *s = opaque;
     PCIDevice *pci_dev = PCI_DEVICE(s);
-    MegasasBaseClass *base_class = MEGASAS_DEVICE_GET_CLASS(s);
+    MegasasBaseClass *base_class = MEGASAS_GET_CLASS(s);
     uint32_t retval = 0;
 
     switch (addr) {
@@ -2322,7 +2322,7 @@ static const struct SCSIBusInfo megasas_scsi_info = {
 static void megasas_scsi_realize(PCIDevice *dev, Error **errp)
 {
     MegasasState *s = MEGASAS(dev);
-    MegasasBaseClass *b = MEGASAS_DEVICE_GET_CLASS(s);
+    MegasasBaseClass *b = MEGASAS_GET_CLASS(s);
     uint8_t *pci_conf;
     int i, bar_type;
     Error *err = NULL;
@@ -2506,7 +2506,7 @@ static void megasas_class_init(ObjectClass *oc, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(oc);
     PCIDeviceClass *pc = PCI_DEVICE_CLASS(oc);
-    MegasasBaseClass *e = MEGASAS_DEVICE_CLASS(oc);
+    MegasasBaseClass *e = MEGASAS_CLASS(oc);
     const MegasasInfo *info = data;
 
     pc->realize = megasas_scsi_realize;
Signature · 1 line
2.26.2
Reviewed-by on v1 3/41
#8 lore raw

Re: [PATCH 03/41] megasas: Rename QOM class cast macros

Quoted 10 lines · Eduardo Habkost

Rename the MEGASAS_DEVICE_CLASS() and MEGASAS_DEVICE_GET_CLASS() macros to be consistent with the MEGASAS() instance cast macro.

This will allow us to register the type cast macros using OBJECT_DECLARE_TYPE later.

---
 hw/scsi/megasas.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#9 lore raw

PATCH 4/41 vmw_pvscsi: Rename QOM class cast macros

In reply to Eduardo Habkost

Rename the PVSCSI_DEVICE_CLASS() and PVSCSI_DEVICE_GET_CLASS() macros to be consistent with the PVSCSI() instance cast macro.

This will allow us to register the type cast macros using OBJECT_DECLARE_TYPE later.

---
 hw/scsi/vmw_pvscsi.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
hw/scsi/vmw_pvscsi.c +4 -4
index df07ab6bfb..c071e0c7aa 100644
@@ -64,9 +64,9 @@ typedef struct PVSCSIClass {
 #define TYPE_PVSCSI "pvscsi"
 #define PVSCSI(obj) OBJECT_CHECK(PVSCSIState, (obj), TYPE_PVSCSI)
 
-#define PVSCSI_DEVICE_CLASS(klass) \
+#define PVSCSI_CLASS(klass) \
     OBJECT_CLASS_CHECK(PVSCSIClass, (klass), TYPE_PVSCSI)
-#define PVSCSI_DEVICE_GET_CLASS(obj) \
+#define PVSCSI_GET_CLASS(obj) \
     OBJECT_GET_CLASS(PVSCSIClass, (obj), TYPE_PVSCSI)
 
 /* Compatibility flags for migration */
@@ -1265,7 +1265,7 @@ static Property pvscsi_properties[] = {
 
 static void pvscsi_realize(DeviceState *qdev, Error **errp)
 {
-    PVSCSIClass *pvs_c = PVSCSI_DEVICE_GET_CLASS(qdev);
+    PVSCSIClass *pvs_c = PVSCSI_GET_CLASS(qdev);
     PCIDevice *pci_dev = PCI_DEVICE(qdev);
     PVSCSIState *s = PVSCSI(qdev);
 
@@ -1280,7 +1280,7 @@ static void pvscsi_class_init(ObjectClass *klass, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(klass);
     PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
-    PVSCSIClass *pvs_k = PVSCSI_DEVICE_CLASS(klass);
+    PVSCSIClass *pvs_k = PVSCSI_CLASS(klass);
     HotplugHandlerClass *hc = HOTPLUG_HANDLER_CLASS(klass);
 
     k->realize = pvscsi_realizefn;
Signature · 1 line
2.26.2
Reviewed-by on v1 4/41
#10 lore raw

Re: [PATCH 04/41] vmw_pvscsi: Rename QOM class cast macros

Quoted 10 lines · Eduardo Habkost

Rename the PVSCSI_DEVICE_CLASS() and PVSCSI_DEVICE_GET_CLASS() macros to be consistent with the PVSCSI() instance cast macro.

This will allow us to register the type cast macros using OBJECT_DECLARE_TYPE later.

---
 hw/scsi/vmw_pvscsi.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#11 lore raw

PATCH 5/41 aspeed_timer: Fix ASPEED_TIMER macro definition

In reply to Eduardo Habkost

The macro definition had an extra semicolon. This was never noticed because the macro was only being used where it didn't make a difference.

---
 include/hw/timer/aspeed_timer.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/hw/timer/aspeed_timer.h +1 -1
index 948329893c..d7c7d8ad28 100644
@@ -26,7 +26,7 @@
 #include "hw/misc/aspeed_scu.h"
 
 #define ASPEED_TIMER(obj) \
-    OBJECT_CHECK(AspeedTimerCtrlState, (obj), TYPE_ASPEED_TIMER);
+    OBJECT_CHECK(AspeedTimerCtrlState, (obj), TYPE_ASPEED_TIMER)
 #define TYPE_ASPEED_TIMER "aspeed.timer"
 #define TYPE_ASPEED_2400_TIMER TYPE_ASPEED_TIMER "-ast2400"
 #define TYPE_ASPEED_2500_TIMER TYPE_ASPEED_TIMER "-ast2500"
Signature · 1 line
2.26.2
Reviewed-by on v1 5/41
#12 lore raw

Re: [PATCH 05/41] aspeed_timer: Fix ASPEED_TIMER macro definition

Quoted 15 lines · Eduardo Habkost

The macro definition had an extra semicolon. This was never noticed because the macro was only being used where it didn't make a difference.

---
 include/hw/timer/aspeed_timer.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/hw/timer/aspeed_timer.h +0 -0
index 948329893c..d7c7d8ad28 100644

include/hw/timer/aspeed_timer.h line 32

Quoted 8 lines
include/hw/timer/aspeed_timer.h +1 -1
@@ -26,7 +26,7 @@
 #include "hw/misc/aspeed_scu.h"
 
 #define ASPEED_TIMER(obj) \
-    OBJECT_CHECK(AspeedTimerCtrlState, (obj), TYPE_ASPEED_TIMER);
+    OBJECT_CHECK(AspeedTimerCtrlState, (obj), TYPE_ASPEED_TIMER)
 #define TYPE_ASPEED_TIMER "aspeed.timer"
 #define TYPE_ASPEED_2400_TIMER TYPE_ASPEED_TIMER "-ast2400"
 #define TYPE_ASPEED_2500_TIMER TYPE_ASPEED_TIMER "-ast2500"
Reviewed-by on v1 5/41
#13 lore raw

Re: [PATCH 05/41] aspeed_timer: Fix ASPEED_TIMER macro definition

In reply to Eduardo Habkost
Quoted 8 lines · Eduardo Habkost

The macro definition had an extra semicolon. This was never noticed because the macro was only being used where it didn't make a difference.

---
 include/hw/timer/aspeed_timer.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#14 lore raw

PATCH 6/41 allwinner-h3: Rename memmap enum constants

In reply to Eduardo Habkost

Some of the enum constant names conflict with the QOM type check macros. This needs to be addressed to allow us to transform the QOM type check macros into functions generated by OBJECT_DECLARE_TYPE().

Rename all the constants to AW_H3_DEV_*, to avoid conflicts.

---
 include/hw/arm/allwinner-h3.h |  62 ++++++++---------
 hw/arm/allwinner-h3.c         | 124 +++++++++++++++++-----------------
 hw/arm/orangepi.c             |   6 +-
 3 files changed, 96 insertions(+), 96 deletions(-)
include/hw/arm/allwinner-h3.h +31 -31
index 82e4e59216..626139dcb3 100644
@@ -61,37 +61,37 @@
  * @see AwH3State
  */
 enum {
-    AW_H3_SRAM_A1,
-    AW_H3_SRAM_A2,
-    AW_H3_SRAM_C,
-    AW_H3_SYSCTRL,
-    AW_H3_MMC0,
-    AW_H3_SID,
-    AW_H3_EHCI0,
-    AW_H3_OHCI0,
-    AW_H3_EHCI1,
-    AW_H3_OHCI1,
-    AW_H3_EHCI2,
-    AW_H3_OHCI2,
-    AW_H3_EHCI3,
-    AW_H3_OHCI3,
-    AW_H3_CCU,
-    AW_H3_PIT,
-    AW_H3_UART0,
-    AW_H3_UART1,
-    AW_H3_UART2,
-    AW_H3_UART3,
-    AW_H3_EMAC,
-    AW_H3_DRAMCOM,
-    AW_H3_DRAMCTL,
-    AW_H3_DRAMPHY,
-    AW_H3_GIC_DIST,
-    AW_H3_GIC_CPU,
-    AW_H3_GIC_HYP,
-    AW_H3_GIC_VCPU,
-    AW_H3_RTC,
-    AW_H3_CPUCFG,
-    AW_H3_SDRAM
+    AW_H3_DEV_SRAM_A1,
+    AW_H3_DEV_SRAM_A2,
+    AW_H3_DEV_SRAM_C,
+    AW_H3_DEV_SYSCTRL,
+    AW_H3_DEV_MMC0,
+    AW_H3_DEV_SID,
+    AW_H3_DEV_EHCI0,
+    AW_H3_DEV_OHCI0,
+    AW_H3_DEV_EHCI1,
+    AW_H3_DEV_OHCI1,
+    AW_H3_DEV_EHCI2,
+    AW_H3_DEV_OHCI2,
+    AW_H3_DEV_EHCI3,
+    AW_H3_DEV_OHCI3,
+    AW_H3_DEV_CCU,
+    AW_H3_DEV_PIT,
+    AW_H3_DEV_UART0,
+    AW_H3_DEV_UART1,
+    AW_H3_DEV_UART2,
+    AW_H3_DEV_UART3,
+    AW_H3_DEV_EMAC,
+    AW_H3_DEV_DRAMCOM,
+    AW_H3_DEV_DRAMCTL,
+    AW_H3_DEV_DRAMPHY,
+    AW_H3_DEV_GIC_DIST,
+    AW_H3_DEV_GIC_CPU,
+    AW_H3_DEV_GIC_HYP,
+    AW_H3_DEV_GIC_VCPU,
+    AW_H3_DEV_RTC,
+    AW_H3_DEV_CPUCFG,
+    AW_H3_DEV_SDRAM
 };
 
 /** Total number of CPU cores in the H3 SoC */
hw/arm/allwinner-h3.c +62 -62

218 lines not on this page · raw message

hw/arm/orangepi.c +3 -3
index 1679468232..17a568a2b4 100644
@@ -79,7 +79,7 @@ static void orangepi_init(MachineState *machine)
     object_property_set_int(OBJECT(&h3->emac), "phy-addr", 1, &error_abort);
 
     /* DRAMC */
-    object_property_set_uint(OBJECT(h3), "ram-addr", h3->memmap[AW_H3_SDRAM],
+    object_property_set_uint(OBJECT(h3), "ram-addr", h3->memmap[AW_H3_DEV_SDRAM],
                              &error_abort);
     object_property_set_int(OBJECT(h3), "ram-size", machine->ram_size / MiB,
                             &error_abort);
@@ -98,7 +98,7 @@ static void orangepi_init(MachineState *machine)
     qdev_realize_and_unref(carddev, bus, &error_fatal);
 
     /* SDRAM */
-    memory_region_add_subregion(get_system_memory(), h3->memmap[AW_H3_SDRAM],
+    memory_region_add_subregion(get_system_memory(), h3->memmap[AW_H3_DEV_SDRAM],
                                 machine->ram);
 
     /* Load target kernel or start using BootROM */
@@ -106,7 +106,7 @@ static void orangepi_init(MachineState *machine)
         /* Use Boot ROM to copy data from SD card to SRAM */
         allwinner_h3_bootrom_setup(h3, blk);
     }
-    orangepi_binfo.loader_start = h3->memmap[AW_H3_SDRAM];
+    orangepi_binfo.loader_start = h3->memmap[AW_H3_DEV_SDRAM];
     orangepi_binfo.ram_size = machine->ram_size;
     arm_load_kernel(ARM_CPU(first_cpu), machine, &orangepi_binfo);
 }
Signature · 1 line
2.26.2
#15 lore raw

Re: [PATCH 06/41] allwinner-h3: Rename memmap enum constants

+Niek as maintainer.

Quoted 47 lines · Eduardo Habkost

Some of the enum constant names conflict with the QOM type check macros. This needs to be addressed to allow us to transform the QOM type check macros into functions generated by OBJECT_DECLARE_TYPE().

Rename all the constants to AW_H3_DEV_*, to avoid conflicts.

---
 include/hw/arm/allwinner-h3.h |  62 ++++++++---------
 hw/arm/allwinner-h3.c         | 124 +++++++++++++++++-----------------
 hw/arm/orangepi.c             |   6 +-
 3 files changed, 96 insertions(+), 96 deletions(-)
include/hw/arm/allwinner-h3.h +0 -25
index 82e4e59216..626139dcb3 100644
@@ -61,37 +61,37 @@
  * @see AwH3State
  */
 enum {
-    AW_H3_SRAM_A1,
-    AW_H3_SRAM_A2,
-    AW_H3_SRAM_C,
-    AW_H3_SYSCTRL,
-    AW_H3_MMC0,
-    AW_H3_SID,
-    AW_H3_EHCI0,
-    AW_H3_OHCI0,
-    AW_H3_EHCI1,
-    AW_H3_OHCI1,
-    AW_H3_EHCI2,
-    AW_H3_OHCI2,
-    AW_H3_EHCI3,
-    AW_H3_OHCI3,
-    AW_H3_CCU,
-    AW_H3_PIT,
-    AW_H3_UART0,
-    AW_H3_UART1,
-    AW_H3_UART2,
-    AW_H3_UART3,
-    AW_H3_EMAC,
-    AW_H3_DRAMCOM,
-    AW_H3_DRAMCTL,
-    AW_H3_DRAMPHY,
-    AW_H3_GIC_DIST,

include/hw/arm/allwinner-h3.h line 67

Quoted 10 lines
include/hw/arm/allwinner-h3.h +4 -6
-    AW_H3_GIC_CPU,
-    AW_H3_GIC_HYP,
-    AW_H3_GIC_VCPU,
-    AW_H3_RTC,
-    AW_H3_CPUCFG,
-    AW_H3_SDRAM
+    AW_H3_DEV_SRAM_A1,
+    AW_H3_DEV_SRAM_A2,
+    AW_H3_DEV_SRAM_C,
+    AW_H3_DEV_SYSCTRL,

My 2 cents:
These are not devices, but peripheral blocks or IP cores. Anyway, short change could be to name them E_AW_H3_xxx, but I don't understand why these are exposed. This enum should be locally declared in hw/arm/allwinner-h3.c, and the SoC might provide a get_sdram_base_address() method so the machine can access it.

Quoted 290 lines
include/hw/arm/allwinner-h3.h +27 -0
+    AW_H3_DEV_MMC0,
+    AW_H3_DEV_SID,
+    AW_H3_DEV_EHCI0,
+    AW_H3_DEV_OHCI0,
+    AW_H3_DEV_EHCI1,
+    AW_H3_DEV_OHCI1,
+    AW_H3_DEV_EHCI2,
+    AW_H3_DEV_OHCI2,
+    AW_H3_DEV_EHCI3,
+    AW_H3_DEV_OHCI3,
+    AW_H3_DEV_CCU,
+    AW_H3_DEV_PIT,
+    AW_H3_DEV_UART0,
+    AW_H3_DEV_UART1,
+    AW_H3_DEV_UART2,
+    AW_H3_DEV_UART3,
+    AW_H3_DEV_EMAC,
+    AW_H3_DEV_DRAMCOM,
+    AW_H3_DEV_DRAMCTL,
+    AW_H3_DEV_DRAMPHY,
+    AW_H3_DEV_GIC_DIST,
+    AW_H3_DEV_GIC_CPU,
+    AW_H3_DEV_GIC_HYP,
+    AW_H3_DEV_GIC_VCPU,
+    AW_H3_DEV_RTC,
+    AW_H3_DEV_CPUCFG,
+    AW_H3_DEV_SDRAM
 };
 
 /** Total number of CPU cores in the H3 SoC */
hw/arm/allwinner-h3.c +62 -62
index ff92ded82c..341abe6718 100644
@@ -35,37 +35,37 @@
 
 /* Memory map */
 const hwaddr allwinner_h3_memmap[] = {
-    [AW_H3_SRAM_A1]    = 0x00000000,
-    [AW_H3_SRAM_A2]    = 0x00044000,
-    [AW_H3_SRAM_C]     = 0x00010000,
-    [AW_H3_SYSCTRL]    = 0x01c00000,
-    [AW_H3_MMC0]       = 0x01c0f000,
-    [AW_H3_SID]        = 0x01c14000,
-    [AW_H3_EHCI0]      = 0x01c1a000,
-    [AW_H3_OHCI0]      = 0x01c1a400,
-    [AW_H3_EHCI1]      = 0x01c1b000,
-    [AW_H3_OHCI1]      = 0x01c1b400,
-    [AW_H3_EHCI2]      = 0x01c1c000,
-    [AW_H3_OHCI2]      = 0x01c1c400,
-    [AW_H3_EHCI3]      = 0x01c1d000,
-    [AW_H3_OHCI3]      = 0x01c1d400,
-    [AW_H3_CCU]        = 0x01c20000,
-    [AW_H3_PIT]        = 0x01c20c00,
-    [AW_H3_UART0]      = 0x01c28000,
-    [AW_H3_UART1]      = 0x01c28400,
-    [AW_H3_UART2]      = 0x01c28800,
-    [AW_H3_UART3]      = 0x01c28c00,
-    [AW_H3_EMAC]       = 0x01c30000,
-    [AW_H3_DRAMCOM]    = 0x01c62000,
-    [AW_H3_DRAMCTL]    = 0x01c63000,
-    [AW_H3_DRAMPHY]    = 0x01c65000,
-    [AW_H3_GIC_DIST]   = 0x01c81000,
-    [AW_H3_GIC_CPU]    = 0x01c82000,
-    [AW_H3_GIC_HYP]    = 0x01c84000,
-    [AW_H3_GIC_VCPU]   = 0x01c86000,
-    [AW_H3_RTC]        = 0x01f00000,
-    [AW_H3_CPUCFG]     = 0x01f01c00,
-    [AW_H3_SDRAM]      = 0x40000000
+    [AW_H3_DEV_SRAM_A1]    = 0x00000000,
+    [AW_H3_DEV_SRAM_A2]    = 0x00044000,
+    [AW_H3_DEV_SRAM_C]     = 0x00010000,
+    [AW_H3_DEV_SYSCTRL]    = 0x01c00000,
+    [AW_H3_DEV_MMC0]       = 0x01c0f000,
+    [AW_H3_DEV_SID]        = 0x01c14000,
+    [AW_H3_DEV_EHCI0]      = 0x01c1a000,
+    [AW_H3_DEV_OHCI0]      = 0x01c1a400,
+    [AW_H3_DEV_EHCI1]      = 0x01c1b000,
+    [AW_H3_DEV_OHCI1]      = 0x01c1b400,
+    [AW_H3_DEV_EHCI2]      = 0x01c1c000,
+    [AW_H3_DEV_OHCI2]      = 0x01c1c400,
+    [AW_H3_DEV_EHCI3]      = 0x01c1d000,
+    [AW_H3_DEV_OHCI3]      = 0x01c1d400,
+    [AW_H3_DEV_CCU]        = 0x01c20000,
+    [AW_H3_DEV_PIT]        = 0x01c20c00,
+    [AW_H3_DEV_UART0]      = 0x01c28000,
+    [AW_H3_DEV_UART1]      = 0x01c28400,
+    [AW_H3_DEV_UART2]      = 0x01c28800,
+    [AW_H3_DEV_UART3]      = 0x01c28c00,
+    [AW_H3_DEV_EMAC]       = 0x01c30000,
+    [AW_H3_DEV_DRAMCOM]    = 0x01c62000,
+    [AW_H3_DEV_DRAMCTL]    = 0x01c63000,
+    [AW_H3_DEV_DRAMPHY]    = 0x01c65000,
+    [AW_H3_DEV_GIC_DIST]   = 0x01c81000,
+    [AW_H3_DEV_GIC_CPU]    = 0x01c82000,
+    [AW_H3_DEV_GIC_HYP]    = 0x01c84000,
+    [AW_H3_DEV_GIC_VCPU]   = 0x01c86000,
+    [AW_H3_DEV_RTC]        = 0x01f00000,
+    [AW_H3_DEV_CPUCFG]     = 0x01f01c00,
+    [AW_H3_DEV_SDRAM]      = 0x40000000
 };
 
 /* List of unimplemented devices */
@@ -183,7 +183,7 @@ void allwinner_h3_bootrom_setup(AwH3State *s, BlockBackend *blk)
     }
 
     rom_add_blob("allwinner-h3.bootrom", buffer, rom_size,
-                  rom_size, s->memmap[AW_H3_SRAM_A1],
+                  rom_size, s->memmap[AW_H3_DEV_SRAM_A1],
                   NULL, NULL, NULL, NULL, false);
 }
 
@@ -262,10 +262,10 @@ static void allwinner_h3_realize(DeviceState *dev, Error **errp)
     qdev_prop_set_bit(DEVICE(&s->gic), "has-virtualization-extensions", true);
     sysbus_realize(SYS_BUS_DEVICE(&s->gic), &error_fatal);
 
-    sysbus_mmio_map(SYS_BUS_DEVICE(&s->gic), 0, s->memmap[AW_H3_GIC_DIST]);
-    sysbus_mmio_map(SYS_BUS_DEVICE(&s->gic), 1, s->memmap[AW_H3_GIC_CPU]);
-    sysbus_mmio_map(SYS_BUS_DEVICE(&s->gic), 2, s->memmap[AW_H3_GIC_HYP]);
-    sysbus_mmio_map(SYS_BUS_DEVICE(&s->gic), 3, s->memmap[AW_H3_GIC_VCPU]);
+    sysbus_mmio_map(SYS_BUS_DEVICE(&s->gic), 0, s->memmap[AW_H3_DEV_GIC_DIST]);
+    sysbus_mmio_map(SYS_BUS_DEVICE(&s->gic), 1, s->memmap[AW_H3_DEV_GIC_CPU]);
+    sysbus_mmio_map(SYS_BUS_DEVICE(&s->gic), 2, s->memmap[AW_H3_DEV_GIC_HYP]);
+    sysbus_mmio_map(SYS_BUS_DEVICE(&s->gic), 3, s->memmap[AW_H3_DEV_GIC_VCPU]);
 
     /*
      * Wire the outputs from each CPU's generic timer and the GICv3
@@ -312,7 +312,7 @@ static void allwinner_h3_realize(DeviceState *dev, Error **errp)
 
     /* Timer */
     sysbus_realize(SYS_BUS_DEVICE(&s->timer), &error_fatal);
-    sysbus_mmio_map(SYS_BUS_DEVICE(&s->timer), 0, s->memmap[AW_H3_PIT]);
+    sysbus_mmio_map(SYS_BUS_DEVICE(&s->timer), 0, s->memmap[AW_H3_DEV_PIT]);
     sysbus_connect_irq(SYS_BUS_DEVICE(&s->timer), 0,
                        qdev_get_gpio_in(DEVICE(&s->gic), AW_H3_GIC_SPI_TIMER0));
     sysbus_connect_irq(SYS_BUS_DEVICE(&s->timer), 1,
@@ -325,32 +325,32 @@ static void allwinner_h3_realize(DeviceState *dev, Error **errp)
                             32 * KiB, &error_abort);
     memory_region_init_ram(&s->sram_c, OBJECT(dev), "sram C",
                             44 * KiB, &error_abort);
-    memory_region_add_subregion(get_system_memory(), s->memmap[AW_H3_SRAM_A1],
+    memory_region_add_subregion(get_system_memory(), s->memmap[AW_H3_DEV_SRAM_A1],
                                 &s->sram_a1);
-    memory_region_add_subregion(get_system_memory(), s->memmap[AW_H3_SRAM_A2],
+    memory_region_add_subregion(get_system_memory(), s->memmap[AW_H3_DEV_SRAM_A2],
                                 &s->sram_a2);
-    memory_region_add_subregion(get_system_memory(), s->memmap[AW_H3_SRAM_C],
+    memory_region_add_subregion(get_system_memory(), s->memmap[AW_H3_DEV_SRAM_C],
                                 &s->sram_c);
 
     /* Clock Control Unit */
     sysbus_realize(SYS_BUS_DEVICE(&s->ccu), &error_fatal);
-    sysbus_mmio_map(SYS_BUS_DEVICE(&s->ccu), 0, s->memmap[AW_H3_CCU]);
+    sysbus_mmio_map(SYS_BUS_DEVICE(&s->ccu), 0, s->memmap[AW_H3_DEV_CCU]);
 
     /* System Control */
     sysbus_realize(SYS_BUS_DEVICE(&s->sysctrl), &error_fatal);
-    sysbus_mmio_map(SYS_BUS_DEVICE(&s->sysctrl), 0, s->memmap[AW_H3_SYSCTRL]);
+    sysbus_mmio_map(SYS_BUS_DEVICE(&s->sysctrl), 0, s->memmap[AW_H3_DEV_SYSCTRL]);
 
     /* CPU Configuration */
     sysbus_realize(SYS_BUS_DEVICE(&s->cpucfg), &error_fatal);
-    sysbus_mmio_map(SYS_BUS_DEVICE(&s->cpucfg), 0, s->memmap[AW_H3_CPUCFG]);
+    sysbus_mmio_map(SYS_BUS_DEVICE(&s->cpucfg), 0, s->memmap[AW_H3_DEV_CPUCFG]);
 
     /* Security Identifier */
     sysbus_realize(SYS_BUS_DEVICE(&s->sid), &error_fatal);
-    sysbus_mmio_map(SYS_BUS_DEVICE(&s->sid), 0, s->memmap[AW_H3_SID]);
+    sysbus_mmio_map(SYS_BUS_DEVICE(&s->sid), 0, s->memmap[AW_H3_DEV_SID]);
 
     /* SD/MMC */
     sysbus_realize(SYS_BUS_DEVICE(&s->mmc0), &error_fatal);
-    sysbus_mmio_map(SYS_BUS_DEVICE(&s->mmc0), 0, s->memmap[AW_H3_MMC0]);
+    sysbus_mmio_map(SYS_BUS_DEVICE(&s->mmc0), 0, s->memmap[AW_H3_DEV_MMC0]);
     sysbus_connect_irq(SYS_BUS_DEVICE(&s->mmc0), 0,
                        qdev_get_gpio_in(DEVICE(&s->gic), AW_H3_GIC_SPI_MMC0));
 
@@ -364,63 +364,63 @@ static void allwinner_h3_realize(DeviceState *dev, Error **errp)
         qdev_set_nic_properties(DEVICE(&s->emac), &nd_table[0]);
     }
     sysbus_realize(SYS_BUS_DEVICE(&s->emac), &error_fatal);
-    sysbus_mmio_map(SYS_BUS_DEVICE(&s->emac), 0, s->memmap[AW_H3_EMAC]);
+    sysbus_mmio_map(SYS_BUS_DEVICE(&s->emac), 0, s->memmap[AW_H3_DEV_EMAC]);
     sysbus_connect_irq(SYS_BUS_DEVICE(&s->emac), 0,
                        qdev_get_gpio_in(DEVICE(&s->gic), AW_H3_GIC_SPI_EMAC));
 
     /* Universal Serial Bus */
-    sysbus_create_simple(TYPE_AW_H3_EHCI, s->memmap[AW_H3_EHCI0],
+    sysbus_create_simple(TYPE_AW_H3_EHCI, s->memmap[AW_H3_DEV_EHCI0],
                          qdev_get_gpio_in(DEVICE(&s->gic),
                                           AW_H3_GIC_SPI_EHCI0));
-    sysbus_create_simple(TYPE_AW_H3_EHCI, s->memmap[AW_H3_EHCI1],
+    sysbus_create_simple(TYPE_AW_H3_EHCI, s->memmap[AW_H3_DEV_EHCI1],
                          qdev_get_gpio_in(DEVICE(&s->gic),
                                           AW_H3_GIC_SPI_EHCI1));
-    sysbus_create_simple(TYPE_AW_H3_EHCI, s->memmap[AW_H3_EHCI2],
+    sysbus_create_simple(TYPE_AW_H3_EHCI, s->memmap[AW_H3_DEV_EHCI2],
                          qdev_get_gpio_in(DEVICE(&s->gic),
                                           AW_H3_GIC_SPI_EHCI2));
-    sysbus_create_simple(TYPE_AW_H3_EHCI, s->memmap[AW_H3_EHCI3],
+    sysbus_create_simple(TYPE_AW_H3_EHCI, s->memmap[AW_H3_DEV_EHCI3],
                          qdev_get_gpio_in(DEVICE(&s->gic),
                                           AW_H3_GIC_SPI_EHCI3));
 
-    sysbus_create_simple("sysbus-ohci", s->memmap[AW_H3_OHCI0],
+    sysbus_create_simple("sysbus-ohci", s->memmap[AW_H3_DEV_OHCI0],
                          qdev_get_gpio_in(DEVICE(&s->gic),
                                           AW_H3_GIC_SPI_OHCI0));
-    sysbus_create_simple("sysbus-ohci", s->memmap[AW_H3_OHCI1],
+    sysbus_create_simple("sysbus-ohci", s->memmap[AW_H3_DEV_OHCI1],
                          qdev_get_gpio_in(DEVICE(&s->gic),
                                           AW_H3_GIC_SPI_OHCI1));
-    sysbus_create_simple("sysbus-ohci", s->memmap[AW_H3_OHCI2],
+    sysbus_create_simple("sysbus-ohci", s->memmap[AW_H3_DEV_OHCI2],
                          qdev_get_gpio_in(DEVICE(&s->gic),
                                           AW_H3_GIC_SPI_OHCI2));
-    sysbus_create_simple("sysbus-ohci", s->memmap[AW_H3_OHCI3],
+    sysbus_create_simple("sysbus-ohci", s->memmap[AW_H3_DEV_OHCI3],
                          qdev_get_gpio_in(DEVICE(&s->gic),
                                           AW_H3_GIC_SPI_OHCI3));
 
     /* UART0. For future clocktree API: All UARTS are connected to APB2_CLK. */
-    serial_mm_init(get_system_memory(), s->memmap[AW_H3_UART0], 2,
+    serial_mm_init(get_system_memory(), s->memmap[AW_H3_DEV_UART0], 2,
                    qdev_get_gpio_in(DEVICE(&s->gic), AW_H3_GIC_SPI_UART0),
                    115200, serial_hd(0), DEVICE_NATIVE_ENDIAN);
     /* UART1 */
-    serial_mm_init(get_system_memory(), s->memmap[AW_H3_UART1], 2,
+    serial_mm_init(get_system_memory(), s->memmap[AW_H3_DEV_UART1], 2,
                    qdev_get_gpio_in(DEVICE(&s->gic), AW_H3_GIC_SPI_UART1),
                    115200, serial_hd(1), DEVICE_NATIVE_ENDIAN);
     /* UART2 */
-    serial_mm_init(get_system_memory(), s->memmap[AW_H3_UART2], 2,
+    serial_mm_init(get_system_memory(), s->memmap[AW_H3_DEV_UART2], 2,
                    qdev_get_gpio_in(DEVICE(&s->gic), AW_H3_GIC_SPI_UART2),
                    115200, serial_hd(2), DEVICE_NATIVE_ENDIAN);
     /* UART3 */
-    serial_mm_init(get_system_memory(), s->memmap[AW_H3_UART3], 2,
+    serial_mm_init(get_system_memory(), s->memmap[AW_H3_DEV_UART3], 2,
                    qdev_get_gpio_in(DEVICE(&s->gic), AW_H3_GIC_SPI_UART3),
                    115200, serial_hd(3), DEVICE_NATIVE_ENDIAN);
 
     /* DRAMC */
     sysbus_realize(SYS_BUS_DEVICE(&s->dramc), &error_fatal);
-    sysbus_mmio_map(SYS_BUS_DEVICE(&s->dramc), 0, s->memmap[AW_H3_DRAMCOM]);
-    sysbus_mmio_map(SYS_BUS_DEVICE(&s->dramc), 1, s->memmap[AW_H3_DRAMCTL]);
-    sysbus_mmio_map(SYS_BUS_DEVICE(&s->dramc), 2, s->memmap[AW_H3_DRAMPHY]);
+    sysbus_mmio_map(SYS_BUS_DEVICE(&s->dramc), 0, s->memmap[AW_H3_DEV_DRAMCOM]);
+    sysbus_mmio_map(SYS_BUS_DEVICE(&s->dramc), 1, s->memmap[AW_H3_DEV_DRAMCTL]);
+    sysbus_mmio_map(SYS_BUS_DEVICE(&s->dramc), 2, s->memmap[AW_H3_DEV_DRAMPHY]);
 
     /* RTC */
     sysbus_realize(SYS_BUS_DEVICE(&s->rtc), &error_fatal);
-    sysbus_mmio_map(SYS_BUS_DEVICE(&s->rtc), 0, s->memmap[AW_H3_RTC]);
+    sysbus_mmio_map(SYS_BUS_DEVICE(&s->rtc), 0, s->memmap[AW_H3_DEV_RTC]);
 
     /* Unimplemented devices */
     for (i = 0; i < ARRAY_SIZE(unimplemented); i++) {
hw/arm/orangepi.c +3 -3
index 1679468232..17a568a2b4 100644
@@ -79,7 +79,7 @@ static void orangepi_init(MachineState *machine)
     object_property_set_int(OBJECT(&h3->emac), "phy-addr", 1, &error_abort);
 
     /* DRAMC */
-    object_property_set_uint(OBJECT(h3), "ram-addr", h3->memmap[AW_H3_SDRAM],
+    object_property_set_uint(OBJECT(h3), "ram-addr", h3->memmap[AW_H3_DEV_SDRAM],
                              &error_abort);
     object_property_set_int(OBJECT(h3), "ram-size", machine->ram_size / MiB,
                             &error_abort);
@@ -98,7 +98,7 @@ static void orangepi_init(MachineState *machine)
     qdev_realize_and_unref(carddev, bus, &error_fatal);
 
     /* SDRAM */
-    memory_region_add_subregion(get_system_memory(), h3->memmap[AW_H3_SDRAM],
+    memory_region_add_subregion(get_system_memory(), h3->memmap[AW_H3_DEV_SDRAM],
                                 machine->ram);
 
     /* Load target kernel or start using BootROM */
@@ -106,7 +106,7 @@ static void orangepi_init(MachineState *machine)
         /* Use Boot ROM to copy data from SD card to SRAM */
         allwinner_h3_bootrom_setup(h3, blk);
     }
-    orangepi_binfo.loader_start = h3->memmap[AW_H3_SDRAM];
+    orangepi_binfo.loader_start = h3->memmap[AW_H3_DEV_SDRAM];
     orangepi_binfo.ram_size = machine->ram_size;
     arm_load_kernel(ARM_CPU(first_cpu), machine, &orangepi_binfo);
 }
Reviewed-by
#16 lore raw

Re: [PATCH 06/41] allwinner-h3: Rename memmap enum constants

Hi,

Interesting suggestion Philippe. I modelled the initial code of the H3 SoC mostly in-line with the aspeed SoC,
to let it use commonly applied code structures where possible. And it looks like in this series, aspeed_soc.h is also
getting the same change. I'll see if I can find some time to make a small patch to move the enum to the local allwinner-h3.c file like you suggested.

For Eduardo's work, I'm OK with a rename for now to AW_H3_DEV_*. I see it is also done like that in aspeed_soc.h and similar files.
I do have one follow-up question: which value(s) from the enum are actually in conflict? Could you add that in the commit message perhaps, for clarity?

With that answered:

Regards,
Niek

Quoted 412 lines · Philippe Mathieu-Daudé

+Niek as maintainer.

Quoted 7 lines · Eduardo Habkost

Some of the enum constant names conflict with the QOM type check macros. This needs to be addressed to allow us to transform the QOM type check macros into functions generated by OBJECT_DECLARE_TYPE().

Rename all the constants to AW_H3_DEV_*, to avoid conflicts.

Review

Quoted 8 lines
---
 include/hw/arm/allwinner-h3.h |  62 ++++++++---------
 hw/arm/allwinner-h3.c         | 124 +++++++++++++++++-----------------
 hw/arm/orangepi.c             |   6 +-
 3 files changed, 96 insertions(+), 96 deletions(-)
(quoted diff) +0 -0

b/include/hw/arm/allwinner-h3.h

Quoted 32 lines

index 82e4e59216..626139dcb3 100644

include/hw/arm/allwinner-h3.h +0 -25
@@ -61,37 +61,37 @@
  * @see AwH3State
  */
 enum {
-    AW_H3_SRAM_A1,
-    AW_H3_SRAM_A2,
-    AW_H3_SRAM_C,
-    AW_H3_SYSCTRL,
-    AW_H3_MMC0,
-    AW_H3_SID,
-    AW_H3_EHCI0,
-    AW_H3_OHCI0,
-    AW_H3_EHCI1,
-    AW_H3_OHCI1,
-    AW_H3_EHCI2,
-    AW_H3_OHCI2,
-    AW_H3_EHCI3,
-    AW_H3_OHCI3,
-    AW_H3_CCU,
-    AW_H3_PIT,
-    AW_H3_UART0,
-    AW_H3_UART1,
-    AW_H3_UART2,
-    AW_H3_UART3,
-    AW_H3_EMAC,
-    AW_H3_DRAMCOM,
-    AW_H3_DRAMCTL,
-    AW_H3_DRAMPHY,
-    AW_H3_GIC_DIST,

include/hw/arm/allwinner-h3.h line 67

Quoted 10 lines
include/hw/arm/allwinner-h3.h +4 -6
-    AW_H3_GIC_CPU,
-    AW_H3_GIC_HYP,
-    AW_H3_GIC_VCPU,
-    AW_H3_RTC,
-    AW_H3_CPUCFG,
-    AW_H3_SDRAM
+    AW_H3_DEV_SRAM_A1,
+    AW_H3_DEV_SRAM_A2,
+    AW_H3_DEV_SRAM_C,
+    AW_H3_DEV_SYSCTRL,

My 2 cents:
These are not devices, but peripheral blocks or IP cores. Anyway, short change could be to name them E_AW_H3_xxx, but I don't understand why these are exposed. This enum should be locally declared in hw/arm/allwinner-h3.c, and the SoC might provide a get_sdram_base_address() method so the machine can access it.

hw/arm/allwinner-h3.c void allwinner_h3_bootrom_setup(AwH3State *s,

Quoted 104 lines
include/hw/arm/allwinner-h3.h +27 -0
+    AW_H3_DEV_MMC0,
+    AW_H3_DEV_SID,
+    AW_H3_DEV_EHCI0,
+    AW_H3_DEV_OHCI0,
+    AW_H3_DEV_EHCI1,
+    AW_H3_DEV_OHCI1,
+    AW_H3_DEV_EHCI2,
+    AW_H3_DEV_OHCI2,
+    AW_H3_DEV_EHCI3,
+    AW_H3_DEV_OHCI3,
+    AW_H3_DEV_CCU,
+    AW_H3_DEV_PIT,
+    AW_H3_DEV_UART0,
+    AW_H3_DEV_UART1,
+    AW_H3_DEV_UART2,
+    AW_H3_DEV_UART3,
+    AW_H3_DEV_EMAC,
+    AW_H3_DEV_DRAMCOM,
+    AW_H3_DEV_DRAMCTL,
+    AW_H3_DEV_DRAMPHY,
+    AW_H3_DEV_GIC_DIST,
+    AW_H3_DEV_GIC_CPU,
+    AW_H3_DEV_GIC_HYP,
+    AW_H3_DEV_GIC_VCPU,
+    AW_H3_DEV_RTC,
+    AW_H3_DEV_CPUCFG,
+    AW_H3_DEV_SDRAM
 };
 
 /** Total number of CPU cores in the H3 SoC */
hw/arm/allwinner-h3.c +31 -31
index ff92ded82c..341abe6718 100644
@@ -35,37 +35,37 @@
 
 /* Memory map */
 const hwaddr allwinner_h3_memmap[] = {
-    [AW_H3_SRAM_A1]    = 0x00000000,
-    [AW_H3_SRAM_A2]    = 0x00044000,
-    [AW_H3_SRAM_C]     = 0x00010000,
-    [AW_H3_SYSCTRL]    = 0x01c00000,
-    [AW_H3_MMC0]       = 0x01c0f000,
-    [AW_H3_SID]        = 0x01c14000,
-    [AW_H3_EHCI0]      = 0x01c1a000,
-    [AW_H3_OHCI0]      = 0x01c1a400,
-    [AW_H3_EHCI1]      = 0x01c1b000,
-    [AW_H3_OHCI1]      = 0x01c1b400,
-    [AW_H3_EHCI2]      = 0x01c1c000,
-    [AW_H3_OHCI2]      = 0x01c1c400,
-    [AW_H3_EHCI3]      = 0x01c1d000,
-    [AW_H3_OHCI3]      = 0x01c1d400,
-    [AW_H3_CCU]        = 0x01c20000,
-    [AW_H3_PIT]        = 0x01c20c00,
-    [AW_H3_UART0]      = 0x01c28000,
-    [AW_H3_UART1]      = 0x01c28400,
-    [AW_H3_UART2]      = 0x01c28800,
-    [AW_H3_UART3]      = 0x01c28c00,
-    [AW_H3_EMAC]       = 0x01c30000,
-    [AW_H3_DRAMCOM]    = 0x01c62000,
-    [AW_H3_DRAMCTL]    = 0x01c63000,
-    [AW_H3_DRAMPHY]    = 0x01c65000,
-    [AW_H3_GIC_DIST]   = 0x01c81000,
-    [AW_H3_GIC_CPU]    = 0x01c82000,
-    [AW_H3_GIC_HYP]    = 0x01c84000,
-    [AW_H3_GIC_VCPU]   = 0x01c86000,
-    [AW_H3_RTC]        = 0x01f00000,
-    [AW_H3_CPUCFG]     = 0x01f01c00,
-    [AW_H3_SDRAM]      = 0x40000000
+    [AW_H3_DEV_SRAM_A1]    = 0x00000000,
+    [AW_H3_DEV_SRAM_A2]    = 0x00044000,
+    [AW_H3_DEV_SRAM_C]     = 0x00010000,
+    [AW_H3_DEV_SYSCTRL]    = 0x01c00000,
+    [AW_H3_DEV_MMC0]       = 0x01c0f000,
+    [AW_H3_DEV_SID]        = 0x01c14000,
+    [AW_H3_DEV_EHCI0]      = 0x01c1a000,
+    [AW_H3_DEV_OHCI0]      = 0x01c1a400,
+    [AW_H3_DEV_EHCI1]      = 0x01c1b000,
+    [AW_H3_DEV_OHCI1]      = 0x01c1b400,
+    [AW_H3_DEV_EHCI2]      = 0x01c1c000,
+    [AW_H3_DEV_OHCI2]      = 0x01c1c400,
+    [AW_H3_DEV_EHCI3]      = 0x01c1d000,
+    [AW_H3_DEV_OHCI3]      = 0x01c1d400,
+    [AW_H3_DEV_CCU]        = 0x01c20000,
+    [AW_H3_DEV_PIT]        = 0x01c20c00,
+    [AW_H3_DEV_UART0]      = 0x01c28000,
+    [AW_H3_DEV_UART1]      = 0x01c28400,
+    [AW_H3_DEV_UART2]      = 0x01c28800,
+    [AW_H3_DEV_UART3]      = 0x01c28c00,
+    [AW_H3_DEV_EMAC]       = 0x01c30000,
+    [AW_H3_DEV_DRAMCOM]    = 0x01c62000,
+    [AW_H3_DEV_DRAMCTL]    = 0x01c63000,
+    [AW_H3_DEV_DRAMPHY]    = 0x01c65000,
+    [AW_H3_DEV_GIC_DIST]   = 0x01c81000,
+    [AW_H3_DEV_GIC_CPU]    = 0x01c82000,
+    [AW_H3_DEV_GIC_HYP]    = 0x01c84000,
+    [AW_H3_DEV_GIC_VCPU]   = 0x01c86000,
+    [AW_H3_DEV_RTC]        = 0x01f00000,
+    [AW_H3_DEV_CPUCFG]     = 0x01f01c00,
+    [AW_H3_DEV_SDRAM]      = 0x40000000
 };
 
 /* List of unimplemented devices */
@@ -183,7 +183,7 @@ void allwinner_h3_bootrom_setup(AwH3State *s,

BlockBackend *blk)

hw/arm/allwinner-h3.c static void allwinner_h3_realize(DeviceState *dev,

Quoted 9 lines
hw/arm/allwinner-h3.c +1 -1
     }
 
     rom_add_blob("allwinner-h3.bootrom", buffer, rom_size,
-                  rom_size, s->memmap[AW_H3_SRAM_A1],
+                  rom_size, s->memmap[AW_H3_DEV_SRAM_A1],
                   NULL, NULL, NULL, NULL, false);
 }
 
@@ -262,10 +262,10 @@ static void allwinner_h3_realize(DeviceState *dev,

Error **errp)

hw/arm/allwinner-h3.c static void allwinner_h3_realize(DeviceState *dev, · line 262

Quoted 1 line
hw/arm/allwinner-h3.c +0 -0
     qdev_prop_set_bit(DEVICE(&s->gic), "has-virtualization-extensions",

true);

hw/arm/allwinner-h3.c static void allwinner_h3_realize(DeviceState *dev, Error **errp)

Quoted 3 lines
hw/arm/allwinner-h3.c +0 -1
     sysbus_realize(SYS_BUS_DEVICE(&s->gic), &error_fatal);
 
-    sysbus_mmio_map(SYS_BUS_DEVICE(&s->gic), 0,

s->memmap[AW_H3_GIC_DIST]);

hw/arm/allwinner-h3.c static void allwinner_h3_realize(DeviceState *dev, · line 266

Quoted 1 line
hw/arm/allwinner-h3.c +0 -1
-    sysbus_mmio_map(SYS_BUS_DEVICE(&s->gic), 1,

s->memmap[AW_H3_GIC_CPU]);

hw/arm/allwinner-h3.c static void allwinner_h3_realize(DeviceState *dev, · line 267

Quoted 1 line
hw/arm/allwinner-h3.c +0 -1
-    sysbus_mmio_map(SYS_BUS_DEVICE(&s->gic), 2,

s->memmap[AW_H3_GIC_HYP]);

hw/arm/allwinner-h3.c static void allwinner_h3_realize(DeviceState *dev, · line 268

Quoted 1 line
hw/arm/allwinner-h3.c +0 -1
-    sysbus_mmio_map(SYS_BUS_DEVICE(&s->gic), 3,

s->memmap[AW_H3_GIC_VCPU]);

hw/arm/allwinner-h3.c static void allwinner_h3_realize(DeviceState *dev, · line 265

Quoted 1 line
hw/arm/allwinner-h3.c +1 -0
+    sysbus_mmio_map(SYS_BUS_DEVICE(&s->gic), 0,

s->memmap[AW_H3_DEV_GIC_DIST]);

hw/arm/allwinner-h3.c static void allwinner_h3_realize(DeviceState *dev, · line 266

Quoted 1 line
hw/arm/allwinner-h3.c +1 -0
+    sysbus_mmio_map(SYS_BUS_DEVICE(&s->gic), 1,

s->memmap[AW_H3_DEV_GIC_CPU]);

hw/arm/allwinner-h3.c static void allwinner_h3_realize(DeviceState *dev, · line 267

Quoted 1 line
hw/arm/allwinner-h3.c +1 -0
+    sysbus_mmio_map(SYS_BUS_DEVICE(&s->gic), 2,

s->memmap[AW_H3_DEV_GIC_HYP]);

hw/arm/allwinner-h3.c static void allwinner_h3_realize(DeviceState *dev, · line 268

Quoted 1 line
hw/arm/allwinner-h3.c +1 -0
+    sysbus_mmio_map(SYS_BUS_DEVICE(&s->gic), 3,

s->memmap[AW_H3_DEV_GIC_VCPU]);

hw/arm/allwinner-h3.c static void allwinner_h3_realize(DeviceState *dev,

Quoted 4 lines
hw/arm/allwinner-h3.c +0 -0
     /*
      * Wire the outputs from each CPU's generic timer and the GICv3
@@ -312,7 +312,7 @@ static void allwinner_h3_realize(DeviceState *dev,

Error **errp)

hw/arm/allwinner-h3.c static void allwinner_h3_realize(DeviceState *dev, Error **errp)

Quoted 5 lines
hw/arm/allwinner-h3.c +1 -1
     /* Timer */
     sysbus_realize(SYS_BUS_DEVICE(&s->timer), &error_fatal);
-    sysbus_mmio_map(SYS_BUS_DEVICE(&s->timer), 0, s->memmap[AW_H3_PIT]);
+    sysbus_mmio_map(SYS_BUS_DEVICE(&s->timer), 0,

s->memmap[AW_H3_DEV_PIT]);

hw/arm/allwinner-h3.c static void allwinner_h3_realize(DeviceState *dev, · line 316

Quoted 2 lines
hw/arm/allwinner-h3.c +0 -0
     sysbus_connect_irq(SYS_BUS_DEVICE(&s->timer), 0,
                        qdev_get_gpio_in(DEVICE(&s->gic),

AW_H3_GIC_SPI_TIMER0));

hw/arm/allwinner-h3.c static void allwinner_h3_realize(DeviceState *dev,

Quoted 2 lines
hw/arm/allwinner-h3.c +0 -0
     sysbus_connect_irq(SYS_BUS_DEVICE(&s->timer), 1,
@@ -325,32 +325,32 @@ static void allwinner_h3_realize(DeviceState *dev,

Error **errp)

hw/arm/allwinner-h3.c static void allwinner_h3_realize(DeviceState *dev, Error **errp)

Quoted 4 lines
hw/arm/allwinner-h3.c +0 -1
                             32 * KiB, &error_abort);
     memory_region_init_ram(&s->sram_c, OBJECT(dev), "sram C",
                             44 * KiB, &error_abort);
-    memory_region_add_subregion(get_system_memory(),

s->memmap[AW_H3_SRAM_A1],

hw/arm/allwinner-h3.c static void allwinner_h3_realize(DeviceState *dev, · line 328

Quoted 1 line
hw/arm/allwinner-h3.c +1 -0
+    memory_region_add_subregion(get_system_memory(),

s->memmap[AW_H3_DEV_SRAM_A1],

hw/arm/allwinner-h3.c static void allwinner_h3_realize(DeviceState *dev, · line 330

Quoted 2 lines
hw/arm/allwinner-h3.c +0 -1
                                 &s->sram_a1);
-    memory_region_add_subregion(get_system_memory(),

s->memmap[AW_H3_SRAM_A2],

hw/arm/allwinner-h3.c static void allwinner_h3_realize(DeviceState *dev, · line 330

Quoted 1 line
hw/arm/allwinner-h3.c +1 -0
+    memory_region_add_subregion(get_system_memory(),

s->memmap[AW_H3_DEV_SRAM_A2],

hw/arm/allwinner-h3.c static void allwinner_h3_realize(DeviceState *dev, · line 332

Quoted 2 lines
hw/arm/allwinner-h3.c +0 -1
                                 &s->sram_a2);
-    memory_region_add_subregion(get_system_memory(),

s->memmap[AW_H3_SRAM_C],

hw/arm/allwinner-h3.c static void allwinner_h3_realize(DeviceState *dev, · line 332

Quoted 1 line
hw/arm/allwinner-h3.c +1 -0
+    memory_region_add_subregion(get_system_memory(),

s->memmap[AW_H3_DEV_SRAM_C],

hw/arm/allwinner-h3.c static void allwinner_h3_realize(DeviceState *dev, Error **errp)

Quoted 6 lines
hw/arm/allwinner-h3.c +1 -1
                                 &s->sram_c);
 
     /* Clock Control Unit */
     sysbus_realize(SYS_BUS_DEVICE(&s->ccu), &error_fatal);
-    sysbus_mmio_map(SYS_BUS_DEVICE(&s->ccu), 0, s->memmap[AW_H3_CCU]);
+    sysbus_mmio_map(SYS_BUS_DEVICE(&s->ccu), 0,

s->memmap[AW_H3_DEV_CCU]);

hw/arm/allwinner-h3.c static void allwinner_h3_realize(DeviceState *dev, Error **errp)

Quoted 4 lines
hw/arm/allwinner-h3.c +0 -1
     /* System Control */
     sysbus_realize(SYS_BUS_DEVICE(&s->sysctrl), &error_fatal);
-    sysbus_mmio_map(SYS_BUS_DEVICE(&s->sysctrl), 0,

s->memmap[AW_H3_SYSCTRL]);

hw/arm/allwinner-h3.c static void allwinner_h3_realize(DeviceState *dev, · line 340

Quoted 1 line
hw/arm/allwinner-h3.c +1 -0
+    sysbus_mmio_map(SYS_BUS_DEVICE(&s->sysctrl), 0,

s->memmap[AW_H3_DEV_SYSCTRL]);

hw/arm/allwinner-h3.c static void allwinner_h3_realize(DeviceState *dev, Error **errp)

Quoted 4 lines
hw/arm/allwinner-h3.c +0 -1
     /* CPU Configuration */
     sysbus_realize(SYS_BUS_DEVICE(&s->cpucfg), &error_fatal);
-    sysbus_mmio_map(SYS_BUS_DEVICE(&s->cpucfg), 0,

s->memmap[AW_H3_CPUCFG]);

hw/arm/allwinner-h3.c static void allwinner_h3_realize(DeviceState *dev, · line 343

Quoted 1 line
hw/arm/allwinner-h3.c +1 -0
+    sysbus_mmio_map(SYS_BUS_DEVICE(&s->cpucfg), 0,

s->memmap[AW_H3_DEV_CPUCFG]);

hw/arm/allwinner-h3.c static void allwinner_h3_realize(DeviceState *dev, Error **errp)

Quoted 5 lines
hw/arm/allwinner-h3.c +1 -1
     /* Security Identifier */
     sysbus_realize(SYS_BUS_DEVICE(&s->sid), &error_fatal);
-    sysbus_mmio_map(SYS_BUS_DEVICE(&s->sid), 0, s->memmap[AW_H3_SID]);
+    sysbus_mmio_map(SYS_BUS_DEVICE(&s->sid), 0,

s->memmap[AW_H3_DEV_SID]);

hw/arm/allwinner-h3.c static void allwinner_h3_realize(DeviceState *dev, Error **errp)

Quoted 5 lines
hw/arm/allwinner-h3.c +1 -1
     /* SD/MMC */
     sysbus_realize(SYS_BUS_DEVICE(&s->mmc0), &error_fatal);
-    sysbus_mmio_map(SYS_BUS_DEVICE(&s->mmc0), 0, s->memmap[AW_H3_MMC0]);
+    sysbus_mmio_map(SYS_BUS_DEVICE(&s->mmc0), 0,

s->memmap[AW_H3_DEV_MMC0]);

hw/arm/allwinner-h3.c static void allwinner_h3_realize(DeviceState *dev, · line 351

Quoted 2 lines
hw/arm/allwinner-h3.c +0 -0
     sysbus_connect_irq(SYS_BUS_DEVICE(&s->mmc0), 0,
                        qdev_get_gpio_in(DEVICE(&s->gic),

AW_H3_GIC_SPI_MMC0));

hw/arm/allwinner-h3.c static void allwinner_h3_realize(DeviceState *dev,

Quoted 2 lines
hw/arm/allwinner-h3.c +0 -0
@@ -364,63 +364,63 @@ static void allwinner_h3_realize(DeviceState *dev,

Error **errp)

hw/arm/allwinner-h3.c static void allwinner_h3_realize(DeviceState *dev, Error **errp)

Quoted 5 lines
hw/arm/allwinner-h3.c +1 -1
         qdev_set_nic_properties(DEVICE(&s->emac), &nd_table[0]);
     }
     sysbus_realize(SYS_BUS_DEVICE(&s->emac), &error_fatal);
-    sysbus_mmio_map(SYS_BUS_DEVICE(&s->emac), 0, s->memmap[AW_H3_EMAC]);
+    sysbus_mmio_map(SYS_BUS_DEVICE(&s->emac), 0,

s->memmap[AW_H3_DEV_EMAC]);

hw/arm/allwinner-h3.c static void allwinner_h3_realize(DeviceState *dev, · line 369

Quoted 2 lines
hw/arm/allwinner-h3.c +0 -0
     sysbus_connect_irq(SYS_BUS_DEVICE(&s->emac), 0,
                        qdev_get_gpio_in(DEVICE(&s->gic),

AW_H3_GIC_SPI_EMAC));

Quoted 27 lines
hw/arm/allwinner-h3.c +6 -6
     /* Universal Serial Bus */
-    sysbus_create_simple(TYPE_AW_H3_EHCI, s->memmap[AW_H3_EHCI0],
+    sysbus_create_simple(TYPE_AW_H3_EHCI, s->memmap[AW_H3_DEV_EHCI0],
                          qdev_get_gpio_in(DEVICE(&s->gic),
                                           AW_H3_GIC_SPI_EHCI0));
-    sysbus_create_simple(TYPE_AW_H3_EHCI, s->memmap[AW_H3_EHCI1],
+    sysbus_create_simple(TYPE_AW_H3_EHCI, s->memmap[AW_H3_DEV_EHCI1],
                          qdev_get_gpio_in(DEVICE(&s->gic),
                                           AW_H3_GIC_SPI_EHCI1));
-    sysbus_create_simple(TYPE_AW_H3_EHCI, s->memmap[AW_H3_EHCI2],
+    sysbus_create_simple(TYPE_AW_H3_EHCI, s->memmap[AW_H3_DEV_EHCI2],
                          qdev_get_gpio_in(DEVICE(&s->gic),
                                           AW_H3_GIC_SPI_EHCI2));
-    sysbus_create_simple(TYPE_AW_H3_EHCI, s->memmap[AW_H3_EHCI3],
+    sysbus_create_simple(TYPE_AW_H3_EHCI, s->memmap[AW_H3_DEV_EHCI3],
                          qdev_get_gpio_in(DEVICE(&s->gic),
                                           AW_H3_GIC_SPI_EHCI3));
 
-    sysbus_create_simple("sysbus-ohci", s->memmap[AW_H3_OHCI0],
+    sysbus_create_simple("sysbus-ohci", s->memmap[AW_H3_DEV_OHCI0],
                          qdev_get_gpio_in(DEVICE(&s->gic),
                                           AW_H3_GIC_SPI_OHCI0));
-    sysbus_create_simple("sysbus-ohci", s->memmap[AW_H3_OHCI1],
+    sysbus_create_simple("sysbus-ohci", s->memmap[AW_H3_DEV_OHCI1],
                          qdev_get_gpio_in(DEVICE(&s->gic),
                                           AW_H3_GIC_SPI_OHCI1));

hw/arm/allwinner-h3.c static void allwinner_h3_realize(DeviceState *dev, Error **errp)

Quoted 10 lines
hw/arm/allwinner-h3.c +2 -2
-    sysbus_create_simple("sysbus-ohci", s->memmap[AW_H3_OHCI2],
+    sysbus_create_simple("sysbus-ohci", s->memmap[AW_H3_DEV_OHCI2],
                          qdev_get_gpio_in(DEVICE(&s->gic),
                                           AW_H3_GIC_SPI_OHCI2));
-    sysbus_create_simple("sysbus-ohci", s->memmap[AW_H3_OHCI3],
+    sysbus_create_simple("sysbus-ohci", s->memmap[AW_H3_DEV_OHCI3],
                          qdev_get_gpio_in(DEVICE(&s->gic),
                                           AW_H3_GIC_SPI_OHCI3));
 
     /* UART0. For future clocktree API: All UARTS are connected to

APB2_CLK. */

hw/arm/allwinner-h3.c static void allwinner_h3_realize(DeviceState *dev, Error **errp)

Quoted 3 lines
hw/arm/allwinner-h3.c +1 -1
-    serial_mm_init(get_system_memory(), s->memmap[AW_H3_UART0], 2,
+    serial_mm_init(get_system_memory(), s->memmap[AW_H3_DEV_UART0], 2,
                    qdev_get_gpio_in(DEVICE(&s->gic),

AW_H3_GIC_SPI_UART0),

hw/arm/allwinner-h3.c static void allwinner_h3_realize(DeviceState *dev, Error **errp)

Quoted 5 lines
hw/arm/allwinner-h3.c +1 -1
                    115200, serial_hd(0), DEVICE_NATIVE_ENDIAN);
     /* UART1 */
-    serial_mm_init(get_system_memory(), s->memmap[AW_H3_UART1], 2,
+    serial_mm_init(get_system_memory(), s->memmap[AW_H3_DEV_UART1], 2,
                    qdev_get_gpio_in(DEVICE(&s->gic),

AW_H3_GIC_SPI_UART1),

hw/arm/allwinner-h3.c static void allwinner_h3_realize(DeviceState *dev, Error **errp)

Quoted 5 lines
hw/arm/allwinner-h3.c +1 -1
                    115200, serial_hd(1), DEVICE_NATIVE_ENDIAN);
     /* UART2 */
-    serial_mm_init(get_system_memory(), s->memmap[AW_H3_UART2], 2,
+    serial_mm_init(get_system_memory(), s->memmap[AW_H3_DEV_UART2], 2,
                    qdev_get_gpio_in(DEVICE(&s->gic),

AW_H3_GIC_SPI_UART2),

hw/arm/allwinner-h3.c static void allwinner_h3_realize(DeviceState *dev, Error **errp)

Quoted 5 lines
hw/arm/allwinner-h3.c +1 -1
                    115200, serial_hd(2), DEVICE_NATIVE_ENDIAN);
     /* UART3 */
-    serial_mm_init(get_system_memory(), s->memmap[AW_H3_UART3], 2,
+    serial_mm_init(get_system_memory(), s->memmap[AW_H3_DEV_UART3], 2,
                    qdev_get_gpio_in(DEVICE(&s->gic),

AW_H3_GIC_SPI_UART3),

hw/arm/allwinner-h3.c static void allwinner_h3_realize(DeviceState *dev, Error **errp)

Quoted 5 lines
hw/arm/allwinner-h3.c +0 -1
                    115200, serial_hd(3), DEVICE_NATIVE_ENDIAN);
 
     /* DRAMC */
     sysbus_realize(SYS_BUS_DEVICE(&s->dramc), &error_fatal);
-    sysbus_mmio_map(SYS_BUS_DEVICE(&s->dramc), 0,

s->memmap[AW_H3_DRAMCOM]);

hw/arm/allwinner-h3.c static void allwinner_h3_realize(DeviceState *dev, · line 417

Quoted 1 line
hw/arm/allwinner-h3.c +0 -1
-    sysbus_mmio_map(SYS_BUS_DEVICE(&s->dramc), 1,

s->memmap[AW_H3_DRAMCTL]);

hw/arm/allwinner-h3.c static void allwinner_h3_realize(DeviceState *dev, · line 418

Quoted 1 line
hw/arm/allwinner-h3.c +0 -1
-    sysbus_mmio_map(SYS_BUS_DEVICE(&s->dramc), 2,

s->memmap[AW_H3_DRAMPHY]);

hw/arm/allwinner-h3.c static void allwinner_h3_realize(DeviceState *dev, · line 416

Quoted 1 line
hw/arm/allwinner-h3.c +1 -0
+    sysbus_mmio_map(SYS_BUS_DEVICE(&s->dramc), 0,

s->memmap[AW_H3_DEV_DRAMCOM]);

hw/arm/allwinner-h3.c static void allwinner_h3_realize(DeviceState *dev, · line 417

Quoted 1 line
hw/arm/allwinner-h3.c +1 -0
+    sysbus_mmio_map(SYS_BUS_DEVICE(&s->dramc), 1,

s->memmap[AW_H3_DEV_DRAMCTL]);

hw/arm/allwinner-h3.c static void allwinner_h3_realize(DeviceState *dev, · line 418

Quoted 1 line
hw/arm/allwinner-h3.c +1 -0
+    sysbus_mmio_map(SYS_BUS_DEVICE(&s->dramc), 2,

s->memmap[AW_H3_DEV_DRAMPHY]);

hw/arm/allwinner-h3.c static void allwinner_h3_realize(DeviceState *dev, Error **errp)

Quoted 5 lines
hw/arm/allwinner-h3.c +1 -1
     /* RTC */
     sysbus_realize(SYS_BUS_DEVICE(&s->rtc), &error_fatal);
-    sysbus_mmio_map(SYS_BUS_DEVICE(&s->rtc), 0, s->memmap[AW_H3_RTC]);
+    sysbus_mmio_map(SYS_BUS_DEVICE(&s->rtc), 0,

s->memmap[AW_H3_DEV_RTC]);

hw/arm/orangepi.c static void orangepi_init(MachineState *machine) · line 79

Quoted 9 lines
hw/arm/allwinner-h3.c +0 -0
     /* Unimplemented devices */
     for (i = 0; i < ARRAY_SIZE(unimplemented); i++) {
hw/arm/orangepi.c +0 -0
index 1679468232..17a568a2b4 100644
@@ -79,7 +79,7 @@ static void orangepi_init(MachineState *machine)
     object_property_set_int(OBJECT(&h3->emac), "phy-addr", 1,

&error_abort);

hw/arm/orangepi.c static void orangepi_init(MachineState *machine) · line 81

Quoted 3 lines
hw/arm/orangepi.c +0 -1
     /* DRAMC */
-    object_property_set_uint(OBJECT(h3), "ram-addr",

h3->memmap[AW_H3_SDRAM],

hw/arm/orangepi.c static void orangepi_init(MachineState *machine) · line 81

Quoted 1 line
hw/arm/orangepi.c +1 -0
+    object_property_set_uint(OBJECT(h3), "ram-addr",

h3->memmap[AW_H3_DEV_SDRAM],

hw/arm/orangepi.c static void orangepi_init(MachineState *machine) · line 83

Quoted 2 lines
hw/arm/orangepi.c +0 -0
                              &error_abort);
     object_property_set_int(OBJECT(h3), "ram-size", machine->ram_size /

MiB,

hw/arm/orangepi.c static void orangepi_init(MachineState *machine) · line 101

Quoted 6 lines
hw/arm/orangepi.c +0 -1
                             &error_abort);
@@ -98,7 +98,7 @@ static void orangepi_init(MachineState *machine)
     qdev_realize_and_unref(carddev, bus, &error_fatal);
 
     /* SDRAM */
-    memory_region_add_subregion(get_system_memory(),

h3->memmap[AW_H3_SDRAM],

hw/arm/orangepi.c static void orangepi_init(MachineState *machine) · line 101

Quoted 1 line
hw/arm/orangepi.c +1 -0
+    memory_region_add_subregion(get_system_memory(),

h3->memmap[AW_H3_DEV_SDRAM],

Quoted 13 lines
hw/arm/orangepi.c +1 -1
                                 machine->ram);
 
     /* Load target kernel or start using BootROM */
@@ -106,7 +106,7 @@ static void orangepi_init(MachineState *machine)
         /* Use Boot ROM to copy data from SD card to SRAM */
         allwinner_h3_bootrom_setup(h3, blk);
     }
-    orangepi_binfo.loader_start = h3->memmap[AW_H3_SDRAM];
+    orangepi_binfo.loader_start = h3->memmap[AW_H3_DEV_SDRAM];
     orangepi_binfo.ram_size = machine->ram_size;
     arm_load_kernel(ARM_CPU(first_cpu), machine, &orangepi_binfo);
 }
Signature · 1 line
Niek Linnenbank
#17 lore raw

Re: [PATCH 06/41] allwinner-h3: Rename memmap enum constants

Quoted 10 lines · Niek Linnenbank

Hi,

Interesting suggestion Philippe. I modelled the initial code of the H3 SoC mostly in-line with the aspeed SoC,
to let it use commonly applied code structures where possible. And it looks like in this series, aspeed_soc.h is also
getting the same change. I'll see if I can find some time to make a small patch to move the enum to the local allwinner-h3.c file like you suggested.

Quoted 4 lines

For Eduardo's work, I'm OK with a rename for now to AW_H3_DEV_*. I see it is also done like that in aspeed_soc.h and similar files.
I do have one follow-up question: which value(s) from the enum are actually in conflict? Could you add that in the commit message perhaps, for clarity?

For allwinner-h3, the conflicting macros are: AW_H3_CCU, AW_H3_SYSCTRL.

v2 of the series will have the conflicting macros mentioned in the commit message in all the "rename enum constants" patches.

Quoted 3 lines

With that answered:

Thanks!

Signature · 1 line
Eduardo
#18 lore raw

PATCH 7/41 aspeed_soc: Rename memmap/irqmap enum constants

In reply to Eduardo Habkost

Some of the enum constant names conflict with the QOM type check macros. This needs to be addressed to allow us to transform the QOM type check macros into functions generated by OBJECT_DECLARE_TYPE().

Rename all the constants to ASPEED_DEV_*, to avoid conflicts.

---
 include/hw/arm/aspeed_soc.h |  92 +++++++--------
 hw/arm/aspeed.c             |   4 +-
 hw/arm/aspeed_ast2600.c     | 208 ++++++++++++++++----------------
 hw/arm/aspeed_soc.c         | 228 ++++++++++++++++++------------------
 4 files changed, 266 insertions(+), 266 deletions(-)
include/hw/arm/aspeed_soc.h +46 -46
index 914115f3ef..d46f197cbe 100644
@@ -87,52 +87,52 @@ typedef struct AspeedSoCClass {
     OBJECT_GET_CLASS(AspeedSoCClass, (obj), TYPE_ASPEED_SOC)
 
 enum {
-    ASPEED_IOMEM,
-    ASPEED_UART1,
-    ASPEED_UART2,
-    ASPEED_UART3,
-    ASPEED_UART4,
-    ASPEED_UART5,
-    ASPEED_VUART,
-    ASPEED_FMC,
-    ASPEED_SPI1,
-    ASPEED_SPI2,
-    ASPEED_EHCI1,
-    ASPEED_EHCI2,
-    ASPEED_VIC,
-    ASPEED_SDMC,
-    ASPEED_SCU,
-    ASPEED_ADC,
-    ASPEED_VIDEO,
-    ASPEED_SRAM,
-    ASPEED_SDHCI,
-    ASPEED_GPIO,
-    ASPEED_GPIO_1_8V,
-    ASPEED_RTC,
-    ASPEED_TIMER1,
-    ASPEED_TIMER2,
-    ASPEED_TIMER3,
-    ASPEED_TIMER4,
-    ASPEED_TIMER5,
-    ASPEED_TIMER6,
-    ASPEED_TIMER7,
-    ASPEED_TIMER8,
-    ASPEED_WDT,
-    ASPEED_PWM,
-    ASPEED_LPC,
-    ASPEED_IBT,
-    ASPEED_I2C,
-    ASPEED_ETH1,
-    ASPEED_ETH2,
-    ASPEED_ETH3,
-    ASPEED_ETH4,
-    ASPEED_MII1,
-    ASPEED_MII2,
-    ASPEED_MII3,
-    ASPEED_MII4,
-    ASPEED_SDRAM,
-    ASPEED_XDMA,
-    ASPEED_EMMC,
+    ASPEED_DEV_IOMEM,
+    ASPEED_DEV_UART1,
+    ASPEED_DEV_UART2,
+    ASPEED_DEV_UART3,
+    ASPEED_DEV_UART4,
+    ASPEED_DEV_UART5,
+    ASPEED_DEV_VUART,
+    ASPEED_DEV_FMC,
+    ASPEED_DEV_SPI1,
+    ASPEED_DEV_SPI2,
+    ASPEED_DEV_EHCI1,
+    ASPEED_DEV_EHCI2,
+    ASPEED_DEV_VIC,
+    ASPEED_DEV_SDMC,
+    ASPEED_DEV_SCU,
+    ASPEED_DEV_ADC,
+    ASPEED_DEV_VIDEO,
+    ASPEED_DEV_SRAM,
+    ASPEED_DEV_SDHCI,
+    ASPEED_DEV_GPIO,
+    ASPEED_DEV_GPIO_1_8V,
+    ASPEED_DEV_RTC,
+    ASPEED_DEV_TIMER1,
+    ASPEED_DEV_TIMER2,
+    ASPEED_DEV_TIMER3,
+    ASPEED_DEV_TIMER4,
+    ASPEED_DEV_TIMER5,
+    ASPEED_DEV_TIMER6,
+    ASPEED_DEV_TIMER7,
+    ASPEED_DEV_TIMER8,
+    ASPEED_DEV_WDT,
+    ASPEED_DEV_PWM,
+    ASPEED_DEV_LPC,
+    ASPEED_DEV_IBT,
+    ASPEED_DEV_I2C,
+    ASPEED_DEV_ETH1,
+    ASPEED_DEV_ETH2,
+    ASPEED_DEV_ETH3,
+    ASPEED_DEV_ETH4,
+    ASPEED_DEV_MII1,
+    ASPEED_DEV_MII2,
+    ASPEED_DEV_MII3,
+    ASPEED_DEV_MII4,
+    ASPEED_DEV_SDRAM,
+    ASPEED_DEV_XDMA,
+    ASPEED_DEV_EMMC,
 };
 
 #endif /* ASPEED_SOC_H */
hw/arm/aspeed.c +2 -2
index fcb1a7cd87..8109cc6d2d 100644
@@ -309,7 +309,7 @@ static void aspeed_machine_init(MachineState *machine)
     qdev_realize(DEVICE(&bmc->soc), NULL, &error_abort);
 
     memory_region_add_subregion(get_system_memory(),
-                                sc->memmap[ASPEED_SDRAM],
+                                sc->memmap[ASPEED_DEV_SDRAM],
                                 &bmc->ram_container);
 
     max_ram_size = object_property_get_uint(OBJECT(&bmc->soc), "max-ram-size",
@@ -360,7 +360,7 @@ static void aspeed_machine_init(MachineState *machine)
     }
 
     aspeed_board_binfo.ram_size = ram_size;
-    aspeed_board_binfo.loader_start = sc->memmap[ASPEED_SDRAM];
+    aspeed_board_binfo.loader_start = sc->memmap[ASPEED_DEV_SDRAM];
     aspeed_board_binfo.nb_cpus = sc->num_cpus;
 
     if (amc->i2c_init) {
hw/arm/aspeed_ast2600.c +104 -104

351 lines not on this page · raw message

hw/arm/aspeed_soc.c +114 -114

356 lines not on this page · raw message

Signature · 1 line
2.26.2
#19 lore raw

PATCH 8/41 opentitan: Rename memmap enum constants

In reply to Eduardo Habkost

Some of the enum constant names conflict with the QOM type check macros. This needs to be addressed to allow us to transform the QOM type check macros into functions generated by OBJECT_DECLARE_TYPE().

Rename all the constants to IBEX_DEV_*, to avoid conflicts.

---
 include/hw/riscv/opentitan.h | 38 ++++++++--------
 hw/riscv/opentitan.c         | 84 ++++++++++++++++++------------------
 2 files changed, 61 insertions(+), 61 deletions(-)
include/hw/riscv/opentitan.h +19 -19
index 8f29b9cbbf..835a80f896 100644
@@ -49,25 +49,25 @@ typedef struct OpenTitanState {
 } OpenTitanState;
 
 enum {
-    IBEX_ROM,
-    IBEX_RAM,
-    IBEX_FLASH,
-    IBEX_UART,
-    IBEX_GPIO,
-    IBEX_SPI,
-    IBEX_FLASH_CTRL,
-    IBEX_RV_TIMER,
-    IBEX_AES,
-    IBEX_HMAC,
-    IBEX_PLIC,
-    IBEX_PWRMGR,
-    IBEX_RSTMGR,
-    IBEX_CLKMGR,
-    IBEX_PINMUX,
-    IBEX_ALERT_HANDLER,
-    IBEX_NMI_GEN,
-    IBEX_USBDEV,
-    IBEX_PADCTRL,
+    IBEX_DEV_ROM,
+    IBEX_DEV_RAM,
+    IBEX_DEV_FLASH,
+    IBEX_DEV_UART,
+    IBEX_DEV_GPIO,
+    IBEX_DEV_SPI,
+    IBEX_DEV_FLASH_CTRL,
+    IBEX_DEV_RV_TIMER,
+    IBEX_DEV_AES,
+    IBEX_DEV_HMAC,
+    IBEX_DEV_PLIC,
+    IBEX_DEV_PWRMGR,
+    IBEX_DEV_RSTMGR,
+    IBEX_DEV_CLKMGR,
+    IBEX_DEV_PINMUX,
+    IBEX_DEV_ALERT_HANDLER,
+    IBEX_DEV_NMI_GEN,
+    IBEX_DEV_USBDEV,
+    IBEX_DEV_PADCTRL,
 };
 
 enum {
hw/riscv/opentitan.c +42 -42

140 lines not on this page · raw message

Signature · 1 line
2.26.2
Reviewed-by on v1 8/41
#20 lore raw

Re: [PATCH 08/41] opentitan: Rename memmap enum constants

Quoted 9 lines · Eduardo Habkost

Some of the enum constant names conflict with the QOM type check macros. This needs to be addressed to allow us to transform the QOM type check macros into functions generated by OBJECT_DECLARE_TYPE().

Rename all the constants to IBEX_DEV_*, to avoid conflicts.

Alistair

Quoted 206 lines
---
 include/hw/riscv/opentitan.h | 38 ++++++++--------
 hw/riscv/opentitan.c         | 84 ++++++++++++++++++------------------
 2 files changed, 61 insertions(+), 61 deletions(-)
include/hw/riscv/opentitan.h +19 -19
index 8f29b9cbbf..835a80f896 100644
@@ -49,25 +49,25 @@ typedef struct OpenTitanState {
 } OpenTitanState;
 
 enum {
-    IBEX_ROM,
-    IBEX_RAM,
-    IBEX_FLASH,
-    IBEX_UART,
-    IBEX_GPIO,
-    IBEX_SPI,
-    IBEX_FLASH_CTRL,
-    IBEX_RV_TIMER,
-    IBEX_AES,
-    IBEX_HMAC,
-    IBEX_PLIC,
-    IBEX_PWRMGR,
-    IBEX_RSTMGR,
-    IBEX_CLKMGR,
-    IBEX_PINMUX,
-    IBEX_ALERT_HANDLER,
-    IBEX_NMI_GEN,
-    IBEX_USBDEV,
-    IBEX_PADCTRL,
+    IBEX_DEV_ROM,
+    IBEX_DEV_RAM,
+    IBEX_DEV_FLASH,
+    IBEX_DEV_UART,
+    IBEX_DEV_GPIO,
+    IBEX_DEV_SPI,
+    IBEX_DEV_FLASH_CTRL,
+    IBEX_DEV_RV_TIMER,
+    IBEX_DEV_AES,
+    IBEX_DEV_HMAC,
+    IBEX_DEV_PLIC,
+    IBEX_DEV_PWRMGR,
+    IBEX_DEV_RSTMGR,
+    IBEX_DEV_CLKMGR,
+    IBEX_DEV_PINMUX,
+    IBEX_DEV_ALERT_HANDLER,
+    IBEX_DEV_NMI_GEN,
+    IBEX_DEV_USBDEV,
+    IBEX_DEV_PADCTRL,
 };
 
 enum {
hw/riscv/opentitan.c +42 -43
index a8f0039e51..23ba3b4bfc 100644
@@ -32,25 +32,25 @@ static const struct MemmapEntry {
     hwaddr base;
     hwaddr size;
 } ibex_memmap[] = {
-    [IBEX_ROM] =            {  0x00008000, 16 * KiB },
-    [IBEX_RAM] =            {  0x10000000,  0x10000 },
-    [IBEX_FLASH] =          {  0x20000000,  0x80000 },
-    [IBEX_UART] =           {  0x40000000,  0x10000 },
-    [IBEX_GPIO] =           {  0x40010000,  0x10000 },
-    [IBEX_SPI] =            {  0x40020000,  0x10000 },
-    [IBEX_FLASH_CTRL] =     {  0x40030000,  0x10000 },
-    [IBEX_PINMUX] =         {  0x40070000,  0x10000 },
-    [IBEX_RV_TIMER] =       {  0x40080000,  0x10000 },
-    [IBEX_PLIC] =           {  0x40090000,  0x10000 },
-    [IBEX_PWRMGR] =         {  0x400A0000,  0x10000 },
-    [IBEX_RSTMGR] =         {  0x400B0000,  0x10000 },
-    [IBEX_CLKMGR] =         {  0x400C0000,  0x10000 },
-    [IBEX_AES] =            {  0x40110000,  0x10000 },
-    [IBEX_HMAC] =           {  0x40120000,  0x10000 },
-    [IBEX_ALERT_HANDLER] =  {  0x40130000,  0x10000 },
-    [IBEX_NMI_GEN] =        {  0x40140000,  0x10000 },
-    [IBEX_USBDEV] =         {  0x40150000,  0x10000 },
-    [IBEX_PADCTRL] =        {  0x40160000,  0x10000 }
+    [IBEX_DEV_ROM] =            {  0x00008000, 16 * KiB },
+    [IBEX_DEV_RAM] =            {  0x10000000,  0x10000 },
+    [IBEX_DEV_FLASH] =          {  0x20000000,  0x80000 },
+    [IBEX_DEV_UART] =           {  0x40000000,  0x10000 },
+    [IBEX_DEV_GPIO] =           {  0x40010000,  0x10000 },
+    [IBEX_DEV_SPI] =            {  0x40020000,  0x10000 },
+    [IBEX_DEV_FLASH_CTRL] =     {  0x40030000,  0x10000 },
+    [IBEX_DEV_PINMUX] =         {  0x40070000,  0x10000 },
+    [IBEX_DEV_RV_TIMER] =       {  0x40080000,  0x10000 },
+    [IBEX_DEV_PLIC] =           {  0x40090000,  0x10000 },
+    [IBEX_DEV_PWRMGR] =         {  0x400A0000,  0x10000 },
+    [IBEX_DEV_RSTMGR] =         {  0x400B0000,  0x10000 },
+    [IBEX_DEV_CLKMGR] =         {  0x400C0000,  0x10000 },
+    [IBEX_DEV_AES] =            {  0x40110000,  0x10000 },
+    [IBEX_DEV_HMAC] =           {  0x40120000,  0x10000 },
+    [IBEX_DEV_ALERT_HANDLER] =  {  0x40130000,  0x10000 },
+    [IBEX_DEV_NMI_GEN] =        {  0x40140000,  0x10000 },
+    [IBEX_DEV_USBDEV] =         {  0x40150000,  0x10000 },
+    [IBEX_DEV_PADCTRL] =        {  0x40160000,  0x10000 }
 };
 
 static void opentitan_board_init(MachineState *machine)
@@ -66,12 +66,12 @@ static void opentitan_board_init(MachineState *machine)
     qdev_realize(DEVICE(&s->soc), NULL, &error_abort);
 
     memory_region_init_ram(main_mem, NULL, "riscv.lowrisc.ibex.ram",
-        memmap[IBEX_RAM].size, &error_fatal);
+        memmap[IBEX_DEV_RAM].size, &error_fatal);
     memory_region_add_subregion(sys_mem,
-        memmap[IBEX_RAM].base, main_mem);
+        memmap[IBEX_DEV_RAM].base, main_mem);
 
     if (machine->firmware) {
-        riscv_load_firmware(machine->firmware, memmap[IBEX_RAM].base, NULL);
+        riscv_load_firmware(machine->firmware, memmap[IBEX_DEV_RAM].base, NULL);
     }
 
     if (machine->kernel_filename) {
@@ -115,28 +115,28 @@ static void lowrisc_ibex_soc_realize(DeviceState *dev_soc, Error **errp)
 
     /* Boot ROM */
     memory_region_init_rom(&s->rom, OBJECT(dev_soc), "riscv.lowrisc.ibex.rom",
-                           memmap[IBEX_ROM].size, &error_fatal);
+                           memmap[IBEX_DEV_ROM].size, &error_fatal);
     memory_region_add_subregion(sys_mem,
-        memmap[IBEX_ROM].base, &s->rom);
+        memmap[IBEX_DEV_ROM].base, &s->rom);
 
     /* Flash memory */
     memory_region_init_rom(&s->flash_mem, OBJECT(dev_soc), "riscv.lowrisc.ibex.flash",
-                           memmap[IBEX_FLASH].size, &error_fatal);
-    memory_region_add_subregion(sys_mem, memmap[IBEX_FLASH].base,
+                           memmap[IBEX_DEV_FLASH].size, &error_fatal);
+    memory_region_add_subregion(sys_mem, memmap[IBEX_DEV_FLASH].base,
                                 &s->flash_mem);
 
     /* PLIC */
     if (!sysbus_realize(SYS_BUS_DEVICE(&s->plic), errp)) {
         return;
     }
-    sysbus_mmio_map(SYS_BUS_DEVICE(&s->plic), 0, memmap[IBEX_PLIC].base);
+    sysbus_mmio_map(SYS_BUS_DEVICE(&s->plic), 0, memmap[IBEX_DEV_PLIC].base);
 
     /* UART */
     qdev_prop_set_chr(DEVICE(&(s->uart)), "chardev", serial_hd(0));
     if (!sysbus_realize(SYS_BUS_DEVICE(&s->uart), errp)) {
         return;
     }
-    sysbus_mmio_map(SYS_BUS_DEVICE(&s->uart), 0, memmap[IBEX_UART].base);
+    sysbus_mmio_map(SYS_BUS_DEVICE(&s->uart), 0, memmap[IBEX_DEV_UART].base);
     sysbus_connect_irq(SYS_BUS_DEVICE(&s->uart),
                        0, qdev_get_gpio_in(DEVICE(&s->plic),
                        IBEX_UART_TX_WATERMARK_IRQ));
@@ -151,33 +151,33 @@ static void lowrisc_ibex_soc_realize(DeviceState *dev_soc, Error **errp)
                        IBEX_UART_RX_OVERFLOW_IRQ));
 
     create_unimplemented_device("riscv.lowrisc.ibex.gpio",
-        memmap[IBEX_GPIO].base, memmap[IBEX_GPIO].size);
+        memmap[IBEX_DEV_GPIO].base, memmap[IBEX_DEV_GPIO].size);
     create_unimplemented_device("riscv.lowrisc.ibex.spi",
-        memmap[IBEX_SPI].base, memmap[IBEX_SPI].size);
+        memmap[IBEX_DEV_SPI].base, memmap[IBEX_DEV_SPI].size);
     create_unimplemented_device("riscv.lowrisc.ibex.flash_ctrl",
-        memmap[IBEX_FLASH_CTRL].base, memmap[IBEX_FLASH_CTRL].size);
+        memmap[IBEX_DEV_FLASH_CTRL].base, memmap[IBEX_DEV_FLASH_CTRL].size);
     create_unimplemented_device("riscv.lowrisc.ibex.rv_timer",
-        memmap[IBEX_RV_TIMER].base, memmap[IBEX_RV_TIMER].size);
+        memmap[IBEX_DEV_RV_TIMER].base, memmap[IBEX_DEV_RV_TIMER].size);
     create_unimplemented_device("riscv.lowrisc.ibex.pwrmgr",
-        memmap[IBEX_PWRMGR].base, memmap[IBEX_PWRMGR].size);
+        memmap[IBEX_DEV_PWRMGR].base, memmap[IBEX_DEV_PWRMGR].size);
     create_unimplemented_device("riscv.lowrisc.ibex.rstmgr",
-        memmap[IBEX_RSTMGR].base, memmap[IBEX_RSTMGR].size);
+        memmap[IBEX_DEV_RSTMGR].base, memmap[IBEX_DEV_RSTMGR].size);
     create_unimplemented_device("riscv.lowrisc.ibex.clkmgr",
-        memmap[IBEX_CLKMGR].base, memmap[IBEX_CLKMGR].size);
+        memmap[IBEX_DEV_CLKMGR].base, memmap[IBEX_DEV_CLKMGR].size);
     create_unimplemented_device("riscv.lowrisc.ibex.aes",
-        memmap[IBEX_AES].base, memmap[IBEX_AES].size);
+        memmap[IBEX_DEV_AES].base, memmap[IBEX_DEV_AES].size);
     create_unimplemented_device("riscv.lowrisc.ibex.hmac",
-        memmap[IBEX_HMAC].base, memmap[IBEX_HMAC].size);
+        memmap[IBEX_DEV_HMAC].base, memmap[IBEX_DEV_HMAC].size);
     create_unimplemented_device("riscv.lowrisc.ibex.pinmux",
-        memmap[IBEX_PINMUX].base, memmap[IBEX_PINMUX].size);
+        memmap[IBEX_DEV_PINMUX].base, memmap[IBEX_DEV_PINMUX].size);
     create_unimplemented_device("riscv.lowrisc.ibex.alert_handler",
-        memmap[IBEX_ALERT_HANDLER].base, memmap[IBEX_ALERT_HANDLER].size);
+        memmap[IBEX_DEV_ALERT_HANDLER].base, memmap[IBEX_DEV_ALERT_HANDLER].size);
     create_unimplemented_device("riscv.lowrisc.ibex.nmi_gen",
-        memmap[IBEX_NMI_GEN].base, memmap[IBEX_NMI_GEN].size);
+        memmap[IBEX_DEV_NMI_GEN].base, memmap[IBEX_DEV_NMI_GEN].size);
     create_unimplemented_device("riscv.lowrisc.ibex.usbdev",
-        memmap[IBEX_USBDEV].base, memmap[IBEX_USBDEV].size);
+        memmap[IBEX_DEV_USBDEV].base, memmap[IBEX_DEV_USBDEV].size);
     create_unimplemented_device("riscv.lowrisc.ibex.padctrl",
-        memmap[IBEX_PADCTRL].base, memmap[IBEX_PADCTRL].size);
+        memmap[IBEX_DEV_PADCTRL].base, memmap[IBEX_DEV_PADCTRL].size);
 }
 
 static void lowrisc_ibex_soc_class_init(ObjectClass *oc, void *data)
--

2.26.2

#21 lore raw

Re: [PATCH 08/41] opentitan: Rename memmap enum constants

In reply to Eduardo Habkost
Quoted 49 lines · Eduardo Habkost

Some of the enum constant names conflict with the QOM type check macros. This needs to be addressed to allow us to transform the QOM type check macros into functions generated by OBJECT_DECLARE_TYPE().

Rename all the constants to IBEX_DEV_*, to avoid conflicts.

---
 include/hw/riscv/opentitan.h | 38 ++++++++--------
 hw/riscv/opentitan.c         | 84 ++++++++++++++++++------------------
 2 files changed, 61 insertions(+), 61 deletions(-)
include/hw/riscv/opentitan.h +9 -19
index 8f29b9cbbf..835a80f896 100644
@@ -49,25 +49,25 @@ typedef struct OpenTitanState {
 } OpenTitanState;
 
 enum {
-    IBEX_ROM,
-    IBEX_RAM,
-    IBEX_FLASH,
-    IBEX_UART,
-    IBEX_GPIO,
-    IBEX_SPI,
-    IBEX_FLASH_CTRL,
-    IBEX_RV_TIMER,
-    IBEX_AES,
-    IBEX_HMAC,
-    IBEX_PLIC,
-    IBEX_PWRMGR,
-    IBEX_RSTMGR,
-    IBEX_CLKMGR,
-    IBEX_PINMUX,
-    IBEX_ALERT_HANDLER,
-    IBEX_NMI_GEN,
-    IBEX_USBDEV,
-    IBEX_PADCTRL,
+    IBEX_DEV_ROM,
+    IBEX_DEV_RAM,
+    IBEX_DEV_FLASH,
+    IBEX_DEV_UART,
+    IBEX_DEV_GPIO,
+    IBEX_DEV_SPI,
+    IBEX_DEV_FLASH_CTRL,
+    IBEX_DEV_RV_TIMER,
+    IBEX_DEV_AES,

include/hw/riscv/opentitan.h typedef struct OpenTitanState { · line 70

Quoted 10 lines
include/hw/riscv/opentitan.h +10 -0
+    IBEX_DEV_HMAC,
+    IBEX_DEV_PLIC,
+    IBEX_DEV_PWRMGR,
+    IBEX_DEV_RSTMGR,
+    IBEX_DEV_CLKMGR,
+    IBEX_DEV_PINMUX,
+    IBEX_DEV_ALERT_HANDLER,
+    IBEX_DEV_NMI_GEN,
+    IBEX_DEV_USBDEV,
+    IBEX_DEV_PADCTRL,

Similarly, why is this enum in a public header and not local to opentitan.c, only place where it is used?

Quoted 152 lines
include/hw/riscv/opentitan.h +0 -0
 };
 
 enum {
hw/riscv/opentitan.c +42 -42
index a8f0039e51..23ba3b4bfc 100644
@@ -32,25 +32,25 @@ static const struct MemmapEntry {
     hwaddr base;
     hwaddr size;
 } ibex_memmap[] = {
-    [IBEX_ROM] =            {  0x00008000, 16 * KiB },
-    [IBEX_RAM] =            {  0x10000000,  0x10000 },
-    [IBEX_FLASH] =          {  0x20000000,  0x80000 },
-    [IBEX_UART] =           {  0x40000000,  0x10000 },
-    [IBEX_GPIO] =           {  0x40010000,  0x10000 },
-    [IBEX_SPI] =            {  0x40020000,  0x10000 },
-    [IBEX_FLASH_CTRL] =     {  0x40030000,  0x10000 },
-    [IBEX_PINMUX] =         {  0x40070000,  0x10000 },
-    [IBEX_RV_TIMER] =       {  0x40080000,  0x10000 },
-    [IBEX_PLIC] =           {  0x40090000,  0x10000 },
-    [IBEX_PWRMGR] =         {  0x400A0000,  0x10000 },
-    [IBEX_RSTMGR] =         {  0x400B0000,  0x10000 },
-    [IBEX_CLKMGR] =         {  0x400C0000,  0x10000 },
-    [IBEX_AES] =            {  0x40110000,  0x10000 },
-    [IBEX_HMAC] =           {  0x40120000,  0x10000 },
-    [IBEX_ALERT_HANDLER] =  {  0x40130000,  0x10000 },
-    [IBEX_NMI_GEN] =        {  0x40140000,  0x10000 },
-    [IBEX_USBDEV] =         {  0x40150000,  0x10000 },
-    [IBEX_PADCTRL] =        {  0x40160000,  0x10000 }
+    [IBEX_DEV_ROM] =            {  0x00008000, 16 * KiB },
+    [IBEX_DEV_RAM] =            {  0x10000000,  0x10000 },
+    [IBEX_DEV_FLASH] =          {  0x20000000,  0x80000 },
+    [IBEX_DEV_UART] =           {  0x40000000,  0x10000 },
+    [IBEX_DEV_GPIO] =           {  0x40010000,  0x10000 },
+    [IBEX_DEV_SPI] =            {  0x40020000,  0x10000 },
+    [IBEX_DEV_FLASH_CTRL] =     {  0x40030000,  0x10000 },
+    [IBEX_DEV_PINMUX] =         {  0x40070000,  0x10000 },
+    [IBEX_DEV_RV_TIMER] =       {  0x40080000,  0x10000 },
+    [IBEX_DEV_PLIC] =           {  0x40090000,  0x10000 },
+    [IBEX_DEV_PWRMGR] =         {  0x400A0000,  0x10000 },
+    [IBEX_DEV_RSTMGR] =         {  0x400B0000,  0x10000 },
+    [IBEX_DEV_CLKMGR] =         {  0x400C0000,  0x10000 },
+    [IBEX_DEV_AES] =            {  0x40110000,  0x10000 },
+    [IBEX_DEV_HMAC] =           {  0x40120000,  0x10000 },
+    [IBEX_DEV_ALERT_HANDLER] =  {  0x40130000,  0x10000 },
+    [IBEX_DEV_NMI_GEN] =        {  0x40140000,  0x10000 },
+    [IBEX_DEV_USBDEV] =         {  0x40150000,  0x10000 },
+    [IBEX_DEV_PADCTRL] =        {  0x40160000,  0x10000 }
 };
 
 static void opentitan_board_init(MachineState *machine)
@@ -66,12 +66,12 @@ static void opentitan_board_init(MachineState *machine)
     qdev_realize(DEVICE(&s->soc), NULL, &error_abort);
 
     memory_region_init_ram(main_mem, NULL, "riscv.lowrisc.ibex.ram",
-        memmap[IBEX_RAM].size, &error_fatal);
+        memmap[IBEX_DEV_RAM].size, &error_fatal);
     memory_region_add_subregion(sys_mem,
-        memmap[IBEX_RAM].base, main_mem);
+        memmap[IBEX_DEV_RAM].base, main_mem);
 
     if (machine->firmware) {
-        riscv_load_firmware(machine->firmware, memmap[IBEX_RAM].base, NULL);
+        riscv_load_firmware(machine->firmware, memmap[IBEX_DEV_RAM].base, NULL);
     }
 
     if (machine->kernel_filename) {
@@ -115,28 +115,28 @@ static void lowrisc_ibex_soc_realize(DeviceState *dev_soc, Error **errp)
 
     /* Boot ROM */
     memory_region_init_rom(&s->rom, OBJECT(dev_soc), "riscv.lowrisc.ibex.rom",
-                           memmap[IBEX_ROM].size, &error_fatal);
+                           memmap[IBEX_DEV_ROM].size, &error_fatal);
     memory_region_add_subregion(sys_mem,
-        memmap[IBEX_ROM].base, &s->rom);
+        memmap[IBEX_DEV_ROM].base, &s->rom);
 
     /* Flash memory */
     memory_region_init_rom(&s->flash_mem, OBJECT(dev_soc), "riscv.lowrisc.ibex.flash",
-                           memmap[IBEX_FLASH].size, &error_fatal);
-    memory_region_add_subregion(sys_mem, memmap[IBEX_FLASH].base,
+                           memmap[IBEX_DEV_FLASH].size, &error_fatal);
+    memory_region_add_subregion(sys_mem, memmap[IBEX_DEV_FLASH].base,
                                 &s->flash_mem);
 
     /* PLIC */
     if (!sysbus_realize(SYS_BUS_DEVICE(&s->plic), errp)) {
         return;
     }
-    sysbus_mmio_map(SYS_BUS_DEVICE(&s->plic), 0, memmap[IBEX_PLIC].base);
+    sysbus_mmio_map(SYS_BUS_DEVICE(&s->plic), 0, memmap[IBEX_DEV_PLIC].base);
 
     /* UART */
     qdev_prop_set_chr(DEVICE(&(s->uart)), "chardev", serial_hd(0));
     if (!sysbus_realize(SYS_BUS_DEVICE(&s->uart), errp)) {
         return;
     }
-    sysbus_mmio_map(SYS_BUS_DEVICE(&s->uart), 0, memmap[IBEX_UART].base);
+    sysbus_mmio_map(SYS_BUS_DEVICE(&s->uart), 0, memmap[IBEX_DEV_UART].base);
     sysbus_connect_irq(SYS_BUS_DEVICE(&s->uart),
                        0, qdev_get_gpio_in(DEVICE(&s->plic),
                        IBEX_UART_TX_WATERMARK_IRQ));
@@ -151,33 +151,33 @@ static void lowrisc_ibex_soc_realize(DeviceState *dev_soc, Error **errp)
                        IBEX_UART_RX_OVERFLOW_IRQ));
 
     create_unimplemented_device("riscv.lowrisc.ibex.gpio",
-        memmap[IBEX_GPIO].base, memmap[IBEX_GPIO].size);
+        memmap[IBEX_DEV_GPIO].base, memmap[IBEX_DEV_GPIO].size);
     create_unimplemented_device("riscv.lowrisc.ibex.spi",
-        memmap[IBEX_SPI].base, memmap[IBEX_SPI].size);
+        memmap[IBEX_DEV_SPI].base, memmap[IBEX_DEV_SPI].size);
     create_unimplemented_device("riscv.lowrisc.ibex.flash_ctrl",
-        memmap[IBEX_FLASH_CTRL].base, memmap[IBEX_FLASH_CTRL].size);
+        memmap[IBEX_DEV_FLASH_CTRL].base, memmap[IBEX_DEV_FLASH_CTRL].size);
     create_unimplemented_device("riscv.lowrisc.ibex.rv_timer",
-        memmap[IBEX_RV_TIMER].base, memmap[IBEX_RV_TIMER].size);
+        memmap[IBEX_DEV_RV_TIMER].base, memmap[IBEX_DEV_RV_TIMER].size);
     create_unimplemented_device("riscv.lowrisc.ibex.pwrmgr",
-        memmap[IBEX_PWRMGR].base, memmap[IBEX_PWRMGR].size);
+        memmap[IBEX_DEV_PWRMGR].base, memmap[IBEX_DEV_PWRMGR].size);
     create_unimplemented_device("riscv.lowrisc.ibex.rstmgr",
-        memmap[IBEX_RSTMGR].base, memmap[IBEX_RSTMGR].size);
+        memmap[IBEX_DEV_RSTMGR].base, memmap[IBEX_DEV_RSTMGR].size);
     create_unimplemented_device("riscv.lowrisc.ibex.clkmgr",
-        memmap[IBEX_CLKMGR].base, memmap[IBEX_CLKMGR].size);
+        memmap[IBEX_DEV_CLKMGR].base, memmap[IBEX_DEV_CLKMGR].size);
     create_unimplemented_device("riscv.lowrisc.ibex.aes",
-        memmap[IBEX_AES].base, memmap[IBEX_AES].size);
+        memmap[IBEX_DEV_AES].base, memmap[IBEX_DEV_AES].size);
     create_unimplemented_device("riscv.lowrisc.ibex.hmac",
-        memmap[IBEX_HMAC].base, memmap[IBEX_HMAC].size);
+        memmap[IBEX_DEV_HMAC].base, memmap[IBEX_DEV_HMAC].size);
     create_unimplemented_device("riscv.lowrisc.ibex.pinmux",
-        memmap[IBEX_PINMUX].base, memmap[IBEX_PINMUX].size);
+        memmap[IBEX_DEV_PINMUX].base, memmap[IBEX_DEV_PINMUX].size);
     create_unimplemented_device("riscv.lowrisc.ibex.alert_handler",
-        memmap[IBEX_ALERT_HANDLER].base, memmap[IBEX_ALERT_HANDLER].size);
+        memmap[IBEX_DEV_ALERT_HANDLER].base, memmap[IBEX_DEV_ALERT_HANDLER].size);
     create_unimplemented_device("riscv.lowrisc.ibex.nmi_gen",
-        memmap[IBEX_NMI_GEN].base, memmap[IBEX_NMI_GEN].size);
+        memmap[IBEX_DEV_NMI_GEN].base, memmap[IBEX_DEV_NMI_GEN].size);
     create_unimplemented_device("riscv.lowrisc.ibex.usbdev",
-        memmap[IBEX_USBDEV].base, memmap[IBEX_USBDEV].size);
+        memmap[IBEX_DEV_USBDEV].base, memmap[IBEX_DEV_USBDEV].size);
     create_unimplemented_device("riscv.lowrisc.ibex.padctrl",
-        memmap[IBEX_PADCTRL].base, memmap[IBEX_PADCTRL].size);
+        memmap[IBEX_DEV_PADCTRL].base, memmap[IBEX_DEV_PADCTRL].size);
 }
 
 static void lowrisc_ibex_soc_class_init(ObjectClass *oc, void *data)
#22 lore raw

Re: [PATCH 08/41] opentitan: Rename memmap enum constants

Quoted 56 lines · Philippe Mathieu-Daudé
Quoted 54 lines · Eduardo Habkost

Some of the enum constant names conflict with the QOM type check macros. This needs to be addressed to allow us to transform the QOM type check macros into functions generated by OBJECT_DECLARE_TYPE().

Rename all the constants to IBEX_DEV_*, to avoid conflicts.

---
 include/hw/riscv/opentitan.h | 38 ++++++++--------
 hw/riscv/opentitan.c         | 84 ++++++++++++++++++------------------
 2 files changed, 61 insertions(+), 61 deletions(-)
include/hw/riscv/opentitan.h +14 -19
index 8f29b9cbbf..835a80f896 100644
@@ -49,25 +49,25 @@ typedef struct OpenTitanState {
 } OpenTitanState;
 
 enum {
-    IBEX_ROM,
-    IBEX_RAM,
-    IBEX_FLASH,
-    IBEX_UART,
-    IBEX_GPIO,
-    IBEX_SPI,
-    IBEX_FLASH_CTRL,
-    IBEX_RV_TIMER,
-    IBEX_AES,
-    IBEX_HMAC,
-    IBEX_PLIC,
-    IBEX_PWRMGR,
-    IBEX_RSTMGR,
-    IBEX_CLKMGR,
-    IBEX_PINMUX,
-    IBEX_ALERT_HANDLER,
-    IBEX_NMI_GEN,
-    IBEX_USBDEV,
-    IBEX_PADCTRL,
+    IBEX_DEV_ROM,
+    IBEX_DEV_RAM,
+    IBEX_DEV_FLASH,
+    IBEX_DEV_UART,
+    IBEX_DEV_GPIO,
+    IBEX_DEV_SPI,
+    IBEX_DEV_FLASH_CTRL,
+    IBEX_DEV_RV_TIMER,
+    IBEX_DEV_AES,
+    IBEX_DEV_HMAC,
+    IBEX_DEV_PLIC,
+    IBEX_DEV_PWRMGR,
+    IBEX_DEV_RSTMGR,
+    IBEX_DEV_CLKMGR,
Quoted 9 lines

include/hw/riscv/opentitan.h typedef struct OpenTitanState { · line 70

Quoted 5 lines
include/hw/riscv/opentitan.h +5 -0
+    IBEX_DEV_PINMUX,
+    IBEX_DEV_ALERT_HANDLER,
+    IBEX_DEV_NMI_GEN,
+    IBEX_DEV_USBDEV,
+    IBEX_DEV_PADCTRL,

Similarly, why is this enum in a public header and not local to opentitan.c, only place where it is used?

I believe the reason is that opentitan.c implements both SoC and board stuff. These enums are helpful to define SoC peripherals hence technically another board that uses the same SoC may utilize these macros.

Unfortunately this is the case for all RISC-V boards so far. Should we clean this up, for example, splitting SoC and board codes into 2 files?

Regards,
Bin

#23 lore raw

Re: [PATCH 08/41] opentitan: Rename memmap enum constants

Quoted 68 lines · Bin Meng
Quoted 56 lines · Philippe Mathieu-Daudé
Quoted 54 lines · Eduardo Habkost

Some of the enum constant names conflict with the QOM type check macros. This needs to be addressed to allow us to transform the QOM type check macros into functions generated by OBJECT_DECLARE_TYPE().

Rename all the constants to IBEX_DEV_*, to avoid conflicts.

---
 include/hw/riscv/opentitan.h | 38 ++++++++--------
 hw/riscv/opentitan.c         | 84 ++++++++++++++++++------------------
 2 files changed, 61 insertions(+), 61 deletions(-)
include/hw/riscv/opentitan.h +14 -19
index 8f29b9cbbf..835a80f896 100644
@@ -49,25 +49,25 @@ typedef struct OpenTitanState {
 } OpenTitanState;
 
 enum {
-    IBEX_ROM,
-    IBEX_RAM,
-    IBEX_FLASH,
-    IBEX_UART,
-    IBEX_GPIO,
-    IBEX_SPI,
-    IBEX_FLASH_CTRL,
-    IBEX_RV_TIMER,
-    IBEX_AES,
-    IBEX_HMAC,
-    IBEX_PLIC,
-    IBEX_PWRMGR,
-    IBEX_RSTMGR,
-    IBEX_CLKMGR,
-    IBEX_PINMUX,
-    IBEX_ALERT_HANDLER,
-    IBEX_NMI_GEN,
-    IBEX_USBDEV,
-    IBEX_PADCTRL,
+    IBEX_DEV_ROM,
+    IBEX_DEV_RAM,
+    IBEX_DEV_FLASH,
+    IBEX_DEV_UART,
+    IBEX_DEV_GPIO,
+    IBEX_DEV_SPI,
+    IBEX_DEV_FLASH_CTRL,
+    IBEX_DEV_RV_TIMER,
+    IBEX_DEV_AES,
+    IBEX_DEV_HMAC,
+    IBEX_DEV_PLIC,
+    IBEX_DEV_PWRMGR,
+    IBEX_DEV_RSTMGR,
+    IBEX_DEV_CLKMGR,
Quoted 9 lines

include/hw/riscv/opentitan.h typedef struct OpenTitanState { · line 70

Quoted 5 lines
include/hw/riscv/opentitan.h +5 -0
+    IBEX_DEV_PINMUX,
+    IBEX_DEV_ALERT_HANDLER,
+    IBEX_DEV_NMI_GEN,
+    IBEX_DEV_USBDEV,
+    IBEX_DEV_PADCTRL,

Similarly, why is this enum in a public header and not local to opentitan.c, only place where it is used?

Quoted 8 lines

I believe the reason is that opentitan.c implements both SoC and board stuff. These enums are helpful to define SoC peripherals hence technically another board that uses the same SoC may utilize these macros.

Unfortunately this is the case for all RISC-V boards so far. Should we clean this up, for example, splitting SoC and board codes into 2 files?

Yeah the hw/riscv directory is a bit of a mess. We need to look at moving non machine parts out (like sifive_uart for example) and then it's probably worth splitting SoC and machine. It does result in some extra files (some of which are very simple) but the current setup is pretty confusing.

Are you volunteering Bin? Otherwise I can look at it.

Alistair

Quoted 4 lines

Regards,
Bin

#24 lore raw

Re: [PATCH 08/41] opentitan: Rename memmap enum constants

Hi Alistair,

Quoted 79 lines · Alistair Francis
Quoted 68 lines · Bin Meng
Quoted 56 lines · Philippe Mathieu-Daudé
Quoted 54 lines · Eduardo Habkost

Some of the enum constant names conflict with the QOM type check macros. This needs to be addressed to allow us to transform the QOM type check macros into functions generated by OBJECT_DECLARE_TYPE().

Rename all the constants to IBEX_DEV_*, to avoid conflicts.

---
 include/hw/riscv/opentitan.h | 38 ++++++++--------
 hw/riscv/opentitan.c         | 84 ++++++++++++++++++------------------
 2 files changed, 61 insertions(+), 61 deletions(-)
include/hw/riscv/opentitan.h +14 -19
index 8f29b9cbbf..835a80f896 100644
@@ -49,25 +49,25 @@ typedef struct OpenTitanState {
 } OpenTitanState;
 
 enum {
-    IBEX_ROM,
-    IBEX_RAM,
-    IBEX_FLASH,
-    IBEX_UART,
-    IBEX_GPIO,
-    IBEX_SPI,
-    IBEX_FLASH_CTRL,
-    IBEX_RV_TIMER,
-    IBEX_AES,
-    IBEX_HMAC,
-    IBEX_PLIC,
-    IBEX_PWRMGR,
-    IBEX_RSTMGR,
-    IBEX_CLKMGR,
-    IBEX_PINMUX,
-    IBEX_ALERT_HANDLER,
-    IBEX_NMI_GEN,
-    IBEX_USBDEV,
-    IBEX_PADCTRL,
+    IBEX_DEV_ROM,
+    IBEX_DEV_RAM,
+    IBEX_DEV_FLASH,
+    IBEX_DEV_UART,
+    IBEX_DEV_GPIO,
+    IBEX_DEV_SPI,
+    IBEX_DEV_FLASH_CTRL,
+    IBEX_DEV_RV_TIMER,
+    IBEX_DEV_AES,
+    IBEX_DEV_HMAC,
+    IBEX_DEV_PLIC,
+    IBEX_DEV_PWRMGR,
+    IBEX_DEV_RSTMGR,
+    IBEX_DEV_CLKMGR,
Quoted 9 lines

include/hw/riscv/opentitan.h typedef struct OpenTitanState { · line 70

Quoted 5 lines
include/hw/riscv/opentitan.h +5 -0
+    IBEX_DEV_PINMUX,
+    IBEX_DEV_ALERT_HANDLER,
+    IBEX_DEV_NMI_GEN,
+    IBEX_DEV_USBDEV,
+    IBEX_DEV_PADCTRL,

Similarly, why is this enum in a public header and not local to opentitan.c, only place where it is used?

Quoted 8 lines

I believe the reason is that opentitan.c implements both SoC and board stuff. These enums are helpful to define SoC peripherals hence technically another board that uses the same SoC may utilize these macros.

Unfortunately this is the case for all RISC-V boards so far. Should we clean this up, for example, splitting SoC and board codes into 2 files?

Quoted 8 lines

Yeah the hw/riscv directory is a bit of a mess. We need to look at moving non machine parts out (like sifive_uart for example) and then it's probably worth splitting SoC and machine. It does result in some extra files (some of which are very simple) but the current setup is pretty confusing.

Are you volunteering Bin? Otherwise I can look at it.

Yes, I will be working on a series to clean hw/riscv directory.

Regards,
Bin

#25 lore raw

PATCH 9/41 sifive_e: Rename memmap enum constants

In reply to Eduardo Habkost

Some of the enum constant names conflict with the QOM type check macros. This needs to be addressed to allow us to transform the QOM type check macros into functions generated by OBJECT_DECLARE_TYPE().

Rename all the constants to SIFIVE_E_DEV_*, to avoid conflicts.

---
 include/hw/riscv/sifive_e.h | 38 ++++++++---------
 hw/riscv/sifive_e.c         | 82 ++++++++++++++++++-------------------
 2 files changed, 60 insertions(+), 60 deletions(-)
include/hw/riscv/sifive_e.h +19 -19
index 637414130b..7c2eb70189 100644
@@ -53,25 +53,25 @@ typedef struct SiFiveEState {
     OBJECT_CHECK(SiFiveEState, (obj), TYPE_RISCV_E_MACHINE)
 
 enum {
-    SIFIVE_E_DEBUG,
-    SIFIVE_E_MROM,
-    SIFIVE_E_OTP,
-    SIFIVE_E_CLINT,
-    SIFIVE_E_PLIC,
-    SIFIVE_E_AON,
-    SIFIVE_E_PRCI,
-    SIFIVE_E_OTP_CTRL,
-    SIFIVE_E_GPIO0,
-    SIFIVE_E_UART0,
-    SIFIVE_E_QSPI0,
-    SIFIVE_E_PWM0,
-    SIFIVE_E_UART1,
-    SIFIVE_E_QSPI1,
-    SIFIVE_E_PWM1,
-    SIFIVE_E_QSPI2,
-    SIFIVE_E_PWM2,
-    SIFIVE_E_XIP,
-    SIFIVE_E_DTIM
+    SIFIVE_E_DEV_DEBUG,
+    SIFIVE_E_DEV_MROM,
+    SIFIVE_E_DEV_OTP,
+    SIFIVE_E_DEV_CLINT,
+    SIFIVE_E_DEV_PLIC,
+    SIFIVE_E_DEV_AON,
+    SIFIVE_E_DEV_PRCI,
+    SIFIVE_E_DEV_OTP_CTRL,
+    SIFIVE_E_DEV_GPIO0,
+    SIFIVE_E_DEV_UART0,
+    SIFIVE_E_DEV_QSPI0,
+    SIFIVE_E_DEV_PWM0,
+    SIFIVE_E_DEV_UART1,
+    SIFIVE_E_DEV_QSPI1,
+    SIFIVE_E_DEV_PWM1,
+    SIFIVE_E_DEV_QSPI2,
+    SIFIVE_E_DEV_PWM2,
+    SIFIVE_E_DEV_XIP,
+    SIFIVE_E_DEV_DTIM
 };
 
 enum {
hw/riscv/sifive_e.c +41 -41

141 lines not on this page · raw message

Signature · 1 line
2.26.2
Reviewed-by on v1 9/41
#26 lore raw

Re: [PATCH 09/41] sifive_e: Rename memmap enum constants

Quoted 9 lines · Eduardo Habkost

Some of the enum constant names conflict with the QOM type check macros. This needs to be addressed to allow us to transform the QOM type check macros into functions generated by OBJECT_DECLARE_TYPE().

Rename all the constants to SIFIVE_E_DEV_*, to avoid conflicts.

Alistair

Quoted 210 lines
---
 include/hw/riscv/sifive_e.h | 38 ++++++++---------
 hw/riscv/sifive_e.c         | 82 ++++++++++++++++++-------------------
 2 files changed, 60 insertions(+), 60 deletions(-)
include/hw/riscv/sifive_e.h +19 -19
index 637414130b..7c2eb70189 100644
@@ -53,25 +53,25 @@ typedef struct SiFiveEState {
     OBJECT_CHECK(SiFiveEState, (obj), TYPE_RISCV_E_MACHINE)
 
 enum {
-    SIFIVE_E_DEBUG,
-    SIFIVE_E_MROM,
-    SIFIVE_E_OTP,
-    SIFIVE_E_CLINT,
-    SIFIVE_E_PLIC,
-    SIFIVE_E_AON,
-    SIFIVE_E_PRCI,
-    SIFIVE_E_OTP_CTRL,
-    SIFIVE_E_GPIO0,
-    SIFIVE_E_UART0,
-    SIFIVE_E_QSPI0,
-    SIFIVE_E_PWM0,
-    SIFIVE_E_UART1,
-    SIFIVE_E_QSPI1,
-    SIFIVE_E_PWM1,
-    SIFIVE_E_QSPI2,
-    SIFIVE_E_PWM2,
-    SIFIVE_E_XIP,
-    SIFIVE_E_DTIM
+    SIFIVE_E_DEV_DEBUG,
+    SIFIVE_E_DEV_MROM,
+    SIFIVE_E_DEV_OTP,
+    SIFIVE_E_DEV_CLINT,
+    SIFIVE_E_DEV_PLIC,
+    SIFIVE_E_DEV_AON,
+    SIFIVE_E_DEV_PRCI,
+    SIFIVE_E_DEV_OTP_CTRL,
+    SIFIVE_E_DEV_GPIO0,
+    SIFIVE_E_DEV_UART0,
+    SIFIVE_E_DEV_QSPI0,
+    SIFIVE_E_DEV_PWM0,
+    SIFIVE_E_DEV_UART1,
+    SIFIVE_E_DEV_QSPI1,
+    SIFIVE_E_DEV_PWM1,
+    SIFIVE_E_DEV_QSPI2,
+    SIFIVE_E_DEV_PWM2,
+    SIFIVE_E_DEV_XIP,
+    SIFIVE_E_DEV_DTIM
 };
 
 enum {
hw/riscv/sifive_e.c +41 -42
index c8b060486a..88b4524117 100644
@@ -54,25 +54,25 @@ static const struct MemmapEntry {
     hwaddr base;
     hwaddr size;
 } sifive_e_memmap[] = {
-    [SIFIVE_E_DEBUG] =    {        0x0,     0x1000 },
-    [SIFIVE_E_MROM] =     {     0x1000,     0x2000 },
-    [SIFIVE_E_OTP] =      {    0x20000,     0x2000 },
-    [SIFIVE_E_CLINT] =    {  0x2000000,    0x10000 },
-    [SIFIVE_E_PLIC] =     {  0xc000000,  0x4000000 },
-    [SIFIVE_E_AON] =      { 0x10000000,     0x8000 },
-    [SIFIVE_E_PRCI] =     { 0x10008000,     0x8000 },
-    [SIFIVE_E_OTP_CTRL] = { 0x10010000,     0x1000 },
-    [SIFIVE_E_GPIO0] =    { 0x10012000,     0x1000 },
-    [SIFIVE_E_UART0] =    { 0x10013000,     0x1000 },
-    [SIFIVE_E_QSPI0] =    { 0x10014000,     0x1000 },
-    [SIFIVE_E_PWM0] =     { 0x10015000,     0x1000 },
-    [SIFIVE_E_UART1] =    { 0x10023000,     0x1000 },
-    [SIFIVE_E_QSPI1] =    { 0x10024000,     0x1000 },
-    [SIFIVE_E_PWM1] =     { 0x10025000,     0x1000 },
-    [SIFIVE_E_QSPI2] =    { 0x10034000,     0x1000 },
-    [SIFIVE_E_PWM2] =     { 0x10035000,     0x1000 },
-    [SIFIVE_E_XIP] =      { 0x20000000, 0x20000000 },
-    [SIFIVE_E_DTIM] =     { 0x80000000,     0x4000 }
+    [SIFIVE_E_DEV_DEBUG] =    {        0x0,     0x1000 },
+    [SIFIVE_E_DEV_MROM] =     {     0x1000,     0x2000 },
+    [SIFIVE_E_DEV_OTP] =      {    0x20000,     0x2000 },
+    [SIFIVE_E_DEV_CLINT] =    {  0x2000000,    0x10000 },
+    [SIFIVE_E_DEV_PLIC] =     {  0xc000000,  0x4000000 },
+    [SIFIVE_E_DEV_AON] =      { 0x10000000,     0x8000 },
+    [SIFIVE_E_DEV_PRCI] =     { 0x10008000,     0x8000 },
+    [SIFIVE_E_DEV_OTP_CTRL] = { 0x10010000,     0x1000 },
+    [SIFIVE_E_DEV_GPIO0] =    { 0x10012000,     0x1000 },
+    [SIFIVE_E_DEV_UART0] =    { 0x10013000,     0x1000 },
+    [SIFIVE_E_DEV_QSPI0] =    { 0x10014000,     0x1000 },
+    [SIFIVE_E_DEV_PWM0] =     { 0x10015000,     0x1000 },
+    [SIFIVE_E_DEV_UART1] =    { 0x10023000,     0x1000 },
+    [SIFIVE_E_DEV_QSPI1] =    { 0x10024000,     0x1000 },
+    [SIFIVE_E_DEV_PWM1] =     { 0x10025000,     0x1000 },
+    [SIFIVE_E_DEV_QSPI2] =    { 0x10034000,     0x1000 },
+    [SIFIVE_E_DEV_PWM2] =     { 0x10035000,     0x1000 },
+    [SIFIVE_E_DEV_XIP] =      { 0x20000000, 0x20000000 },
+    [SIFIVE_E_DEV_DTIM] =     { 0x80000000,     0x4000 }
 };
 
 static void sifive_e_machine_init(MachineState *machine)
@@ -90,9 +90,9 @@ static void sifive_e_machine_init(MachineState *machine)
 
     /* Data Tightly Integrated Memory */
     memory_region_init_ram(main_mem, NULL, "riscv.sifive.e.ram",
-        memmap[SIFIVE_E_DTIM].size, &error_fatal);
+        memmap[SIFIVE_E_DEV_DTIM].size, &error_fatal);
     memory_region_add_subregion(sys_mem,
-        memmap[SIFIVE_E_DTIM].base, main_mem);
+        memmap[SIFIVE_E_DEV_DTIM].base, main_mem);
 
     /* Mask ROM reset vector */
     uint32_t reset_vec[4];
@@ -111,7 +111,7 @@ static void sifive_e_machine_init(MachineState *machine)
         reset_vec[i] = cpu_to_le32(reset_vec[i]);
     }
     rom_add_blob_fixed_as("mrom.reset", reset_vec, sizeof(reset_vec),
-                          memmap[SIFIVE_E_MROM].base, &address_space_memory);
+                          memmap[SIFIVE_E_DEV_MROM].base, &address_space_memory);
 
     if (machine->kernel_filename) {
         riscv_load_kernel(machine->kernel_filename, NULL);
@@ -194,12 +194,12 @@ static void sifive_e_soc_realize(DeviceState *dev, Error **errp)
 
     /* Mask ROM */
     memory_region_init_rom(&s->mask_rom, OBJECT(dev), "riscv.sifive.e.mrom",
-                           memmap[SIFIVE_E_MROM].size, &error_fatal);
+                           memmap[SIFIVE_E_DEV_MROM].size, &error_fatal);
     memory_region_add_subregion(sys_mem,
-        memmap[SIFIVE_E_MROM].base, &s->mask_rom);
+        memmap[SIFIVE_E_DEV_MROM].base, &s->mask_rom);
 
     /* MMIO */
-    s->plic = sifive_plic_create(memmap[SIFIVE_E_PLIC].base,
+    s->plic = sifive_plic_create(memmap[SIFIVE_E_DEV_PLIC].base,
         (char *)SIFIVE_E_PLIC_HART_CONFIG,
         SIFIVE_E_PLIC_NUM_SOURCES,
         SIFIVE_E_PLIC_NUM_PRIORITIES,
@@ -209,13 +209,13 @@ static void sifive_e_soc_realize(DeviceState *dev, Error **errp)
         SIFIVE_E_PLIC_ENABLE_STRIDE,
         SIFIVE_E_PLIC_CONTEXT_BASE,
         SIFIVE_E_PLIC_CONTEXT_STRIDE,
-        memmap[SIFIVE_E_PLIC].size);
-    sifive_clint_create(memmap[SIFIVE_E_CLINT].base,
-        memmap[SIFIVE_E_CLINT].size, ms->smp.cpus,
+        memmap[SIFIVE_E_DEV_PLIC].size);
+    sifive_clint_create(memmap[SIFIVE_E_DEV_CLINT].base,
+        memmap[SIFIVE_E_DEV_CLINT].size, ms->smp.cpus,
         SIFIVE_SIP_BASE, SIFIVE_TIMECMP_BASE, SIFIVE_TIME_BASE, false);
     create_unimplemented_device("riscv.sifive.e.aon",
-        memmap[SIFIVE_E_AON].base, memmap[SIFIVE_E_AON].size);
-    sifive_e_prci_create(memmap[SIFIVE_E_PRCI].base);
+        memmap[SIFIVE_E_DEV_AON].base, memmap[SIFIVE_E_DEV_AON].size);
+    sifive_e_prci_create(memmap[SIFIVE_E_DEV_PRCI].base);
 
     /* GPIO */
 
@@ -224,7 +224,7 @@ static void sifive_e_soc_realize(DeviceState *dev, Error **errp)
     }
 
     /* Map GPIO registers */
-    sysbus_mmio_map(SYS_BUS_DEVICE(&s->gpio), 0, memmap[SIFIVE_E_GPIO0].base);
+    sysbus_mmio_map(SYS_BUS_DEVICE(&s->gpio), 0, memmap[SIFIVE_E_DEV_GPIO0].base);
 
     /* Pass all GPIOs to the SOC layer so they are available to the board */
     qdev_pass_gpios(DEVICE(&s->gpio), dev, NULL);
@@ -236,27 +236,27 @@ static void sifive_e_soc_realize(DeviceState *dev, Error **errp)
                                             SIFIVE_E_GPIO0_IRQ0 + i));
     }
 
-    sifive_uart_create(sys_mem, memmap[SIFIVE_E_UART0].base,
+    sifive_uart_create(sys_mem, memmap[SIFIVE_E_DEV_UART0].base,
         serial_hd(0), qdev_get_gpio_in(DEVICE(s->plic), SIFIVE_E_UART0_IRQ));
     create_unimplemented_device("riscv.sifive.e.qspi0",
-        memmap[SIFIVE_E_QSPI0].base, memmap[SIFIVE_E_QSPI0].size);
+        memmap[SIFIVE_E_DEV_QSPI0].base, memmap[SIFIVE_E_DEV_QSPI0].size);
     create_unimplemented_device("riscv.sifive.e.pwm0",
-        memmap[SIFIVE_E_PWM0].base, memmap[SIFIVE_E_PWM0].size);
-    sifive_uart_create(sys_mem, memmap[SIFIVE_E_UART1].base,
+        memmap[SIFIVE_E_DEV_PWM0].base, memmap[SIFIVE_E_DEV_PWM0].size);
+    sifive_uart_create(sys_mem, memmap[SIFIVE_E_DEV_UART1].base,
         serial_hd(1), qdev_get_gpio_in(DEVICE(s->plic), SIFIVE_E_UART1_IRQ));
     create_unimplemented_device("riscv.sifive.e.qspi1",
-        memmap[SIFIVE_E_QSPI1].base, memmap[SIFIVE_E_QSPI1].size);
+        memmap[SIFIVE_E_DEV_QSPI1].base, memmap[SIFIVE_E_DEV_QSPI1].size);
     create_unimplemented_device("riscv.sifive.e.pwm1",
-        memmap[SIFIVE_E_PWM1].base, memmap[SIFIVE_E_PWM1].size);
+        memmap[SIFIVE_E_DEV_PWM1].base, memmap[SIFIVE_E_DEV_PWM1].size);
     create_unimplemented_device("riscv.sifive.e.qspi2",
-        memmap[SIFIVE_E_QSPI2].base, memmap[SIFIVE_E_QSPI2].size);
+        memmap[SIFIVE_E_DEV_QSPI2].base, memmap[SIFIVE_E_DEV_QSPI2].size);
     create_unimplemented_device("riscv.sifive.e.pwm2",
-        memmap[SIFIVE_E_PWM2].base, memmap[SIFIVE_E_PWM2].size);
+        memmap[SIFIVE_E_DEV_PWM2].base, memmap[SIFIVE_E_DEV_PWM2].size);
 
     /* Flash memory */
     memory_region_init_rom(&s->xip_mem, OBJECT(dev), "riscv.sifive.e.xip",
-                           memmap[SIFIVE_E_XIP].size, &error_fatal);
-    memory_region_add_subregion(sys_mem, memmap[SIFIVE_E_XIP].base,
+                           memmap[SIFIVE_E_DEV_XIP].size, &error_fatal);
+    memory_region_add_subregion(sys_mem, memmap[SIFIVE_E_DEV_XIP].base,
         &s->xip_mem);
 }
 
--

2.26.2

#27 lore raw

PATCH 10/41 sifive_u: Rename memmap enum constants

In reply to Eduardo Habkost

Some of the enum constant names conflict with the QOM type check macros. This needs to be addressed to allow us to transform the QOM type check macros into functions generated by OBJECT_DECLARE_TYPE().

Rename all the constants to SIFIVE_U_DEV_*, to avoid conflicts.

---
 include/hw/riscv/sifive_u.h |  30 ++++----
 hw/riscv/sifive_u.c         | 136 ++++++++++++++++++------------------
 2 files changed, 83 insertions(+), 83 deletions(-)
include/hw/riscv/sifive_u.h +15 -15
index aba4d0181f..0dab922f3a 100644
@@ -68,21 +68,21 @@ typedef struct SiFiveUState {
 } SiFiveUState;
 
 enum {
-    SIFIVE_U_DEBUG,
-    SIFIVE_U_MROM,
-    SIFIVE_U_CLINT,
-    SIFIVE_U_L2LIM,
-    SIFIVE_U_PLIC,
-    SIFIVE_U_PRCI,
-    SIFIVE_U_UART0,
-    SIFIVE_U_UART1,
-    SIFIVE_U_GPIO,
-    SIFIVE_U_OTP,
-    SIFIVE_U_DMC,
-    SIFIVE_U_FLASH0,
-    SIFIVE_U_DRAM,
-    SIFIVE_U_GEM,
-    SIFIVE_U_GEM_MGMT
+    SIFIVE_U_DEV_DEBUG,
+    SIFIVE_U_DEV_MROM,
+    SIFIVE_U_DEV_CLINT,
+    SIFIVE_U_DEV_L2LIM,
+    SIFIVE_U_DEV_PLIC,
+    SIFIVE_U_DEV_PRCI,
+    SIFIVE_U_DEV_UART0,
+    SIFIVE_U_DEV_UART1,
+    SIFIVE_U_DEV_GPIO,
+    SIFIVE_U_DEV_OTP,
+    SIFIVE_U_DEV_DMC,
+    SIFIVE_U_DEV_FLASH0,
+    SIFIVE_U_DEV_DRAM,
+    SIFIVE_U_DEV_GEM,
+    SIFIVE_U_DEV_GEM_MGMT
 };
 
 enum {
hw/riscv/sifive_u.c +68 -68

324 lines not on this page · raw message

Signature · 1 line
2.26.2
Reviewed-by on v1 10/41
#28 lore raw

Re: [PATCH 10/41] sifive_u: Rename memmap enum constants

Quoted 9 lines · Eduardo Habkost

Some of the enum constant names conflict with the QOM type check macros. This needs to be addressed to allow us to transform the QOM type check macros into functions generated by OBJECT_DECLARE_TYPE().

Rename all the constants to SIFIVE_U_DEV_*, to avoid conflicts.

Alistair

Quoted 398 lines
---
 include/hw/riscv/sifive_u.h |  30 ++++----
 hw/riscv/sifive_u.c         | 136 ++++++++++++++++++------------------
 2 files changed, 83 insertions(+), 83 deletions(-)
include/hw/riscv/sifive_u.h +15 -15
index aba4d0181f..0dab922f3a 100644
@@ -68,21 +68,21 @@ typedef struct SiFiveUState {
 } SiFiveUState;
 
 enum {
-    SIFIVE_U_DEBUG,
-    SIFIVE_U_MROM,
-    SIFIVE_U_CLINT,
-    SIFIVE_U_L2LIM,
-    SIFIVE_U_PLIC,
-    SIFIVE_U_PRCI,
-    SIFIVE_U_UART0,
-    SIFIVE_U_UART1,
-    SIFIVE_U_GPIO,
-    SIFIVE_U_OTP,
-    SIFIVE_U_DMC,
-    SIFIVE_U_FLASH0,
-    SIFIVE_U_DRAM,
-    SIFIVE_U_GEM,
-    SIFIVE_U_GEM_MGMT
+    SIFIVE_U_DEV_DEBUG,
+    SIFIVE_U_DEV_MROM,
+    SIFIVE_U_DEV_CLINT,
+    SIFIVE_U_DEV_L2LIM,
+    SIFIVE_U_DEV_PLIC,
+    SIFIVE_U_DEV_PRCI,
+    SIFIVE_U_DEV_UART0,
+    SIFIVE_U_DEV_UART1,
+    SIFIVE_U_DEV_GPIO,
+    SIFIVE_U_DEV_OTP,
+    SIFIVE_U_DEV_DMC,
+    SIFIVE_U_DEV_FLASH0,
+    SIFIVE_U_DEV_DRAM,
+    SIFIVE_U_DEV_GEM,
+    SIFIVE_U_DEV_GEM_MGMT
 };
 
 enum {
hw/riscv/sifive_u.c +68 -69
index e5682c38a9..0dfbcb5160 100644
@@ -69,21 +69,21 @@ static const struct MemmapEntry {
     hwaddr base;
     hwaddr size;
 } sifive_u_memmap[] = {
-    [SIFIVE_U_DEBUG] =    {        0x0,      0x100 },
-    [SIFIVE_U_MROM] =     {     0x1000,     0xf000 },
-    [SIFIVE_U_CLINT] =    {  0x2000000,    0x10000 },
-    [SIFIVE_U_L2LIM] =    {  0x8000000,  0x2000000 },
-    [SIFIVE_U_PLIC] =     {  0xc000000,  0x4000000 },
-    [SIFIVE_U_PRCI] =     { 0x10000000,     0x1000 },
-    [SIFIVE_U_UART0] =    { 0x10010000,     0x1000 },
-    [SIFIVE_U_UART1] =    { 0x10011000,     0x1000 },
-    [SIFIVE_U_GPIO] =     { 0x10060000,     0x1000 },
-    [SIFIVE_U_OTP] =      { 0x10070000,     0x1000 },
-    [SIFIVE_U_GEM] =      { 0x10090000,     0x2000 },
-    [SIFIVE_U_GEM_MGMT] = { 0x100a0000,     0x1000 },
-    [SIFIVE_U_DMC] =      { 0x100b0000,    0x10000 },
-    [SIFIVE_U_FLASH0] =   { 0x20000000, 0x10000000 },
-    [SIFIVE_U_DRAM] =     { 0x80000000,        0x0 },
+    [SIFIVE_U_DEV_DEBUG] =    {        0x0,      0x100 },
+    [SIFIVE_U_DEV_MROM] =     {     0x1000,     0xf000 },
+    [SIFIVE_U_DEV_CLINT] =    {  0x2000000,    0x10000 },
+    [SIFIVE_U_DEV_L2LIM] =    {  0x8000000,  0x2000000 },
+    [SIFIVE_U_DEV_PLIC] =     {  0xc000000,  0x4000000 },
+    [SIFIVE_U_DEV_PRCI] =     { 0x10000000,     0x1000 },
+    [SIFIVE_U_DEV_UART0] =    { 0x10010000,     0x1000 },
+    [SIFIVE_U_DEV_UART1] =    { 0x10011000,     0x1000 },
+    [SIFIVE_U_DEV_GPIO] =     { 0x10060000,     0x1000 },
+    [SIFIVE_U_DEV_OTP] =      { 0x10070000,     0x1000 },
+    [SIFIVE_U_DEV_GEM] =      { 0x10090000,     0x2000 },
+    [SIFIVE_U_DEV_GEM_MGMT] = { 0x100a0000,     0x1000 },
+    [SIFIVE_U_DEV_DMC] =      { 0x100b0000,    0x10000 },
+    [SIFIVE_U_DEV_FLASH0] =   { 0x20000000, 0x10000000 },
+    [SIFIVE_U_DEV_DRAM] =     { 0x80000000,        0x0 },
 };
 
 #define OTP_SERIAL          1
@@ -142,10 +142,10 @@ static void create_fdt(SiFiveUState *s, const struct MemmapEntry *memmap,
     g_free(nodename);
 
     nodename = g_strdup_printf("/memory@%lx",
-        (long)memmap[SIFIVE_U_DRAM].base);
+        (long)memmap[SIFIVE_U_DEV_DRAM].base);
     qemu_fdt_add_subnode(fdt, nodename);
     qemu_fdt_setprop_cells(fdt, nodename, "reg",
-        memmap[SIFIVE_U_DRAM].base >> 32, memmap[SIFIVE_U_DRAM].base,
+        memmap[SIFIVE_U_DEV_DRAM].base >> 32, memmap[SIFIVE_U_DEV_DRAM].base,
         mem_size >> 32, mem_size);
     qemu_fdt_setprop_string(fdt, nodename, "device_type", "memory");
     g_free(nodename);
@@ -200,39 +200,39 @@ static void create_fdt(SiFiveUState *s, const struct MemmapEntry *memmap,
         g_free(nodename);
     }
     nodename = g_strdup_printf("/soc/clint@%lx",
-        (long)memmap[SIFIVE_U_CLINT].base);
+        (long)memmap[SIFIVE_U_DEV_CLINT].base);
     qemu_fdt_add_subnode(fdt, nodename);
     qemu_fdt_setprop_string(fdt, nodename, "compatible", "riscv,clint0");
     qemu_fdt_setprop_cells(fdt, nodename, "reg",
-        0x0, memmap[SIFIVE_U_CLINT].base,
-        0x0, memmap[SIFIVE_U_CLINT].size);
+        0x0, memmap[SIFIVE_U_DEV_CLINT].base,
+        0x0, memmap[SIFIVE_U_DEV_CLINT].size);
     qemu_fdt_setprop(fdt, nodename, "interrupts-extended",
         cells, ms->smp.cpus * sizeof(uint32_t) * 4);
     g_free(cells);
     g_free(nodename);
 
     nodename = g_strdup_printf("/soc/otp@%lx",
-        (long)memmap[SIFIVE_U_OTP].base);
+        (long)memmap[SIFIVE_U_DEV_OTP].base);
     qemu_fdt_add_subnode(fdt, nodename);
     qemu_fdt_setprop_cell(fdt, nodename, "fuse-count", SIFIVE_U_OTP_REG_SIZE);
     qemu_fdt_setprop_cells(fdt, nodename, "reg",
-        0x0, memmap[SIFIVE_U_OTP].base,
-        0x0, memmap[SIFIVE_U_OTP].size);
+        0x0, memmap[SIFIVE_U_DEV_OTP].base,
+        0x0, memmap[SIFIVE_U_DEV_OTP].size);
     qemu_fdt_setprop_string(fdt, nodename, "compatible",
         "sifive,fu540-c000-otp");
     g_free(nodename);
 
     prci_phandle = phandle++;
     nodename = g_strdup_printf("/soc/clock-controller@%lx",
-        (long)memmap[SIFIVE_U_PRCI].base);
+        (long)memmap[SIFIVE_U_DEV_PRCI].base);
     qemu_fdt_add_subnode(fdt, nodename);
     qemu_fdt_setprop_cell(fdt, nodename, "phandle", prci_phandle);
     qemu_fdt_setprop_cell(fdt, nodename, "#clock-cells", 0x1);
     qemu_fdt_setprop_cells(fdt, nodename, "clocks",
         hfclk_phandle, rtcclk_phandle);
     qemu_fdt_setprop_cells(fdt, nodename, "reg",
-        0x0, memmap[SIFIVE_U_PRCI].base,
-        0x0, memmap[SIFIVE_U_PRCI].size);
+        0x0, memmap[SIFIVE_U_DEV_PRCI].base,
+        0x0, memmap[SIFIVE_U_DEV_PRCI].size);
     qemu_fdt_setprop_string(fdt, nodename, "compatible",
         "sifive,fu540-c000-prci");
     g_free(nodename);
@@ -256,7 +256,7 @@ static void create_fdt(SiFiveUState *s, const struct MemmapEntry *memmap,
         g_free(nodename);
     }
     nodename = g_strdup_printf("/soc/interrupt-controller@%lx",
-        (long)memmap[SIFIVE_U_PLIC].base);
+        (long)memmap[SIFIVE_U_DEV_PLIC].base);
     qemu_fdt_add_subnode(fdt, nodename);
     qemu_fdt_setprop_cell(fdt, nodename, "#interrupt-cells", 1);
     qemu_fdt_setprop_string(fdt, nodename, "compatible", "riscv,plic0");
@@ -264,8 +264,8 @@ static void create_fdt(SiFiveUState *s, const struct MemmapEntry *memmap,
     qemu_fdt_setprop(fdt, nodename, "interrupts-extended",
         cells, (ms->smp.cpus * 4 - 2) * sizeof(uint32_t));
     qemu_fdt_setprop_cells(fdt, nodename, "reg",
-        0x0, memmap[SIFIVE_U_PLIC].base,
-        0x0, memmap[SIFIVE_U_PLIC].size);
+        0x0, memmap[SIFIVE_U_DEV_PLIC].base,
+        0x0, memmap[SIFIVE_U_DEV_PLIC].size);
     qemu_fdt_setprop_cell(fdt, nodename, "riscv,ndev", 0x35);
     qemu_fdt_setprop_cell(fdt, nodename, "phandle", plic_phandle);
     plic_phandle = qemu_fdt_get_phandle(fdt, nodename);
@@ -274,7 +274,7 @@ static void create_fdt(SiFiveUState *s, const struct MemmapEntry *memmap,
 
     gpio_phandle = phandle++;
     nodename = g_strdup_printf("/soc/gpio@%lx",
-        (long)memmap[SIFIVE_U_GPIO].base);
+        (long)memmap[SIFIVE_U_DEV_GPIO].base);
     qemu_fdt_add_subnode(fdt, nodename);
     qemu_fdt_setprop_cell(fdt, nodename, "phandle", gpio_phandle);
     qemu_fdt_setprop_cells(fdt, nodename, "clocks",
@@ -284,8 +284,8 @@ static void create_fdt(SiFiveUState *s, const struct MemmapEntry *memmap,
     qemu_fdt_setprop_cell(fdt, nodename, "#gpio-cells", 2);
     qemu_fdt_setprop(fdt, nodename, "gpio-controller", NULL, 0);
     qemu_fdt_setprop_cells(fdt, nodename, "reg",
-        0x0, memmap[SIFIVE_U_GPIO].base,
-        0x0, memmap[SIFIVE_U_GPIO].size);
+        0x0, memmap[SIFIVE_U_DEV_GPIO].base,
+        0x0, memmap[SIFIVE_U_DEV_GPIO].size);
     qemu_fdt_setprop_cells(fdt, nodename, "interrupts", SIFIVE_U_GPIO_IRQ0,
         SIFIVE_U_GPIO_IRQ1, SIFIVE_U_GPIO_IRQ2, SIFIVE_U_GPIO_IRQ3,
         SIFIVE_U_GPIO_IRQ4, SIFIVE_U_GPIO_IRQ5, SIFIVE_U_GPIO_IRQ6,
@@ -304,15 +304,15 @@ static void create_fdt(SiFiveUState *s, const struct MemmapEntry *memmap,
 
     phy_phandle = phandle++;
     nodename = g_strdup_printf("/soc/ethernet@%lx",
-        (long)memmap[SIFIVE_U_GEM].base);
+        (long)memmap[SIFIVE_U_DEV_GEM].base);
     qemu_fdt_add_subnode(fdt, nodename);
     qemu_fdt_setprop_string(fdt, nodename, "compatible",
         "sifive,fu540-c000-gem");
     qemu_fdt_setprop_cells(fdt, nodename, "reg",
-        0x0, memmap[SIFIVE_U_GEM].base,
-        0x0, memmap[SIFIVE_U_GEM].size,
-        0x0, memmap[SIFIVE_U_GEM_MGMT].base,
-        0x0, memmap[SIFIVE_U_GEM_MGMT].size);
+        0x0, memmap[SIFIVE_U_DEV_GEM].base,
+        0x0, memmap[SIFIVE_U_DEV_GEM].size,
+        0x0, memmap[SIFIVE_U_DEV_GEM_MGMT].base,
+        0x0, memmap[SIFIVE_U_DEV_GEM_MGMT].size);
     qemu_fdt_setprop_string(fdt, nodename, "reg-names", "control");
     qemu_fdt_setprop_string(fdt, nodename, "phy-mode", "gmii");
     qemu_fdt_setprop_cell(fdt, nodename, "phy-handle", phy_phandle);
@@ -333,19 +333,19 @@ static void create_fdt(SiFiveUState *s, const struct MemmapEntry *memmap,
     g_free(nodename);
 
     nodename = g_strdup_printf("/soc/ethernet@%lx/ethernet-phy@0",
-        (long)memmap[SIFIVE_U_GEM].base);
+        (long)memmap[SIFIVE_U_DEV_GEM].base);
     qemu_fdt_add_subnode(fdt, nodename);
     qemu_fdt_setprop_cell(fdt, nodename, "phandle", phy_phandle);
     qemu_fdt_setprop_cell(fdt, nodename, "reg", 0x0);
     g_free(nodename);
 
     nodename = g_strdup_printf("/soc/serial@%lx",
-        (long)memmap[SIFIVE_U_UART0].base);
+        (long)memmap[SIFIVE_U_DEV_UART0].base);
     qemu_fdt_add_subnode(fdt, nodename);
     qemu_fdt_setprop_string(fdt, nodename, "compatible", "sifive,uart0");
     qemu_fdt_setprop_cells(fdt, nodename, "reg",
-        0x0, memmap[SIFIVE_U_UART0].base,
-        0x0, memmap[SIFIVE_U_UART0].size);
+        0x0, memmap[SIFIVE_U_DEV_UART0].base,
+        0x0, memmap[SIFIVE_U_DEV_UART0].size);
     qemu_fdt_setprop_cells(fdt, nodename, "clocks",
         prci_phandle, PRCI_CLK_TLCLK);
     qemu_fdt_setprop_cell(fdt, nodename, "interrupt-parent", plic_phandle);
@@ -377,7 +377,7 @@ static void sifive_u_machine_init(MachineState *machine)
     MemoryRegion *system_memory = get_system_memory();
     MemoryRegion *main_mem = g_new(MemoryRegion, 1);
     MemoryRegion *flash0 = g_new(MemoryRegion, 1);
-    target_ulong start_addr = memmap[SIFIVE_U_DRAM].base;
+    target_ulong start_addr = memmap[SIFIVE_U_DEV_DRAM].base;
     uint32_t start_addr_hi32 = 0x00000000;
     int i;
     uint32_t fdt_load_addr;
@@ -392,13 +392,13 @@ static void sifive_u_machine_init(MachineState *machine)
     /* register RAM */
     memory_region_init_ram(main_mem, NULL, "riscv.sifive.u.ram",
                            machine->ram_size, &error_fatal);
-    memory_region_add_subregion(system_memory, memmap[SIFIVE_U_DRAM].base,
+    memory_region_add_subregion(system_memory, memmap[SIFIVE_U_DEV_DRAM].base,
                                 main_mem);
 
     /* register QSPI0 Flash */
     memory_region_init_ram(flash0, NULL, "riscv.sifive.u.flash0",
-                           memmap[SIFIVE_U_FLASH0].size, &error_fatal);
-    memory_region_add_subregion(system_memory, memmap[SIFIVE_U_FLASH0].base,
+                           memmap[SIFIVE_U_DEV_FLASH0].size, &error_fatal);
+    memory_region_add_subregion(system_memory, memmap[SIFIVE_U_DEV_FLASH0].base,
                                 flash0);
 
     /* register gpio-restart */
@@ -424,14 +424,14 @@ static void sifive_u_machine_init(MachineState *machine)
 
     switch (s->msel) {
     case MSEL_MEMMAP_QSPI0_FLASH:
-        start_addr = memmap[SIFIVE_U_FLASH0].base;
+        start_addr = memmap[SIFIVE_U_DEV_FLASH0].base;
         break;
     case MSEL_L2LIM_QSPI0_FLASH:
     case MSEL_L2LIM_QSPI2_SD:
-        start_addr = memmap[SIFIVE_U_L2LIM].base;
+        start_addr = memmap[SIFIVE_U_DEV_L2LIM].base;
         break;
     default:
-        start_addr = memmap[SIFIVE_U_DRAM].base;
+        start_addr = memmap[SIFIVE_U_DEV_DRAM].base;
         break;
     }
 
@@ -459,7 +459,7 @@ static void sifive_u_machine_init(MachineState *machine)
     }
 
     /* Compute the fdt load address in dram */
-    fdt_load_addr = riscv_load_fdt(memmap[SIFIVE_U_DRAM].base,
+    fdt_load_addr = riscv_load_fdt(memmap[SIFIVE_U_DEV_DRAM].base,
                                    machine->ram_size, s->fdt);
     #if defined(TARGET_RISCV64)
     start_addr_hi32 = start_addr >> 32;
@@ -491,10 +491,10 @@ static void sifive_u_machine_init(MachineState *machine)
         reset_vec[i] = cpu_to_le32(reset_vec[i]);
     }
     rom_add_blob_fixed_as("mrom.reset", reset_vec, sizeof(reset_vec),
-                          memmap[SIFIVE_U_MROM].base, &address_space_memory);
+                          memmap[SIFIVE_U_DEV_MROM].base, &address_space_memory);
 
-    riscv_rom_copy_firmware_info(memmap[SIFIVE_U_MROM].base,
-                                 memmap[SIFIVE_U_MROM].size,
+    riscv_rom_copy_firmware_info(memmap[SIFIVE_U_DEV_MROM].base,
+                                 memmap[SIFIVE_U_DEV_MROM].size,
                                  sizeof(reset_vec), kernel_entry);
 }
 
@@ -634,8 +634,8 @@ static void sifive_u_soc_realize(DeviceState *dev, Error **errp)
 
     /* boot rom */
     memory_region_init_rom(mask_rom, OBJECT(dev), "riscv.sifive.u.mrom",
-                           memmap[SIFIVE_U_MROM].size, &error_fatal);
-    memory_region_add_subregion(system_memory, memmap[SIFIVE_U_MROM].base,
+                           memmap[SIFIVE_U_DEV_MROM].size, &error_fatal);
+    memory_region_add_subregion(system_memory, memmap[SIFIVE_U_DEV_MROM].base,
                                 mask_rom);
 
     /*
@@ -648,8 +648,8 @@ static void sifive_u_soc_realize(DeviceState *dev, Error **errp)
      * too generous to misbehaving guests.
      */
     memory_region_init_ram(l2lim_mem, NULL, "riscv.sifive.u.l2lim",
-                           memmap[SIFIVE_U_L2LIM].size, &error_fatal);
-    memory_region_add_subregion(system_memory, memmap[SIFIVE_U_L2LIM].base,
+                           memmap[SIFIVE_U_DEV_L2LIM].size, &error_fatal);
+    memory_region_add_subregion(system_memory, memmap[SIFIVE_U_DEV_L2LIM].base,
                                 l2lim_mem);
 
     /* create PLIC hart topology configuration string */
@@ -667,7 +667,7 @@ static void sifive_u_soc_realize(DeviceState *dev, Error **errp)
     }
 
     /* MMIO */
-    s->plic = sifive_plic_create(memmap[SIFIVE_U_PLIC].base,
+    s->plic = sifive_plic_create(memmap[SIFIVE_U_DEV_PLIC].base,
         plic_hart_config,
         SIFIVE_U_PLIC_NUM_SOURCES,
         SIFIVE_U_PLIC_NUM_PRIORITIES,
@@ -677,26 +677,26 @@ static void sifive_u_soc_realize(DeviceState *dev, Error **errp)
         SIFIVE_U_PLIC_ENABLE_STRIDE,
         SIFIVE_U_PLIC_CONTEXT_BASE,
         SIFIVE_U_PLIC_CONTEXT_STRIDE,
-        memmap[SIFIVE_U_PLIC].size);
+        memmap[SIFIVE_U_DEV_PLIC].size);
     g_free(plic_hart_config);
-    sifive_uart_create(system_memory, memmap[SIFIVE_U_UART0].base,
+    sifive_uart_create(system_memory, memmap[SIFIVE_U_DEV_UART0].base,
         serial_hd(0), qdev_get_gpio_in(DEVICE(s->plic), SIFIVE_U_UART0_IRQ));
-    sifive_uart_create(system_memory, memmap[SIFIVE_U_UART1].base,
+    sifive_uart_create(system_memory, memmap[SIFIVE_U_DEV_UART1].base,
         serial_hd(1), qdev_get_gpio_in(DEVICE(s->plic), SIFIVE_U_UART1_IRQ));
-    sifive_clint_create(memmap[SIFIVE_U_CLINT].base,
-        memmap[SIFIVE_U_CLINT].size, ms->smp.cpus,
+    sifive_clint_create(memmap[SIFIVE_U_DEV_CLINT].base,
+        memmap[SIFIVE_U_DEV_CLINT].size, ms->smp.cpus,
         SIFIVE_SIP_BASE, SIFIVE_TIMECMP_BASE, SIFIVE_TIME_BASE, false);
 
     if (!sysbus_realize(SYS_BUS_DEVICE(&s->prci), errp)) {
         return;
     }
-    sysbus_mmio_map(SYS_BUS_DEVICE(&s->prci), 0, memmap[SIFIVE_U_PRCI].base);
+    sysbus_mmio_map(SYS_BUS_DEVICE(&s->prci), 0, memmap[SIFIVE_U_DEV_PRCI].base);
 
     qdev_prop_set_uint32(DEVICE(&s->gpio), "ngpio", 16);
     if (!sysbus_realize(SYS_BUS_DEVICE(&s->gpio), errp)) {
         return;
     }
-    sysbus_mmio_map(SYS_BUS_DEVICE(&s->gpio), 0, memmap[SIFIVE_U_GPIO].base);
+    sysbus_mmio_map(SYS_BUS_DEVICE(&s->gpio), 0, memmap[SIFIVE_U_DEV_GPIO].base);
 
     /* Pass all GPIOs to the SOC layer so they are available to the board */
     qdev_pass_gpios(DEVICE(&s->gpio), dev, NULL);
@@ -712,7 +712,7 @@ static void sifive_u_soc_realize(DeviceState *dev, Error **errp)
     if (!sysbus_realize(SYS_BUS_DEVICE(&s->otp), errp)) {
         return;
     }
-    sysbus_mmio_map(SYS_BUS_DEVICE(&s->otp), 0, memmap[SIFIVE_U_OTP].base);
+    sysbus_mmio_map(SYS_BUS_DEVICE(&s->otp), 0, memmap[SIFIVE_U_DEV_OTP].base);
 
     /* FIXME use qdev NIC properties instead of nd_table[] */
     if (nd->used) {
@@ -724,15 +724,15 @@ static void sifive_u_soc_realize(DeviceState *dev, Error **errp)
     if (!sysbus_realize(SYS_BUS_DEVICE(&s->gem), errp)) {
         return;
     }
-    sysbus_mmio_map(SYS_BUS_DEVICE(&s->gem), 0, memmap[SIFIVE_U_GEM].base);
+    sysbus_mmio_map(SYS_BUS_DEVICE(&s->gem), 0, memmap[SIFIVE_U_DEV_GEM].base);
     sysbus_connect_irq(SYS_BUS_DEVICE(&s->gem), 0,
                        qdev_get_gpio_in(DEVICE(s->plic), SIFIVE_U_GEM_IRQ));
 
     create_unimplemented_device("riscv.sifive.u.gem-mgmt",
-        memmap[SIFIVE_U_GEM_MGMT].base, memmap[SIFIVE_U_GEM_MGMT].size);
+        memmap[SIFIVE_U_DEV_GEM_MGMT].base, memmap[SIFIVE_U_DEV_GEM_MGMT].size);
 
     create_unimplemented_device("riscv.sifive.u.dmc",
-        memmap[SIFIVE_U_DMC].base, memmap[SIFIVE_U_DMC].size);
+        memmap[SIFIVE_U_DEV_DMC].base, memmap[SIFIVE_U_DEV_DMC].size);
 }
 
 static Property sifive_u_soc_props[] = {
--

2.26.2

#29 lore raw

PATCH 11/41 versatile: Fix typo in PCI_VPB_HOST definition

In reply to Eduardo Habkost
---
 hw/pci-host/versatile.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/pci-host/versatile.c +1 -1
index 616882a80d..7e4aa467a2 100644
@@ -161,7 +161,7 @@ static const VMStateDescription pci_vpb_vmstate = {
 
 #define TYPE_VERSATILE_PCI_HOST "versatile_pci_host"
 #define PCI_VPB_HOST(obj) \
-    OBJECT_CHECK(PCIDevice, (obj), TYPE_VERSATILE_PCIHOST)
+    OBJECT_CHECK(PCIDevice, (obj), TYPE_VERSATILE_PCI_HOST)
 
 typedef enum {
     PCI_IMAP0 = 0x0,
Signature · 1 line
2.26.2
Reviewed-by on v1 11/41
#30 lore raw

Re: [PATCH 11/41] versatile: Fix typo in PCI_VPB_HOST definition

Quoted 10 lines · Eduardo Habkost
---
 hw/pci-host/versatile.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/pci-host/versatile.c +0 -0
index 616882a80d..7e4aa467a2 100644

hw/pci-host/versatile.c static const VMStateDescription pci_vpb_vmstate = { · line 164

Quoted 5 lines
hw/pci-host/versatile.c +1 -1
@@ -161,7 +161,7 @@ static const VMStateDescription pci_vpb_vmstate = {
 
 #define TYPE_VERSATILE_PCI_HOST "versatile_pci_host"
 #define PCI_VPB_HOST(obj) \
-    OBJECT_CHECK(PCIDevice, (obj), TYPE_VERSATILE_PCIHOST)
+    OBJECT_CHECK(PCIDevice, (obj), TYPE_VERSATILE_PCI_HOST)

Uh, since cd93dbf375 ("versatile_pci: Update to realize and instance init functions") 7 years ago...

Quoted 4 lines
hw/pci-host/versatile.c +0 -0
 typedef enum {
     PCI_IMAP0 = 0x0,
 
Reviewed-by on v1 11/41
#31 lore raw

Re: [PATCH 11/41] versatile: Fix typo in PCI_VPB_HOST definition

In reply to Eduardo Habkost
Quoted 4 lines · Eduardo Habkost
---
 hw/pci-host/versatile.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#32 lore raw

PATCH 12/41 virtio-ccw: Fix definition of VIRTIO_CCW_BUS_GET_CLASS

In reply to Eduardo Habkost

The macro was incorrectly defined using OBJECT_CHECK.

---
 hw/s390x/virtio-ccw.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/s390x/virtio-ccw.h +2 -2
index c0e3355248..b281896f7d 100644
@@ -65,9 +65,9 @@ typedef struct VirtioBusClass VirtioCcwBusClass;
 
 #define TYPE_VIRTIO_CCW_BUS "virtio-ccw-bus"
 #define VIRTIO_CCW_BUS(obj) \
-     OBJECT_CHECK(VirtioCcwBus, (obj), TYPE_VIRTIO_CCW_BUS)
+     OBJECT_CHECK(VirtioCcwBusState, (obj), TYPE_VIRTIO_CCW_BUS)
 #define VIRTIO_CCW_BUS_GET_CLASS(obj) \
-    OBJECT_CHECK(VirtioCcwBusState, (obj), TYPE_VIRTIO_CCW_BUS)
+    OBJECT_GET_CLASS(VirtioCcwBusClass, (obj), TYPE_VIRTIO_CCW_BUS)
 #define VIRTIO_CCW_BUS_CLASS(klass) \
     OBJECT_CLASS_CHECK(VirtioCcwBusClass, klass, TYPE_VIRTIO_CCW_BUS)
 
Signature · 1 line
2.26.2
Acked-by on v1 12/41
#33 lore raw

Re: [PATCH 12/41] virtio-ccw: Fix definition of VIRTIO_CCW_BUS_GET_CLASS

Quoted 13 lines · On Thu, 13 Aug 2020 18:25:56 -0400 Eduardo Habkost <[email protected]> wrote:

The macro was incorrectly defined using OBJECT_CHECK.

---
 hw/s390x/virtio-ccw.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/s390x/virtio-ccw.h +0 -0
index c0e3355248..b281896f7d 100644
@@ -65,9 +65,9 @@ typedef struct VirtioBusClass VirtioCcwBusClass;
 

hw/s390x/virtio-ccw.h typedef struct VirtioBusClass VirtioCcwBusClass; · line 73

Quoted 10 lines
hw/s390x/virtio-ccw.h +2 -2
 #define TYPE_VIRTIO_CCW_BUS "virtio-ccw-bus"
 #define VIRTIO_CCW_BUS(obj) \
-     OBJECT_CHECK(VirtioCcwBus, (obj), TYPE_VIRTIO_CCW_BUS)
+     OBJECT_CHECK(VirtioCcwBusState, (obj), TYPE_VIRTIO_CCW_BUS)
 #define VIRTIO_CCW_BUS_GET_CLASS(obj) \
-    OBJECT_CHECK(VirtioCcwBusState, (obj), TYPE_VIRTIO_CCW_BUS)
+    OBJECT_GET_CLASS(VirtioCcwBusClass, (obj), TYPE_VIRTIO_CCW_BUS)
 #define VIRTIO_CCW_BUS_CLASS(klass) \
     OBJECT_CLASS_CHECK(VirtioCcwBusClass, klass, TYPE_VIRTIO_CCW_BUS)
 

I was wondering why nobody ever noticed, but it seems that the broken macros were simply unused. If we keep them for completeness' sake, we should make sure that they are indeed correct :)

Reviewed-by on v1 12/41
#34 lore raw

Re: [PATCH 12/41] virtio-ccw: Fix definition of VIRTIO_CCW_BUS_GET_CLASS

In reply to Eduardo Habkost
Quoted 1 line · Eduardo Habkost

The macro was incorrectly defined using OBJECT_CHECK.

Nice demonstration of the benefit of removing this boilerplate definition !

Quoted 5 lines
---
 hw/s390x/virtio-ccw.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#35 lore raw

PATCH 13/41 hvf: Add missing include

In reply to Eduardo Habkost

The sysemu/accel.h header is needed for the ACCEL_CLASS_NAME macro. This will be necessary to allow us to use OBJECT_DEFINE*() for TYPE_HVF_ACCEL.

---
 include/sysemu/hvf.h | 2 ++
 1 file changed, 2 insertions(+)
include/sysemu/hvf.h +2 -0
index 6d3ee4fdb7..d3bed80ea8 100644
@@ -13,6 +13,8 @@
 #ifndef HVF_H
 #define HVF_H
 
+#include "sysemu/accel.h"
+
 #ifdef CONFIG_HVF
 uint32_t hvf_get_supported_cpuid(uint32_t func, uint32_t idx,
                                  int reg);
Signature · 1 line
2.26.2
Reviewed-by on v1 13/41
#36 lore raw

Re: [PATCH 13/41] hvf: Add missing include

Quoted 8 lines · Eduardo Habkost

The sysemu/accel.h header is needed for the ACCEL_CLASS_NAME macro. This will be necessary to allow us to use OBJECT_DEFINE*() for TYPE_HVF_ACCEL.

---
 include/sysemu/hvf.h | 2 ++
 1 file changed, 2 insertions(+)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
Reviewed-by on v1 13/41
#37 lore raw

Re: [PATCH 13/41] hvf: Add missing include

In reply to Eduardo Habkost
Quoted 15 lines · Eduardo Habkost

The sysemu/accel.h header is needed for the ACCEL_CLASS_NAME macro. This will be necessary to allow us to use OBJECT_DEFINE*() for TYPE_HVF_ACCEL.

---
 include/sysemu/hvf.h | 2 ++
 1 file changed, 2 insertions(+)
include/sysemu/hvf.h +0 -0
index 6d3ee4fdb7..d3bed80ea8 100644

include/sysemu/hvf.h line 20

Quoted 8 lines
include/sysemu/hvf.h +2 -0
@@ -13,6 +13,8 @@
 #ifndef HVF_H
 #define HVF_H
 
+#include "sysemu/accel.h"
+
 #ifdef CONFIG_HVF
 uint32_t hvf_get_supported_cpuid(uint32_t func, uint32_t idx,
                                  int reg);
#39 lore raw

PATCH 14/41 hcd-dwc2: Rename USB_*CLASS macros for consistency

In reply to Eduardo Habkost

Rename the DWC2_CLASS to DWC2_USB_CLASS and DWC2_GET_CLASS to DWC2_USB_GET_CLASS, for consistency with the DWC2_USB macro.

---
 hw/usb/hcd-dwc2.h | 4 ++--
 hw/usb/hcd-dwc2.c | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)
hw/usb/hcd-dwc2.h +2 -2
index 4ba809a07b..54111d835e 100644
@@ -182,9 +182,9 @@ struct DWC2Class {
 #define TYPE_DWC2_USB   "dwc2-usb"
 #define DWC2_USB(obj) \
     OBJECT_CHECK(DWC2State, (obj), TYPE_DWC2_USB)
-#define DWC2_CLASS(klass) \
+#define DWC2_USB_CLASS(klass) \
     OBJECT_CLASS_CHECK(DWC2Class, (klass), TYPE_DWC2_USB)
-#define DWC2_GET_CLASS(obj) \
+#define DWC2_USB_GET_CLASS(obj) \
     OBJECT_GET_CLASS(DWC2Class, (obj), TYPE_DWC2_USB)
 
 #endif
hw/usb/hcd-dwc2.c +4 -4
index 56f91f6bee..97688d21bf 100644
@@ -1155,7 +1155,7 @@ static void dwc2_work_timer(void *opaque)
 
 static void dwc2_reset_enter(Object *obj, ResetType type)
 {
-    DWC2Class *c = DWC2_GET_CLASS(obj);
+    DWC2Class *c = DWC2_USB_GET_CLASS(obj);
     DWC2State *s = DWC2_USB(obj);
     int i;
 
@@ -1239,7 +1239,7 @@ static void dwc2_reset_enter(Object *obj, ResetType type)
 
 static void dwc2_reset_hold(Object *obj)
 {
-    DWC2Class *c = DWC2_GET_CLASS(obj);
+    DWC2Class *c = DWC2_USB_GET_CLASS(obj);
     DWC2State *s = DWC2_USB(obj);
 
     trace_usb_dwc2_reset_hold();
@@ -1253,7 +1253,7 @@ static void dwc2_reset_hold(Object *obj)
 
 static void dwc2_reset_exit(Object *obj)
 {
-    DWC2Class *c = DWC2_GET_CLASS(obj);
+    DWC2Class *c = DWC2_USB_GET_CLASS(obj);
     DWC2State *s = DWC2_USB(obj);
 
     trace_usb_dwc2_reset_exit();
@@ -1382,7 +1382,7 @@ static Property dwc2_usb_properties[] = {
 static void dwc2_class_init(ObjectClass *klass, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(klass);
-    DWC2Class *c = DWC2_CLASS(klass);
+    DWC2Class *c = DWC2_USB_CLASS(klass);
     ResettableClass *rc = RESETTABLE_CLASS(klass);
 
     dc->realize = dwc2_realize;
Signature · 1 line
2.26.2
Reviewed-by on v1 14/41
#40 lore raw

Re: [PATCH 14/41] hcd-dwc2: Rename USB_*CLASS macros for consistency

Quoted 4 lines · Eduardo Habkost

Rename the DWC2_CLASS to DWC2_USB_CLASS and DWC2_GET_CLASS to DWC2_USB_GET_CLASS, for consistency with the DWC2_USB macro.

Quoted 62 lines
---
 hw/usb/hcd-dwc2.h | 4 ++--
 hw/usb/hcd-dwc2.c | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)
hw/usb/hcd-dwc2.h +2 -2
index 4ba809a07b..54111d835e 100644
@@ -182,9 +182,9 @@ struct DWC2Class {
 #define TYPE_DWC2_USB   "dwc2-usb"
 #define DWC2_USB(obj) \
     OBJECT_CHECK(DWC2State, (obj), TYPE_DWC2_USB)
-#define DWC2_CLASS(klass) \
+#define DWC2_USB_CLASS(klass) \
     OBJECT_CLASS_CHECK(DWC2Class, (klass), TYPE_DWC2_USB)
-#define DWC2_GET_CLASS(obj) \
+#define DWC2_USB_GET_CLASS(obj) \
     OBJECT_GET_CLASS(DWC2Class, (obj), TYPE_DWC2_USB)
 
 #endif
hw/usb/hcd-dwc2.c +4 -4
index 56f91f6bee..97688d21bf 100644
@@ -1155,7 +1155,7 @@ static void dwc2_work_timer(void *opaque)
 
 static void dwc2_reset_enter(Object *obj, ResetType type)
 {
-    DWC2Class *c = DWC2_GET_CLASS(obj);
+    DWC2Class *c = DWC2_USB_GET_CLASS(obj);
     DWC2State *s = DWC2_USB(obj);
     int i;
 
@@ -1239,7 +1239,7 @@ static void dwc2_reset_enter(Object *obj, ResetType type)
 
 static void dwc2_reset_hold(Object *obj)
 {
-    DWC2Class *c = DWC2_GET_CLASS(obj);
+    DWC2Class *c = DWC2_USB_GET_CLASS(obj);
     DWC2State *s = DWC2_USB(obj);
 
     trace_usb_dwc2_reset_hold();
@@ -1253,7 +1253,7 @@ static void dwc2_reset_hold(Object *obj)
 
 static void dwc2_reset_exit(Object *obj)
 {
-    DWC2Class *c = DWC2_GET_CLASS(obj);
+    DWC2Class *c = DWC2_USB_GET_CLASS(obj);
     DWC2State *s = DWC2_USB(obj);
 
     trace_usb_dwc2_reset_exit();
@@ -1382,7 +1382,7 @@ static Property dwc2_usb_properties[] = {
 static void dwc2_class_init(ObjectClass *klass, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(klass);
-    DWC2Class *c = DWC2_CLASS(klass);
+    DWC2Class *c = DWC2_USB_CLASS(klass);
     ResettableClass *rc = RESETTABLE_CLASS(klass);
 
     dc->realize = dwc2_realize;
Reviewed-by on v1 14/41
#41 lore raw

Re: [PATCH 14/41] hcd-dwc2: Rename USB_*CLASS macros for consistency

In reply to Eduardo Habkost
Quoted 8 lines · Eduardo Habkost

Rename the DWC2_CLASS to DWC2_USB_CLASS and DWC2_GET_CLASS to DWC2_USB_GET_CLASS, for consistency with the DWC2_USB macro.

---
 hw/usb/hcd-dwc2.h | 4 ++--
 hw/usb/hcd-dwc2.c | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#42 lore raw

PATCH 15/41 tulip: Move TulipState typedef to header

In reply to Eduardo Habkost

Move typedef closer to the type check macros, to make it easier to convert the code to OBJECT_DEFINE_TYPE() in the future.

---
 hw/net/tulip.h | 1 +
 hw/net/tulip.c | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
hw/net/tulip.h +1 -0
index 5271aad8d5..c3fcd4d4e1 100644
@@ -5,6 +5,7 @@
 #include "net/net.h"
 
 #define TYPE_TULIP "tulip"
+typedef struct TULIPState TULIPState;
 #define TULIP(obj) OBJECT_CHECK(TULIPState, (obj), TYPE_TULIP)
 
 #define CSR(_x) ((_x) << 3)
hw/net/tulip.c +2 -2
index 4487fd61cf..ca69f7ea5e 100644
@@ -18,7 +18,7 @@
 #include "trace.h"
 #include "net/eth.h"
 
-typedef struct TULIPState {
+struct TULIPState {
     PCIDevice dev;
     MemoryRegion io;
     MemoryRegion memory;
@@ -44,7 +44,7 @@ typedef struct TULIPState {
 
     uint32_t rx_status;
     uint8_t filter[16][6];
-} TULIPState;
+};
 
 static const VMStateDescription vmstate_pci_tulip = {
     .name = "tulip",
Signature · 1 line
2.26.2
Reviewed-by on v1 15/41
#43 lore raw

Re: [PATCH 15/41] tulip: Move TulipState typedef to header

Quoted 4 lines · Eduardo Habkost

Move typedef closer to the type check macros, to make it easier to convert the code to OBJECT_DEFINE_TYPE() in the future.

Quoted 40 lines
---
 hw/net/tulip.h | 1 +
 hw/net/tulip.c | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
hw/net/tulip.h +1 -0
index 5271aad8d5..c3fcd4d4e1 100644
@@ -5,6 +5,7 @@
 #include "net/net.h"
 
 #define TYPE_TULIP "tulip"
+typedef struct TULIPState TULIPState;
 #define TULIP(obj) OBJECT_CHECK(TULIPState, (obj), TYPE_TULIP)
 
 #define CSR(_x) ((_x) << 3)
hw/net/tulip.c +2 -2
index 4487fd61cf..ca69f7ea5e 100644
@@ -18,7 +18,7 @@
 #include "trace.h"
 #include "net/eth.h"
 
-typedef struct TULIPState {
+struct TULIPState {
     PCIDevice dev;
     MemoryRegion io;
     MemoryRegion memory;
@@ -44,7 +44,7 @@ typedef struct TULIPState {
 
     uint32_t rx_status;
     uint8_t filter[16][6];
-} TULIPState;
+};
 
 static const VMStateDescription vmstate_pci_tulip = {
     .name = "tulip",
Reviewed-by on v1 15/41
#44 lore raw

Re: [PATCH 15/41] tulip: Move TulipState typedef to header

In reply to Eduardo Habkost
Quoted 8 lines · Eduardo Habkost

Move typedef closer to the type check macros, to make it easier to convert the code to OBJECT_DEFINE_TYPE() in the future.

---
 hw/net/tulip.h | 1 +
 hw/net/tulip.c | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#45 lore raw

PATCH 16/41 throttle-groups: Move ThrottleGroup typedef to header

In reply to Eduardo Habkost

Move typedef closer to the type check macros, to make it easier to convert the code to OBJECT_DEFINE_TYPE() in the future.

---
 include/block/throttle-groups.h | 1 +
 block/throttle-groups.c         | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
include/block/throttle-groups.h +1 -0
index 712a8e64b4..5e77db700f 100644
@@ -59,6 +59,7 @@ typedef struct ThrottleGroupMember {
 } ThrottleGroupMember;
 
 #define TYPE_THROTTLE_GROUP "throttle-group"
+typedef struct ThrottleGroup ThrottleGroup;
 #define THROTTLE_GROUP(obj) OBJECT_CHECK(ThrottleGroup, (obj), TYPE_THROTTLE_GROUP)
 
 const char *throttle_group_get_name(ThrottleGroupMember *tgm);
block/throttle-groups.c +2 -2
index 98fea7fd47..4e28365d8d 100644
@@ -63,7 +63,7 @@ static void timer_cb(ThrottleGroupMember *tgm, bool is_write);
  * access some other ThrottleGroupMember's timers only after verifying that
  * that ThrottleGroupMember has throttled requests in the queue.
  */
-typedef struct ThrottleGroup {
+struct ThrottleGroup {
     Object parent_obj;
 
     /* refuse individual property change if initialization is complete */
@@ -79,7 +79,7 @@ typedef struct ThrottleGroup {
 
     /* This field is protected by the global QEMU mutex */
     QTAILQ_ENTRY(ThrottleGroup) list;
-} ThrottleGroup;
+};
 
 /* This is protected by the global QEMU mutex */
 static QTAILQ_HEAD(, ThrottleGroup) throttle_groups =
Signature · 1 line
2.26.2
Reviewed-by on v1 16/41
#46 lore raw

Re: [PATCH 16/41] throttle-groups: Move ThrottleGroup typedef to header

Quoted 4 lines · Eduardo Habkost

Move typedef closer to the type check macros, to make it easier to convert the code to OBJECT_DEFINE_TYPE() in the future.

Quoted 40 lines
---
 include/block/throttle-groups.h | 1 +
 block/throttle-groups.c         | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
include/block/throttle-groups.h +1 -0
index 712a8e64b4..5e77db700f 100644
@@ -59,6 +59,7 @@ typedef struct ThrottleGroupMember {
 } ThrottleGroupMember;
 
 #define TYPE_THROTTLE_GROUP "throttle-group"
+typedef struct ThrottleGroup ThrottleGroup;
 #define THROTTLE_GROUP(obj) OBJECT_CHECK(ThrottleGroup, (obj), TYPE_THROTTLE_GROUP)
 
 const char *throttle_group_get_name(ThrottleGroupMember *tgm);
block/throttle-groups.c +2 -2
index 98fea7fd47..4e28365d8d 100644
@@ -63,7 +63,7 @@ static void timer_cb(ThrottleGroupMember *tgm, bool is_write);
  * access some other ThrottleGroupMember's timers only after verifying that
  * that ThrottleGroupMember has throttled requests in the queue.
  */
-typedef struct ThrottleGroup {
+struct ThrottleGroup {
     Object parent_obj;
 
     /* refuse individual property change if initialization is complete */
@@ -79,7 +79,7 @@ typedef struct ThrottleGroup {
 
     /* This field is protected by the global QEMU mutex */
     QTAILQ_ENTRY(ThrottleGroup) list;
-} ThrottleGroup;
+};
 
 /* This is protected by the global QEMU mutex */
 static QTAILQ_HEAD(, ThrottleGroup) throttle_groups =
Reviewed-by on v1 16/41
#47 lore raw

Re: [PATCH 16/41] throttle-groups: Move ThrottleGroup typedef to header

In reply to Eduardo Habkost
Quoted 8 lines · Eduardo Habkost

Move typedef closer to the type check macros, to make it easier to convert the code to OBJECT_DEFINE_TYPE() in the future.

---
 include/block/throttle-groups.h | 1 +
 block/throttle-groups.c         | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#48 lore raw

PATCH 17/41 pci: Move PCIBusClass typedef to pci.h

In reply to Eduardo Habkost

Move typedef closer to the type check macros, to make it easier to convert the code to OBJECT_DEFINE_TYPE() in the future.

---
 include/hw/pci/pci.h     | 1 +
 include/hw/pci/pci_bus.h | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
include/hw/pci/pci.h +1 -0
index c1bf7d5356..4ca7258b5b 100644
@@ -396,6 +396,7 @@ typedef int (*pci_map_irq_fn)(PCIDevice *pci_dev, int irq_num);
 typedef PCIINTxRoute (*pci_route_irq_fn)(void *opaque, int pin);
 
 #define TYPE_PCI_BUS "PCI"
+typedef struct PCIBusClass PCIBusClass;
 #define PCI_BUS(obj) OBJECT_CHECK(PCIBus, (obj), TYPE_PCI_BUS)
 #define PCI_BUS_CLASS(klass) OBJECT_CLASS_CHECK(PCIBusClass, (klass), TYPE_PCI_BUS)
 #define PCI_BUS_GET_CLASS(obj) OBJECT_GET_CLASS(PCIBusClass, (obj), TYPE_PCI_BUS)
include/hw/pci/pci_bus.h +2 -2
index 0714f578af..347440d42c 100644
@@ -10,14 +10,14 @@
  * use accessor functions in pci.h
  */
 
-typedef struct PCIBusClass {
+struct PCIBusClass {
     /*< private >*/
     BusClass parent_class;
     /*< public >*/
 
     int (*bus_num)(PCIBus *bus);
     uint16_t (*numa_node)(PCIBus *bus);
-} PCIBusClass;
+};
 
 enum PCIBusFlags {
     /* This bus is the root of a PCI domain */
Signature · 1 line
2.26.2
Reviewed-by on v1 17/41
#49 lore raw

Re: [PATCH 17/41] pci: Move PCIBusClass typedef to pci.h

Quoted 8 lines · Eduardo Habkost

Move typedef closer to the type check macros, to make it easier to convert the code to OBJECT_DEFINE_TYPE() in the future.

---
 include/hw/pci/pci.h     | 1 +
 include/hw/pci/pci_bus.h | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#50 lore raw

PATCH 18/41 i8254: Move PITCommonState/PITCommonClass typedefs to i8254.h

In reply to Eduardo Habkost

Move typedef closer to the type check macros, to make it easier to convert the code to OBJECT_DEFINE_TYPE() in the future.

---
 include/hw/timer/i8254.h          | 2 ++
 include/hw/timer/i8254_internal.h | 8 ++++----
 2 files changed, 6 insertions(+), 4 deletions(-)
include/hw/timer/i8254.h +2 -0
index e75b4a5a08..206b8f8464 100644
@@ -39,6 +39,8 @@ typedef struct PITChannelInfo {
 } PITChannelInfo;
 
 #define TYPE_PIT_COMMON "pit-common"
+typedef struct PITCommonState PITCommonState;
+typedef struct PITCommonClass PITCommonClass;
 #define PIT_COMMON(obj) \
      OBJECT_CHECK(PITCommonState, (obj), TYPE_PIT_COMMON)
 #define PIT_COMMON_CLASS(klass) \
include/hw/timer/i8254_internal.h +4 -4
index 3db462aecd..a9a600d941 100644
@@ -50,14 +50,14 @@ typedef struct PITChannelState {
     uint32_t irq_disabled;
 } PITChannelState;
 
-typedef struct PITCommonState {
+struct PITCommonState {
     ISADevice dev;
     MemoryRegion ioports;
     uint32_t iobase;
     PITChannelState channels[3];
-} PITCommonState;
+};
 
-typedef struct PITCommonClass {
+struct PITCommonClass {
     ISADeviceClass parent_class;
 
     void (*set_channel_gate)(PITCommonState *s, PITChannelState *sc, int val);
@@ -65,7 +65,7 @@ typedef struct PITCommonClass {
                              PITChannelInfo *info);
     void (*pre_save)(PITCommonState *s);
     void (*post_load)(PITCommonState *s);
-} PITCommonClass;
+};
 
 int pit_get_out(PITChannelState *s, int64_t current_time);
 int64_t pit_get_next_transition_time(PITChannelState *s, int64_t current_time);
Signature · 1 line
2.26.2
Reviewed-by on v1 18/41
#51 lore raw

Re: [PATCH 18/41] i8254: Move PITCommonState/PITCommonClass typedefs to i8254.h

Quoted 4 lines · Eduardo Habkost

Move typedef closer to the type check macros, to make it easier to convert the code to OBJECT_DEFINE_TYPE() in the future.

Quoted 50 lines
---
 include/hw/timer/i8254.h          | 2 ++
 include/hw/timer/i8254_internal.h | 8 ++++----
 2 files changed, 6 insertions(+), 4 deletions(-)
include/hw/timer/i8254.h +2 -0
index e75b4a5a08..206b8f8464 100644
@@ -39,6 +39,8 @@ typedef struct PITChannelInfo {
 } PITChannelInfo;
 
 #define TYPE_PIT_COMMON "pit-common"
+typedef struct PITCommonState PITCommonState;
+typedef struct PITCommonClass PITCommonClass;
 #define PIT_COMMON(obj) \
      OBJECT_CHECK(PITCommonState, (obj), TYPE_PIT_COMMON)
 #define PIT_COMMON_CLASS(klass) \
include/hw/timer/i8254_internal.h +4 -4
index 3db462aecd..a9a600d941 100644
@@ -50,14 +50,14 @@ typedef struct PITChannelState {
     uint32_t irq_disabled;
 } PITChannelState;
 
-typedef struct PITCommonState {
+struct PITCommonState {
     ISADevice dev;
     MemoryRegion ioports;
     uint32_t iobase;
     PITChannelState channels[3];
-} PITCommonState;
+};
 
-typedef struct PITCommonClass {
+struct PITCommonClass {
     ISADeviceClass parent_class;
 
     void (*set_channel_gate)(PITCommonState *s, PITChannelState *sc, int val);
@@ -65,7 +65,7 @@ typedef struct PITCommonClass {
                              PITChannelInfo *info);
     void (*pre_save)(PITCommonState *s);
     void (*post_load)(PITCommonState *s);
-} PITCommonClass;
+};
 
 int pit_get_out(PITChannelState *s, int64_t current_time);
 int64_t pit_get_next_transition_time(PITChannelState *s, int64_t current_time);
Reviewed-by on v1 18/41
#52 lore raw

Re: [PATCH 18/41] i8254: Move PITCommonState/PITCommonClass typedefs to i8254.h

In reply to Eduardo Habkost
Quoted 8 lines · Eduardo Habkost

Move typedef closer to the type check macros, to make it easier to convert the code to OBJECT_DEFINE_TYPE() in the future.

---
 include/hw/timer/i8254.h          | 2 ++
 include/hw/timer/i8254_internal.h | 8 ++++----
 2 files changed, 6 insertions(+), 4 deletions(-)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#53 lore raw

PATCH 19/41 hvf: Move HVFState typedef to hvf.h

In reply to Eduardo Habkost

Move typedef closer to the type check macros, to make it easier to convert the code to OBJECT_DEFINE_TYPE() in the future.

---
 include/sysemu/hvf.h       | 1 +
 target/i386/hvf/hvf-i386.h | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
include/sysemu/hvf.h +1 -0
index d3bed80ea8..760d6c79a2 100644
@@ -35,6 +35,7 @@ void hvf_vcpu_destroy(CPUState *);
 
 #define TYPE_HVF_ACCEL ACCEL_CLASS_NAME("hvf")
 
+typedef struct HVFState HVFState;
 #define HVF_STATE(obj) \
     OBJECT_CHECK(HVFState, (obj), TYPE_HVF_ACCEL)
 
target/i386/hvf/hvf-i386.h +2 -2
index ef20c73eca..e0edffd077 100644
@@ -57,13 +57,13 @@ typedef struct hvf_vcpu_caps {
     uint64_t vmx_cap_preemption_timer;
 } hvf_vcpu_caps;
 
-typedef struct HVFState {
+struct HVFState {
     AccelState parent;
     hvf_slot slots[32];
     int num_slots;
 
     hvf_vcpu_caps *hvf_caps;
-} HVFState;
+};
 extern HVFState *hvf_state;
 
 void hvf_set_phys_mem(MemoryRegionSection *, bool);
Signature · 1 line
2.26.2
Reviewed-by on v1 19/41
#54 lore raw

Re: [PATCH 19/41] hvf: Move HVFState typedef to hvf.h

Quoted 8 lines · Eduardo Habkost

Move typedef closer to the type check macros, to make it easier to convert the code to OBJECT_DEFINE_TYPE() in the future.

---
 include/sysemu/hvf.h       | 1 +
 target/i386/hvf/hvf-i386.h | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#55 lore raw

PATCH 20/41 mcf_fec: Move mcf_fec_state typedef to header

In reply to Eduardo Habkost

Move typedef closer to the type check macros, to make it easier to convert the code to OBJECT_DEFINE_TYPE() in the future.

---
 include/hw/m68k/mcf_fec.h | 1 +
 hw/net/mcf_fec.c          | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
include/hw/m68k/mcf_fec.h +1 -0
index eeb471f9c9..c09e33a57c 100644
@@ -11,6 +11,7 @@
 #define HW_M68K_MCF_FEC_H
 
 #define TYPE_MCF_FEC_NET "mcf-fec"
+typedef struct mcf_fec_state mcf_fec_state;
 #define MCF_FEC_NET(obj) OBJECT_CHECK(mcf_fec_state, (obj), TYPE_MCF_FEC_NET)
 
 #define FEC_NUM_IRQ 13
hw/net/mcf_fec.c +2 -2
index 281345862c..25e3e453ab 100644
@@ -32,7 +32,7 @@ do { printf("mcf_fec: " fmt , ## __VA_ARGS__); } while (0)
 #define FEC_MAX_FRAME_SIZE 2032
 #define FEC_MIB_SIZE 64
 
-typedef struct {
+struct mcf_fec_state {
     SysBusDevice parent_obj;
 
     MemoryRegion iomem;
@@ -56,7 +56,7 @@ typedef struct {
     uint32_t etdsr;
     uint32_t emrbr;
     uint32_t mib[FEC_MIB_SIZE];
-} mcf_fec_state;
+};
 
 #define FEC_INT_HB   0x80000000
 #define FEC_INT_BABR 0x40000000
Signature · 1 line
2.26.2
Reviewed-by on v1 20/41
#56 lore raw

Re: [PATCH 20/41] mcf_fec: Move mcf_fec_state typedef to header

Quoted 8 lines · Eduardo Habkost

Move typedef closer to the type check macros, to make it easier to convert the code to OBJECT_DEFINE_TYPE() in the future.

---
 include/hw/m68k/mcf_fec.h | 1 +
 hw/net/mcf_fec.c          | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#57 lore raw

PATCH 21/41 s390_flic: Move KVMS390FLICState typedef to header

In reply to Eduardo Habkost

Move typedef closer to the type check macros, to make it easier to convert the code to OBJECT_DEFINE_TYPE() in the future.

---
 include/hw/s390x/s390_flic.h | 1 +
 hw/intc/s390_flic_kvm.c      | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
include/hw/s390x/s390_flic.h +1 -0
index 4687ecfe83..df11de9b20 100644
@@ -75,6 +75,7 @@ typedef struct S390FLICStateClass {
 } S390FLICStateClass;
 
 #define TYPE_KVM_S390_FLIC "s390-flic-kvm"
+typedef struct KVMS390FLICState KVMS390FLICState;
 #define KVM_S390_FLIC(obj) \
     OBJECT_CHECK(KVMS390FLICState, (obj), TYPE_KVM_S390_FLIC)
 
hw/intc/s390_flic_kvm.c +2 -2
index a306b26faa..dbd4e682ce 100644
@@ -29,12 +29,12 @@
 #define FLIC_FAILED (-1UL)
 #define FLIC_SAVEVM_VERSION 1
 
-typedef struct KVMS390FLICState {
+struct KVMS390FLICState{
     S390FLICState parent_obj;
 
     uint32_t fd;
     bool clear_io_supported;
-} KVMS390FLICState;
+};
 
 static KVMS390FLICState *s390_get_kvm_flic(S390FLICState *fs)
 {
Signature · 1 line
2.26.2
Acked-by on v1 21/41
#58 lore raw

Re: [PATCH 21/41] s390_flic: Move KVMS390FLICState typedef to header

Quoted 8 lines · On Thu, 13 Aug 2020 18:26:05 -0400 Eduardo Habkost <[email protected]> wrote:

Move typedef closer to the type check macros, to make it easier to convert the code to OBJECT_DEFINE_TYPE() in the future.

---
 include/hw/s390x/s390_flic.h | 1 +
 hw/intc/s390_flic_kvm.c      | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
Reviewed-by on v1 21/41
#59 lore raw

Re: [PATCH 21/41] s390_flic: Move KVMS390FLICState typedef to header

In reply to Eduardo Habkost
Quoted 8 lines · Eduardo Habkost

Move typedef closer to the type check macros, to make it easier to convert the code to OBJECT_DEFINE_TYPE() in the future.

---
 include/hw/s390x/s390_flic.h | 1 +
 hw/intc/s390_flic_kvm.c      | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#60 lore raw

PATCH 22/41 can_emu: Delete macros for non-existing typedef

In reply to Eduardo Habkost

CanBusClass doesn't exist. This will break when we automatically convert the code to use OBJECT_DEFINE_TYPE(). Delete the macros that reference the non-existing typedef.

---
 include/net/can_emu.h | 4 ----
 1 file changed, 4 deletions(-)
include/net/can_emu.h +0 -4
index fce9770928..7e90fd8a45 100644
@@ -100,10 +100,6 @@ struct CanBusClientState {
 };
 
 #define TYPE_CAN_BUS "can-bus"
-#define CAN_BUS_CLASS(klass) \
-     OBJECT_CLASS_CHECK(CanBusClass, (klass), TYPE_CAN_BUS)
-#define CAN_BUS_GET_CLASS(obj) \
-     OBJECT_GET_CLASS(CanBusClass, (obj), TYPE_CAN_BUS)
 #define CAN_BUS(obj) \
      OBJECT_CHECK(CanBusState, (obj), TYPE_CAN_BUS)
 
Signature · 1 line
2.26.2
Reviewed-by on v1 22/41
#61 lore raw

Re: [PATCH 22/41] can_emu: Delete macros for non-existing typedef

Quoted 5 lines · Eduardo Habkost

CanBusClass doesn't exist. This will break when we automatically convert the code to use OBJECT_DEFINE_TYPE(). Delete the macros that reference the non-existing typedef.

Quoted 20 lines
---
 include/net/can_emu.h | 4 ----
 1 file changed, 4 deletions(-)
include/net/can_emu.h +0 -4
index fce9770928..7e90fd8a45 100644
@@ -100,10 +100,6 @@ struct CanBusClientState {
 };
 
 #define TYPE_CAN_BUS "can-bus"
-#define CAN_BUS_CLASS(klass) \
-     OBJECT_CLASS_CHECK(CanBusClass, (klass), TYPE_CAN_BUS)
-#define CAN_BUS_GET_CLASS(obj) \
-     OBJECT_GET_CLASS(CanBusClass, (obj), TYPE_CAN_BUS)
 #define CAN_BUS(obj) \
      OBJECT_CHECK(CanBusState, (obj), TYPE_CAN_BUS)
 
Reviewed-by on v1 22/41
#62 lore raw

Re: [PATCH 22/41] can_emu: Delete macros for non-existing typedef

In reply to Eduardo Habkost
Quoted 8 lines · Eduardo Habkost

CanBusClass doesn't exist. This will break when we automatically convert the code to use OBJECT_DEFINE_TYPE(). Delete the macros that reference the non-existing typedef.

---
 include/net/can_emu.h | 4 ----
 1 file changed, 4 deletions(-)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#63 lore raw

PATCH 23/41 nubus: Delete unused NUBUS_BRIDGE macro

In reply to Eduardo Habkost

The macro never worked because the NubusBridge typedef doesn't exist. Delete it.

---
 include/hw/nubus/nubus.h | 1 -
 1 file changed, 1 deletion(-)
include/hw/nubus/nubus.h +0 -1
index a8634e54c5..c350948262 100644
@@ -29,7 +29,6 @@
 #define NUBUS_BUS(obj) OBJECT_CHECK(NubusBus, (obj), TYPE_NUBUS_BUS)
 
 #define TYPE_NUBUS_BRIDGE "nubus-bridge"
-#define NUBUS_BRIDGE(obj) OBJECT_CHECK(NubusBridge, (obj), TYPE_NUBUS_BRIDGE)
 
 typedef struct NubusBus {
     BusState qbus;
Signature · 1 line
2.26.2
Reviewed-by on v1 23/41
#64 lore raw

Re: [PATCH 23/41] nubus: Delete unused NUBUS_BRIDGE macro

Quoted 4 lines · Eduardo Habkost

The macro never worked because the NubusBridge typedef doesn't exist. Delete it.

Quoted 17 lines
---
 include/hw/nubus/nubus.h | 1 -
 1 file changed, 1 deletion(-)
include/hw/nubus/nubus.h +0 -1
index a8634e54c5..c350948262 100644
@@ -29,7 +29,6 @@
 #define NUBUS_BUS(obj) OBJECT_CHECK(NubusBus, (obj), TYPE_NUBUS_BUS)
 
 #define TYPE_NUBUS_BRIDGE "nubus-bridge"
-#define NUBUS_BRIDGE(obj) OBJECT_CHECK(NubusBridge, (obj), TYPE_NUBUS_BRIDGE)
 
 typedef struct NubusBus {
     BusState qbus;
Reviewed-by on v1 23/41
#65 lore raw

Re: [PATCH 23/41] nubus: Delete unused NUBUS_BRIDGE macro

In reply to Eduardo Habkost
Quoted 7 lines · Eduardo Habkost

The macro never worked because the NubusBridge typedef doesn't exist. Delete it.

---
 include/hw/nubus/nubus.h | 1 -
 1 file changed, 1 deletion(-)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#66 lore raw

PATCH 24/41 platform-bus: Delete macros for non-existing typedef

In reply to Eduardo Habkost

PlatformBusDeviceClass doesn't exist. This will break when we automatically convert the code to use OBJECT_DEFINE_TYPE(). Delete the macros that reference the non-existing typedef.

---
 include/hw/platform-bus.h | 4 ----
 1 file changed, 4 deletions(-)
include/hw/platform-bus.h +0 -4
index 19e20c57ce..33745a418e 100644
@@ -29,10 +29,6 @@ typedef struct PlatformBusDevice PlatformBusDevice;
 #define TYPE_PLATFORM_BUS_DEVICE "platform-bus-device"
 #define PLATFORM_BUS_DEVICE(obj) \
      OBJECT_CHECK(PlatformBusDevice, (obj), TYPE_PLATFORM_BUS_DEVICE)
-#define PLATFORM_BUS_DEVICE_CLASS(klass) \
-     OBJECT_CLASS_CHECK(PlatformBusDeviceClass, (klass), TYPE_PLATFORM_BUS_DEVICE)
-#define PLATFORM_BUS_DEVICE_GET_CLASS(obj) \
-     OBJECT_GET_CLASS(PlatformBusDeviceClass, (obj), TYPE_PLATFORM_BUS_DEVICE)
 
 struct PlatformBusDevice {
     /*< private >*/
Signature · 1 line
2.26.2
Reviewed-by on v1 24/41
#67 lore raw

Re: [PATCH 24/41] platform-bus: Delete macros for non-existing typedef

Quoted 8 lines · Eduardo Habkost

PlatformBusDeviceClass doesn't exist. This will break when we automatically convert the code to use OBJECT_DEFINE_TYPE(). Delete the macros that reference the non-existing typedef.

---
 include/hw/platform-bus.h | 4 ----
 1 file changed, 4 deletions(-)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#68 lore raw

PATCH 25/41 qom: make object_ref/unref use a void * instead of Object *.

In reply to Eduardo Habkost

From: Daniel P. Berrangé <[email protected]>

The object_ref/unref methods are intended for use with any subclass of the base Object. Using "Object *" in the signature is not adding any meaningful level of type safety, since callers simply use "OBJECT(ptr)" and this expands to an unchecked cast "(Object *)".

By using "void *" we enable the object_unref() method to be used to provide support for g_autoptr() with any subclass.

Message-Id: <[email protected]>

---
 include/qom/object.h | 4 ++--
 qom/object.c         | 6 ++++--
 2 files changed, 6 insertions(+), 4 deletions(-)
include/qom/object.h +2 -2
index 0f3a60617c..1f8aa2d48e 100644
@@ -1035,7 +1035,7 @@ GSList *object_class_get_list_sorted(const char *implements_type,
  * as its reference count is greater than zero.
  * Returns: @obj
  */
-Object *object_ref(Object *obj);
+Object *object_ref(void *obj);
 
 /**
  * object_unref:
@@ -1044,7 +1044,7 @@ Object *object_ref(Object *obj);
  * Decrease the reference count of a object.  A object cannot be freed as long
  * as its reference count is greater than zero.
  */
-void object_unref(Object *obj);
+void object_unref(void *obj);
 
 /**
  * object_property_try_add:
qom/object.c +4 -2
index 00fdf89b3b..b1822a2ef4 100644
@@ -1124,8 +1124,9 @@ GSList *object_class_get_list_sorted(const char *implements_type,
                         object_class_cmp);
 }
 
-Object *object_ref(Object *obj)
+Object *object_ref(void *objptr)
 {
+    Object *obj = OBJECT(objptr);
     if (!obj) {
         return NULL;
     }
@@ -1133,8 +1134,9 @@ Object *object_ref(Object *obj)
     return obj;
 }
 
-void object_unref(Object *obj)
+void object_unref(void *objptr)
 {
+    Object *obj = OBJECT(objptr);
     if (!obj) {
         return;
     }
Signature · 1 line
2.26.2
#69 lore raw

PATCH 26/41 qom: provide convenient macros for declaring and defining types

In reply to Eduardo Habkost

From: Daniel P. Berrangé <[email protected]>

When creating new QOM types, there is a lot of boilerplate code that must be repeated using a standard pattern. This is tedious to write and liable to suffer from subtle inconsistencies. Thus it would benefit from some simple automation.

QOM was loosely inspired by GLib's GObject, and indeed GObject suffers from the same burden of boilerplate code, but has long provided a set of macros to eliminate this burden in the source implementation. More recently it has also provided a set of macros to eliminate this burden in the header declaration.

In GLib there are the G_DECLARE_* and G_DEFINE_* family of macros for the header declaration and source implementation respectively:

https://developer.gnome.org/gobject/stable/chapter-gobject.html
https://developer.gnome.org/gobject/stable/howto-gobject.html

This patch takes inspiration from GObject to provide the equivalent functionality for QOM.

In the header file, instead of:

    typedef struct MyDevice MyDevice;
    typedef struct MyDeviceClass MyDeviceClass;

    G_DEFINE_AUTOPTR_CLEANUP_FUNC(MyDeviceClass, object_unref)

    #define MY_DEVICE_GET_CLASS(void *obj) \
            OBJECT_GET_CLASS(MyDeviceClass, obj, TYPE_MY_DEVICE)
    #define MY_DEVICE_CLASS(void *klass) \
            OBJECT_CLASS_CHECK(MyDeviceClass, klass, TYPE_MY_DEVICE)
    #define MY_DEVICE(void *obj)
            OBJECT_CHECK(MyDevice, obj, TYPE_MY_DEVICE)

    struct MyDeviceClass {
        DeviceClass parent_class;
    };

We now have

OBJECT_DECLARE_SIMPLE_TYPE(MyDevice, my_device, MY_DEVICE, DEVICE)

In cases where the class needs some virtual methods, it can be left to be implemented manually using

OBJECT_DECLARE_TYPE(MyDevice, my_device, MY_DEVICE)

Note that these macros are including support for g_autoptr() for the object types, which is something previously only supported for variables declared as the base Object * type.

Meanwhile in the source file, instead of:

    static void my_device_finalize(Object *obj);
    static void my_device_class_init(ObjectClass *oc, void *data);
    static void my_device_init(Object *obj);

    static const TypeInfo my_device_info = {
        .parent = TYPE_DEVICE,
        .name = TYPE_MY_DEVICE,
        .instance_size = sizeof(MyDevice),
        .instance_init = my_device_init,
        .instance_finalize = my_device_finalize,
        .class_size = sizeof(MyDeviceClass),
        .class_init = my_device_class_init,
    };

    static void
    my_device_register_types(void)
    {
        type_register_static(&my_device_info);
    }
    type_init(my_device_register_types);

We now have

OBJECT_DEFINE_TYPE(MyDevice, my_device, MY_DEVICE, DEVICE)

Or, if a class needs to implement interfaces:

OBJECT_DEFINE_TYPE_WITH_INTERFACES(MyDevice, my_device, MY_DEVICE, DEVICE,
{ TYPE_USER_CREATABLE }, { NULL })

Or, if a class needs to be abstract

OBJECT_DEFINE_ABSTRACT_TYPE(MyDevice, my_device, MY_DEVICE, DEVICE)

IOW, in both cases the maintainer now only has to think about the interesting part of the code which implements useful functionality and avoids much of the boilerplate.

Message-Id: <[email protected]>

---
 include/qom/object.h | 277 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 277 insertions(+)
include/qom/object.h +277 -0
index 1f8aa2d48e..be64421089 100644
@@ -304,6 +304,119 @@ typedef struct InterfaceInfo InterfaceInfo;
  *
  * The first example of such a QOM method was #CPUClass.reset,
  * another example is #DeviceClass.realize.
+ *
+ * # Standard type declaration and definition macros #
+ *
+ * A lot of the code outlined above follows a standard pattern and naming
+ * convention. To reduce the amount of boilerplate code that needs to be
+ * written for a new type there are two sets of macros to generate the
+ * common parts in a standard format.
+ *
+ * A type is declared using the OBJECT_DECLARE macro family. In types
+ * which do not require any virtual functions in the class, the
+ * OBJECT_DECLARE_SIMPLE_TYPE macro is suitable, and is commonly placed
+ * in the header file:
+ *
+ * <example>
+ *   <title>Declaring a simple type</title>
+ *   <programlisting>
+ *     OBJECT_DECLARE_SIMPLE_TYPE(MyDevice, my_device, MY_DEVICE, DEVICE)
+ *   </programlisting>
+ * </example>
+ *
+ * This is equivalent to the following:
+ *
+ * <example>
+ *   <title>Expansion from declaring a simple type</title>
+ *   <programlisting>
+ *     typedef struct MyDevice MyDevice;
+ *     typedef struct MyDeviceClass MyDeviceClass;
+ *
+ *     G_DEFINE_AUTOPTR_CLEANUP_FUNC(MyDeviceClass, object_unref)
+ *
+ *     #define MY_DEVICE_GET_CLASS(void *obj) \
+ *             OBJECT_GET_CLASS(MyDeviceClass, obj, TYPE_MY_DEVICE)
+ *     #define MY_DEVICE_CLASS(void *klass) \
+ *             OBJECT_CLASS_CHECK(MyDeviceClass, klass, TYPE_MY_DEVICE)
+ *     #define MY_DEVICE(void *obj)
+ *             OBJECT_CHECK(MyDevice, obj, TYPE_MY_DEVICE)
+ *
+ *     struct MyDeviceClass {
+ *         DeviceClass parent_class;
+ *     };
+ *   </programlisting>
+ * </example>
+ *
+ * The 'struct MyDevice' needs to be declared separately.
+ * If the type requires virtual functions to be declared in the class
+ * struct, then the alternative OBJECT_DECLARE_TYPE() macro can be
+ * used. This does the same as OBJECT_DECLARE_SIMPLE_TYPE(), but without
+ * the 'struct MyDeviceClass' definition.
+ *
+ * To implement the type, the OBJECT_DEFINE macro family is available.
+ * In the simple case the OBJECT_DEFINE_TYPE macro is suitable:
+ *
+ * <example>
+ *   <title>Defining a simple type</title>
+ *   <programlisting>
+ *     OBJECT_DEFINE_TYPE(MyDevice, my_device, MY_DEVICE, DEVICE)
+ *   </programlisting>
+ * </example>
+ *
+ * This is equivalent to the following:
+ *
+ * <example>
+ *   <title>Expansion from defining a simple type</title>
+ *   <programlisting>
+ *     static void my_device_finalize(Object *obj);
+ *     static void my_device_class_init(ObjectClass *oc, void *data);
+ *     static void my_device_init(Object *obj);
+ *
+ *     static const TypeInfo my_device_info = {
+ *         .parent = TYPE_DEVICE,
+ *         .name = TYPE_MY_DEVICE,
+ *         .instance_size = sizeof(MyDevice),
+ *         .instance_init = my_device_init,
+ *         .instance_finalize = my_device_finalize,
+ *         .class_size = sizeof(MyDeviceClass),
+ *         .class_init = my_device_class_init,
+ *     };
+ *
+ *     static void
+ *     my_device_register_types(void)
+ *     {
+ *         type_register_static(&my_device_info);
+ *     }
+ *     type_init(my_device_register_types);
+ *   </programlisting>
+ * </example>
+ *
+ * This is sufficient to get the type registered with the type
+ * system, and the three standard methods now need to be implemented
+ * along with any other logic required for the type.
+ *
+ * If the type needs to implement one or more interfaces, then the
+ * OBJECT_DEFINE_TYPE_WITH_INTERFACES() macro can be used instead.
+ * This accepts an array of interface type names.
+ *
+ * <example>
+ *   <title>Defining a simple type implementing interfaces</title>
+ *   <programlisting>
+ *     OBJECT_DEFINE_TYPE_WITH_INTERFACES(MyDevice, my_device,
+ *                                        MY_DEVICE, DEVICE,
+ *                                        { TYPE_USER_CREATABLE }, { NULL })
+ *   </programlisting>
+ * </example>
+ *
+ * If the type is not intended to be instantiated, then then
+ * the OBJECT_DEFINE_ABSTRACT_TYPE() macro can be used instead:
+ *
+ * <example>
+ *   <title>Defining a simple type</title>
+ *   <programlisting>
+ *     OBJECT_DEFINE_ABSTRACT_TYPE(MyDevice, my_device, MY_DEVICE, DEVICE)
+ *   </programlisting>
+ * </example>
  */
 
 
@@ -440,6 +553,170 @@ struct Object
     Object *parent;
 };
 
+/**
+ * OBJECT_DECLARE_TYPE:
+ * @ModuleObjName: the object name with initial capitalization
+ * @module_obj_name: the object name in lowercase with underscore separators
+ * @MODULE_OBJ_NAME: the object name in uppercase with underscore separators
+ *
+ * This macro is typically used in a header file, and will:
+ *
+ *   - create the typedefs for the object and class structs
+ *   - register the type for use with g_autoptr
+ *   - provide three standard type cast functions
+ *
+ * The object struct and class struct need to be declared manually.
+ */
+#define OBJECT_DECLARE_TYPE(ModuleObjName, module_obj_name, MODULE_OBJ_NAME) \
+    typedef struct ModuleObjName ModuleObjName; \
+    typedef struct ModuleObjName##Class ModuleObjName##Class; \
+    \
+    G_DEFINE_AUTOPTR_CLEANUP_FUNC(ModuleObjName##Class, object_unref) \
+    \
+    static inline G_GNUC_UNUSED ModuleObjName##Class * \
+    MODULE_OBJ_NAME##_GET_CLASS(void *obj) \
+    { return OBJECT_GET_CLASS(ModuleObjName##Class, obj, \
+                              TYPE_##MODULE_OBJ_NAME); } \
+    \
+    static inline G_GNUC_UNUSED ModuleObjName##Class * \
+    MODULE_OBJ_NAME##_CLASS(void *klass) \
+    { return OBJECT_CLASS_CHECK(ModuleObjName##Class, klass, \
+                                TYPE_##MODULE_OBJ_NAME); } \
+    \
+    static inline G_GNUC_UNUSED ModuleObjName * \
+    MODULE_OBJ_NAME(void *obj) \
+    { return OBJECT_CHECK(ModuleObjName, obj, \
+                          TYPE_##MODULE_OBJ_NAME); }
+
+/**
+ * OBJECT_DECLARE_SIMPLE_TYPE:
+ * @ModuleObjName: the object name with initial caps
+ * @module_obj_name: the object name in lowercase with underscore separators
+ * @MODULE_OBJ_NAME: the object name in uppercase with underscore separators
+ * @ParentModuleObjName: the parent object name with initial caps
+ *
+ * This does the same as OBJECT_DECLARE_TYPE(), but also declares
+ * the class struct, thus only the object struct needs to be declare
+ * manually.
+ *
+ * This macro should be used unless the class struct needs to have
+ * virtual methods declared.
+ */
+#define OBJECT_DECLARE_SIMPLE_TYPE(ModuleObjName, module_obj_name, \
+                                   MODULE_OBJ_NAME, ParentModuleObjName) \
+    OBJECT_DECLARE_TYPE(ModuleObjName, module_obj_name, MODULE_OBJ_NAME) \
+    struct ModuleObjName##Class { ParentModuleObjName##Class parent_class; };
+
+
+/**
+ * OBJECT_DEFINE_TYPE_EXTENDED:
+ * @ModuleObjName: the object name with initial caps
+ * @module_obj_name: the object name in lowercase with underscore separators
+ * @MODULE_OBJ_NAME: the object name in uppercase with underscore separators
+ * @PARENT_MODULE_OBJ_NAME: the parent object name in uppercase with underscore
+ *                          separators
+ * @ABSTRACT: boolean flag to indicate whether the object can be instantiated
+ * @...: list of initializers for "InterfaceInfo" to declare implemented interfaces
+ *
+ * This macro is typically used in a source file, and will:
+ *
+ *   - declare prototypes for _finalize, _class_init and _init methods
+ *   - declare the TypeInfo struct instance
+ *   - provide the constructor to register the type
+ *
+ * After using this macro, implementations of the _finalize, _class_init,
+ * and _init methods need to be written. Any of these can be zero-line
+ * no-op impls if no special logic is required for a given type.
+ *
+ * This macro should rarely be used, instead one of the more specialized
+ * macros is usually a better choice.
+ */
+#define OBJECT_DEFINE_TYPE_EXTENDED(ModuleObjName, module_obj_name, \
+                                    MODULE_OBJ_NAME, PARENT_MODULE_OBJ_NAME, \
+                                    ABSTRACT, ...) \
+    static void \
+    module_obj_name##_finalize(Object *obj); \
+    static void \
+    module_obj_name##_class_init(ObjectClass *oc, void *data); \
+    static void \
+    module_obj_name##_init(Object *obj); \
+    \
+    static const TypeInfo module_obj_name##_info = { \
+        .parent = TYPE_##PARENT_MODULE_OBJ_NAME, \
+        .name = TYPE_##MODULE_OBJ_NAME, \
+        .instance_size = sizeof(ModuleObjName), \
+        .instance_init = module_obj_name##_init, \
+        .instance_finalize = module_obj_name##_finalize, \
+        .class_size = sizeof(ModuleObjName##Class), \
+        .class_init = module_obj_name##_class_init, \
+        .abstract = ABSTRACT, \
+        .interfaces = (InterfaceInfo[]) { __VA_ARGS__ } , \
+    }; \
+    \
+    static void \
+    module_obj_name##_register_types(void) \
+    { \
+        type_register_static(&module_obj_name##_info); \
+    } \
+    type_init(module_obj_name##_register_types);
+
+/**
+ * OBJECT_DEFINE_TYPE:
+ * @ModuleObjName: the object name with initial caps
+ * @module_obj_name: the object name in lowercase with underscore separators
+ * @MODULE_OBJ_NAME: the object name in uppercase with underscore separators
+ * @PARENT_MODULE_OBJ_NAME: the parent object name in uppercase with underscore
+ *                          separators
+ *
+ * This is a specialization of OBJECT_DEFINE_TYPE_EXTENDED, which is suitable
+ * for the common case of a non-abstract type, without any interfaces.
+ */
+#define OBJECT_DEFINE_TYPE(ModuleObjName, module_obj_name, MODULE_OBJ_NAME, \
+                           PARENT_MODULE_OBJ_NAME) \
+    OBJECT_DEFINE_TYPE_EXTENDED(ModuleObjName, module_obj_name, \
+                                MODULE_OBJ_NAME, PARENT_MODULE_OBJ_NAME, \
+                                false, { NULL })
+
+/**
+ * OBJECT_DEFINE_TYPE_WITH_INTERFACES:
+ * @ModuleObjName: the object name with initial caps
+ * @module_obj_name: the object name in lowercase with underscore separators
+ * @MODULE_OBJ_NAME: the object name in uppercase with underscore separators
+ * @PARENT_MODULE_OBJ_NAME: the parent object name in uppercase with underscore
+ *                          separators
+ * @...: list of initializers for "InterfaceInfo" to declare implemented interfaces
+ *
+ * This is a specialization of OBJECT_DEFINE_TYPE_EXTENDED, which is suitable
+ * for the common case of a non-abstract type, with one or more implemented
+ * interfaces.
+ *
+ * Note when passing the list of interfaces, be sure to include the final
+ * NULL entry, e.g.  { TYPE_USER_CREATABLE }, { NULL }
+ */
+#define OBJECT_DEFINE_TYPE_WITH_INTERFACES(ModuleObjName, module_obj_name, \
+                                           MODULE_OBJ_NAME, \
+                                           PARENT_MODULE_OBJ_NAME, ...) \
+    OBJECT_DEFINE_TYPE_EXTENDED(ModuleObjName, module_obj_name, \
+                                MODULE_OBJ_NAME, PARENT_MODULE_OBJ_NAME, \
+                                false, __VA_ARGS__)
+
+/**
+ * OBJECT_DEFINE_ABSTRACT_TYPE:
+ * @ModuleObjName: the object name with initial caps
+ * @module_obj_name: the object name in lowercase with underscore separators
+ * @MODULE_OBJ_NAME: the object name in uppercase with underscore separators
+ * @PARENT_MODULE_OBJ_NAME: the parent object name in uppercase with underscore
+ *                          separators
+ *
+ * This is a specialization of OBJECT_DEFINE_TYPE_EXTENDED, which is suitable
+ * for defining an abstract type, without any interfaces.
+ */
+#define OBJECT_DEFINE_ABSTRACT_TYPE(ModuleObjName, module_obj_name, \
+                                    MODULE_OBJ_NAME, PARENT_MODULE_OBJ_NAME) \
+    OBJECT_DEFINE_TYPE_EXTENDED(ModuleObjName, module_obj_name, \
+                                MODULE_OBJ_NAME, PARENT_MODULE_OBJ_NAME, \
+                                true, { NULL })
+
 /**
  * TypeInfo:
  * @name: The name of the type.
Signature · 1 line
2.26.2
#70 lore raw

PATCH 27/41 qom: Fix G_DEFINE_AUTOPTR_CLEANUP_FUNC

In reply to Eduardo Habkost

ModuleObjName##Class was being used instead of ModuleObjName. Fix it.

---
 include/qom/object.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/qom/object.h +1 -1
index be64421089..f515230f61 100644
@@ -571,7 +571,7 @@ struct Object
     typedef struct ModuleObjName ModuleObjName; \
     typedef struct ModuleObjName##Class ModuleObjName##Class; \
     \
-    G_DEFINE_AUTOPTR_CLEANUP_FUNC(ModuleObjName##Class, object_unref) \
+    G_DEFINE_AUTOPTR_CLEANUP_FUNC(ModuleObjName, object_unref) \
     \
     static inline G_GNUC_UNUSED ModuleObjName##Class * \
     MODULE_OBJ_NAME##_GET_CLASS(void *obj) \
Signature · 1 line
2.26.2
Reviewed-by on v1 27/41
#71 lore raw

Re: [PATCH 27/41] qom: Fix G_DEFINE_AUTOPTR_CLEANUP_FUNC

Quoted 7 lines · Eduardo Habkost

ModuleObjName##Class was being used instead of ModuleObjName. Fix it.

---
 include/qom/object.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

though I'd suggest just squashing it into the original buggy patch.

Quoted 17 lines
include/qom/object.h +1 -1
index be64421089..f515230f61 100644
@@ -571,7 +571,7 @@ struct Object
     typedef struct ModuleObjName ModuleObjName; \
     typedef struct ModuleObjName##Class ModuleObjName##Class; \
     \
-    G_DEFINE_AUTOPTR_CLEANUP_FUNC(ModuleObjName##Class, object_unref) \
+    G_DEFINE_AUTOPTR_CLEANUP_FUNC(ModuleObjName, object_unref) \
     \
     static inline G_GNUC_UNUSED ModuleObjName##Class * \
     MODULE_OBJ_NAME##_GET_CLASS(void *obj) \
Signature · 1 line
2.26.2

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#72 lore raw

PATCH 28/41 qom: Allow class type name to be specified in OBJECT_DECLARE*

In reply to Eduardo Habkost

Many QOM types don't follow the Type/TypeClass pattern on the instance/struct names. Let the class struct name be specified in the OBJECT_DECLARE* macros.

---
 include/qom/object.h | 35 ++++++++++++++++++-----------------
 1 file changed, 18 insertions(+), 17 deletions(-)
include/qom/object.h +18 -17
index f515230f61..500e7dfa99 100644
@@ -555,7 +555,8 @@ struct Object
 
 /**
  * OBJECT_DECLARE_TYPE:
- * @ModuleObjName: the object name with initial capitalization
+ * @InstanceType: instance struct name
+ * @ClassType: class struct name
  * @module_obj_name: the object name in lowercase with underscore separators
  * @MODULE_OBJ_NAME: the object name in uppercase with underscore separators
  *
@@ -567,33 +568,33 @@ struct Object
  *
  * The object struct and class struct need to be declared manually.
  */
-#define OBJECT_DECLARE_TYPE(ModuleObjName, module_obj_name, MODULE_OBJ_NAME) \
-    typedef struct ModuleObjName ModuleObjName; \
-    typedef struct ModuleObjName##Class ModuleObjName##Class; \
+#define OBJECT_DECLARE_TYPE(InstanceType, ClassType, module_obj_name, MODULE_OBJ_NAME) \
+    typedef struct InstanceType InstanceType; \
+    typedef struct ClassType ClassType; \
     \
-    G_DEFINE_AUTOPTR_CLEANUP_FUNC(ModuleObjName, object_unref) \
+    G_DEFINE_AUTOPTR_CLEANUP_FUNC(InstanceType, object_unref) \
     \
-    static inline G_GNUC_UNUSED ModuleObjName##Class * \
+    static inline G_GNUC_UNUSED ClassType * \
     MODULE_OBJ_NAME##_GET_CLASS(void *obj) \
-    { return OBJECT_GET_CLASS(ModuleObjName##Class, obj, \
+    { return OBJECT_GET_CLASS(ClassType, obj, \
                               TYPE_##MODULE_OBJ_NAME); } \
     \
-    static inline G_GNUC_UNUSED ModuleObjName##Class * \
+    static inline G_GNUC_UNUSED ClassType * \
     MODULE_OBJ_NAME##_CLASS(void *klass) \
-    { return OBJECT_CLASS_CHECK(ModuleObjName##Class, klass, \
+    { return OBJECT_CLASS_CHECK(ClassType, klass, \
                                 TYPE_##MODULE_OBJ_NAME); } \
     \
-    static inline G_GNUC_UNUSED ModuleObjName * \
+    static inline G_GNUC_UNUSED InstanceType * \
     MODULE_OBJ_NAME(void *obj) \
-    { return OBJECT_CHECK(ModuleObjName, obj, \
+    { return OBJECT_CHECK(InstanceType, obj, \
                           TYPE_##MODULE_OBJ_NAME); }
 
 /**
  * OBJECT_DECLARE_SIMPLE_TYPE:
- * @ModuleObjName: the object name with initial caps
+ * @InstanceType: instance struct name
  * @module_obj_name: the object name in lowercase with underscore separators
  * @MODULE_OBJ_NAME: the object name in uppercase with underscore separators
- * @ParentModuleObjName: the parent object name with initial caps
+ * @ParentClassType: class struct name of parent type
  *
  * This does the same as OBJECT_DECLARE_TYPE(), but also declares
  * the class struct, thus only the object struct needs to be declare
@@ -602,10 +603,10 @@ struct Object
  * This macro should be used unless the class struct needs to have
  * virtual methods declared.
  */
-#define OBJECT_DECLARE_SIMPLE_TYPE(ModuleObjName, module_obj_name, \
-                                   MODULE_OBJ_NAME, ParentModuleObjName) \
-    OBJECT_DECLARE_TYPE(ModuleObjName, module_obj_name, MODULE_OBJ_NAME) \
-    struct ModuleObjName##Class { ParentModuleObjName##Class parent_class; };
+#define OBJECT_DECLARE_SIMPLE_TYPE(InstanceType, module_obj_name, \
+                                   MODULE_OBJ_NAME, ParentClassType) \
+    OBJECT_DECLARE_TYPE(InstanceType, InstanceType##Class, module_obj_name, MODULE_OBJ_NAME) \
+    struct InstanceType##Class { ParentClassType parent_class; };
 
 
 /**
Signature · 1 line
2.26.2
Reviewed-by on v1 28/41
#73 lore raw

Re: [PATCH 28/41] qom: Allow class type name to be specified in OBJECT_DECLARE*

Quoted 8 lines · Eduardo Habkost

Many QOM types don't follow the Type/TypeClass pattern on the instance/struct names. Let the class struct name be specified in the OBJECT_DECLARE* macros.

---
 include/qom/object.h | 35 ++++++++++++++++++-----------------
 1 file changed, 18 insertions(+), 17 deletions(-)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#74 lore raw

PATCH 29/41 qom: DECLARE_*_CHECKERS macros

In reply to Eduardo Habkost

Sometimes the typedefs are buried inside another header, but we want to benefit from the automatic definition of type cast functions. Introduce macros that will let type checkers be defined when typedefs are already available.

---
 include/qom/object.h | 72 +++++++++++++++++++++++++++++++++++---------
 1 file changed, 58 insertions(+), 14 deletions(-)
include/qom/object.h +58 -14
index 500e7dfa99..4cd84998c2 100644
@@ -553,6 +553,62 @@ struct Object
     Object *parent;
 };
 
+/**
+ * DECLARE_INSTANCE_CHECKER:
+ * @InstanceType: instance struct name
+ * @OBJ_NAME: the object name in uppercase with underscore separators
+ * @TYPENAME: type name
+ *
+ * Direct usage of this macro should be avoided, and the complete
+ * OBJECT_DECLARE_TYPE macro is recommended instead.
+ *
+ * This macro will provide the three standard type cast functions for a
+ * QOM type.
+ */
+#define DECLARE_INSTANCE_CHECKER(InstanceType, OBJ_NAME, TYPENAME) \
+    static inline G_GNUC_UNUSED InstanceType * \
+    OBJ_NAME(void *obj) \
+    { return OBJECT_CHECK(InstanceType, obj, TYPENAME); }
+
+/**
+ * DECLARE_CLASS_CHECKERS:
+ * @ClassType: class struct name
+ * @OBJ_NAME: the object name in uppercase with underscore separators
+ * @TYPENAME: type name
+ *
+ * Direct usage of this macro should be avoided, and the complete
+ * OBJECT_DECLARE_TYPE macro is recommended instead.
+ *
+ * This macro will provide the three standard type cast functions for a
+ * QOM type.
+ */
+#define DECLARE_CLASS_CHECKERS(ClassType, OBJ_NAME, TYPENAME) \
+    static inline G_GNUC_UNUSED ClassType * \
+    OBJ_NAME##_GET_CLASS(void *obj) \
+    { return OBJECT_GET_CLASS(ClassType, obj, TYPENAME); } \
+    \
+    static inline G_GNUC_UNUSED ClassType * \
+    OBJ_NAME##_CLASS(void *klass) \
+    { return OBJECT_CLASS_CHECK(ClassType, klass, TYPENAME); }
+
+/**
+ * DECLARE_OBJ_CHECKERS:
+ * @InstanceType: instance struct name
+ * @ClassType: class struct name
+ * @OBJ_NAME: the object name in uppercase with underscore separators
+ * @TYPENAME: type name
+ *
+ * Direct usage of this macro should be avoided, and the complete
+ * OBJECT_DECLARE_TYPE macro is recommended instead.
+ *
+ * This macro will provide the three standard type cast functions for a
+ * QOM type.
+ */
+#define DECLARE_OBJ_CHECKERS(InstanceType, ClassType, OBJ_NAME, TYPENAME) \
+    DECLARE_INSTANCE_CHECKER(InstanceType, OBJ_NAME, TYPENAME) \
+    \
+    DECLARE_CLASS_CHECKERS(ClassType, OBJ_NAME, TYPENAME)
+
 /**
  * OBJECT_DECLARE_TYPE:
  * @InstanceType: instance struct name
@@ -574,20 +630,8 @@ struct Object
     \
     G_DEFINE_AUTOPTR_CLEANUP_FUNC(InstanceType, object_unref) \
     \
-    static inline G_GNUC_UNUSED ClassType * \
-    MODULE_OBJ_NAME##_GET_CLASS(void *obj) \
-    { return OBJECT_GET_CLASS(ClassType, obj, \
-                              TYPE_##MODULE_OBJ_NAME); } \
-    \
-    static inline G_GNUC_UNUSED ClassType * \
-    MODULE_OBJ_NAME##_CLASS(void *klass) \
-    { return OBJECT_CLASS_CHECK(ClassType, klass, \
-                                TYPE_##MODULE_OBJ_NAME); } \
-    \
-    static inline G_GNUC_UNUSED InstanceType * \
-    MODULE_OBJ_NAME(void *obj) \
-    { return OBJECT_CHECK(InstanceType, obj, \
-                          TYPE_##MODULE_OBJ_NAME); }
+    DECLARE_OBJ_CHECKERS(InstanceType, ClassType, \
+                         MODULE_OBJ_NAME, TYPE_##MODULE_OBJ_NAME)
 
 /**
  * OBJECT_DECLARE_SIMPLE_TYPE:
Signature · 1 line
2.26.2
Reviewed-by on v1 29/41
#75 lore raw

Re: [PATCH 29/41] qom: DECLARE_*_CHECKERS macros

Quoted 9 lines · Eduardo Habkost

Sometimes the typedefs are buried inside another header, but we want to benefit from the automatic definition of type cast functions. Introduce macros that will let type checkers be defined when typedefs are already available.

---
 include/qom/object.h | 72 +++++++++++++++++++++++++++++++++++---------
 1 file changed, 58 insertions(+), 14 deletions(-)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#76 lore raw

PATCH 30/41 qom: Make type checker functions accept const pointers

In reply to Eduardo Habkost

The existing type check macros all unconditionally drop const qualifiers from their arguments. Keep this behavior in the macros generated by DECLARE_*CHECKER* by now.

In the future, we might use _Generic to preserve const-ness of the cast function arguments.

---
 include/qom/object.h | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
include/qom/object.h +5 -3
index 4cd84998c2..1d6a520d35 100644
@@ -567,7 +567,7 @@ struct Object
  */
 #define DECLARE_INSTANCE_CHECKER(InstanceType, OBJ_NAME, TYPENAME) \
     static inline G_GNUC_UNUSED InstanceType * \
-    OBJ_NAME(void *obj) \
+    OBJ_NAME(const void *obj) \
     { return OBJECT_CHECK(InstanceType, obj, TYPENAME); }
 
 /**
@@ -581,14 +581,16 @@ struct Object
  *
  * This macro will provide the three standard type cast functions for a
  * QOM type.
+ *
+ *FIXME: Use _Generic to make this const-safe
  */
 #define DECLARE_CLASS_CHECKERS(ClassType, OBJ_NAME, TYPENAME) \
     static inline G_GNUC_UNUSED ClassType * \
-    OBJ_NAME##_GET_CLASS(void *obj) \
+    OBJ_NAME##_GET_CLASS(const void *obj) \
     { return OBJECT_GET_CLASS(ClassType, obj, TYPENAME); } \
     \
     static inline G_GNUC_UNUSED ClassType * \
-    OBJ_NAME##_CLASS(void *klass) \
+    OBJ_NAME##_CLASS(const void *klass) \
     { return OBJECT_CLASS_CHECK(ClassType, klass, TYPENAME); }
 
 /**
Signature · 1 line
2.26.2
Reviewed-by on v1 30/41
#77 lore raw

Re: [PATCH 30/41] qom: Make type checker functions accept const pointers

Quoted 8 lines · Eduardo Habkost

The existing type check macros all unconditionally drop const qualifiers from their arguments. Keep this behavior in the macros generated by DECLARE_*CHECKER* by now.

In the future, we might use _Generic to preserve const-ness of the cast function arguments.

Quoted 37 lines
---
 include/qom/object.h | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
include/qom/object.h +5 -3
index 4cd84998c2..1d6a520d35 100644
@@ -567,7 +567,7 @@ struct Object
  */
 #define DECLARE_INSTANCE_CHECKER(InstanceType, OBJ_NAME, TYPENAME) \
     static inline G_GNUC_UNUSED InstanceType * \
-    OBJ_NAME(void *obj) \
+    OBJ_NAME(const void *obj) \
     { return OBJECT_CHECK(InstanceType, obj, TYPENAME); }
 
 /**
@@ -581,14 +581,16 @@ struct Object
  *
  * This macro will provide the three standard type cast functions for a
  * QOM type.
+ *
+ *FIXME: Use _Generic to make this const-safe
  */
 #define DECLARE_CLASS_CHECKERS(ClassType, OBJ_NAME, TYPENAME) \
     static inline G_GNUC_UNUSED ClassType * \
-    OBJ_NAME##_GET_CLASS(void *obj) \
+    OBJ_NAME##_GET_CLASS(const void *obj) \
     { return OBJECT_GET_CLASS(ClassType, obj, TYPENAME); } \
     \
     static inline G_GNUC_UNUSED ClassType * \
-    OBJ_NAME##_CLASS(void *klass) \
+    OBJ_NAME##_CLASS(const void *klass) \
     { return OBJECT_CLASS_CHECK(ClassType, klass, TYPENAME); }
 
 /**
Reviewed-by on v1 30/41
#78 lore raw

Re: [PATCH 30/41] qom: Make type checker functions accept const pointers

In reply to Eduardo Habkost
Quoted 6 lines · Eduardo Habkost

The existing type check macros all unconditionally drop const qualifiers from their arguments. Keep this behavior in the macros generated by DECLARE_*CHECKER* by now.

In the future, we might use _Generic to preserve const-ness of the cast function arguments.

I'm not sure what you mean by "use _Generic" ?

Quoted 5 lines
---
 include/qom/object.h | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
Quoted 36 lines
include/qom/object.h +5 -3
index 4cd84998c2..1d6a520d35 100644
@@ -567,7 +567,7 @@ struct Object
  */
 #define DECLARE_INSTANCE_CHECKER(InstanceType, OBJ_NAME, TYPENAME) \
     static inline G_GNUC_UNUSED InstanceType * \
-    OBJ_NAME(void *obj) \
+    OBJ_NAME(const void *obj) \
     { return OBJECT_CHECK(InstanceType, obj, TYPENAME); }
 
 /**
@@ -581,14 +581,16 @@ struct Object
  *
  * This macro will provide the three standard type cast functions for a
  * QOM type.
+ *
+ *FIXME: Use _Generic to make this const-safe
  */
 #define DECLARE_CLASS_CHECKERS(ClassType, OBJ_NAME, TYPENAME) \
     static inline G_GNUC_UNUSED ClassType * \
-    OBJ_NAME##_GET_CLASS(void *obj) \
+    OBJ_NAME##_GET_CLASS(const void *obj) \
     { return OBJECT_GET_CLASS(ClassType, obj, TYPENAME); } \
     \
     static inline G_GNUC_UNUSED ClassType * \
-    OBJ_NAME##_CLASS(void *klass) \
+    OBJ_NAME##_CLASS(const void *klass) \
     { return OBJECT_CLASS_CHECK(ClassType, klass, TYPENAME); }
 
 /**
Signature · 1 line
2.26.2

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#79 lore raw

Re: [PATCH 30/41] qom: Make type checker functions accept const pointers

Quoted 9 lines · Daniel P. Berrangé
Quoted 6 lines · Eduardo Habkost

The existing type check macros all unconditionally drop const qualifiers from their arguments. Keep this behavior in the macros generated by DECLARE_*CHECKER* by now.

In the future, we might use _Generic to preserve const-ness of the cast function arguments.

I'm not sure what you mean by "use _Generic" ?

I meant something like:

#define OBJECT_CHECK(Type, obj, ...) \
         _Generic((obj),
                  void *: (Type *)object_dynamic_cast_assert(obj, ...),
                  const void *: (const Type *)object_dynamic_cast_assert(obj, ...))

However, now we'll generate type checking functions instead of type checking macros, so making (for example) DEVICE((Object*)x) and DEVICE((const Object*)x) return a different type would be impossible.

Signature · 1 line
Eduardo
#80 lore raw

PATCH 31/41 qom: TYPE_INFO macro

In reply to Eduardo Habkost

Provide a TYPE_INFO macro that can be used to register a TypeInfo struct declaratively. This will allow QOM type registration to be 100% declarative.

---
 include/qom/object.h | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)
include/qom/object.h +9 -6
index 1d6a520d35..81bea3b4ed 100644
@@ -655,6 +655,14 @@ struct Object
     struct InstanceType##Class { ParentClassType parent_class; };
 
 
+#define TYPE_INFO(type_info_var) \
+    static void \
+    register_type_info_##type_info_var(void) \
+    { \
+        type_register_static(&type_info_var); \
+    } \
+    type_init(register_type_info_##type_info_var);
+
 /**
  * OBJECT_DEFINE_TYPE_EXTENDED:
  * @ModuleObjName: the object name with initial caps
@@ -700,12 +708,7 @@ struct Object
         .interfaces = (InterfaceInfo[]) { __VA_ARGS__ } , \
     }; \
     \
-    static void \
-    module_obj_name##_register_types(void) \
-    { \
-        type_register_static(&module_obj_name##_info); \
-    } \
-    type_init(module_obj_name##_register_types);
+    TYPE_INFO(module_obj_name##_info)
 
 /**
  * OBJECT_DEFINE_TYPE:
Signature · 1 line
2.26.2
Reviewed-by on v1 31/41
#81 lore raw

Re: [PATCH 31/41] qom: TYPE_INFO macro

Quoted 8 lines · Eduardo Habkost

Provide a TYPE_INFO macro that can be used to register a TypeInfo struct declaratively. This will allow QOM type registration to be 100% declarative.

---
 include/qom/object.h | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#82 lore raw

PATCH 32/41 codeconverter: script for automating QOM code cleanups

In reply to Eduardo Habkost

This started as a simple script that scanned for regular expressions, but became more and more complex when exceptions to the rules were found.

I don't know if this should be maintained in the QEMU source tree long term (maybe it can be reused for other code transformations that Coccinelle can't handle). In either case, this is included as part of the patch series to document how exactly the automated code transformations in the next patches were done.

---
 .../codeconverter/codeconverter/__init__.py   |   0
 .../codeconverter/codeconverter/patching.py   | 369 +++++++++++
 .../codeconverter/codeconverter/qom_macros.py | 614 ++++++++++++++++++
 .../codeconverter/qom_type_info.py            | 314 +++++++++
 .../codeconverter/codeconverter/regexps.py    |  89 +++
 .../codeconverter/test_patching.py            |  98 +++
 .../codeconverter/test_regexps.py             | 272 ++++++++
 scripts/codeconverter/codeconverter/utils.py  |  65 ++
 scripts/codeconverter/converter.py            | 113 ++++
 9 files changed, 1934 insertions(+)
 create mode 100644 scripts/codeconverter/codeconverter/__init__.py
 create mode 100644 scripts/codeconverter/codeconverter/patching.py
 create mode 100644 scripts/codeconverter/codeconverter/qom_macros.py
 create mode 100644 scripts/codeconverter/codeconverter/qom_type_info.py
 create mode 100644 scripts/codeconverter/codeconverter/regexps.py
 create mode 100644 scripts/codeconverter/codeconverter/test_patching.py
 create mode 100644 scripts/codeconverter/codeconverter/test_regexps.py
 create mode 100644 scripts/codeconverter/codeconverter/utils.py
 create mode 100755 scripts/codeconverter/converter.py
scripts/codeconverter/codeconverter/__init__.py new file +0 -0
new file mode 100644
index 0000000000..e69de29bb2
scripts/codeconverter/codeconverter/patching.py new file +369 -0

369 lines not on this page · raw message

scripts/codeconverter/codeconverter/qom_macros.py new file +614 -0

614 lines not on this page · raw message

scripts/codeconverter/codeconverter/qom_type_info.py new file +314 -0

314 lines not on this page · raw message

scripts/codeconverter/codeconverter/regexps.py new file +89 -0

89 lines not on this page · raw message

scripts/codeconverter/codeconverter/test_patching.py new file +98 -0

98 lines not on this page · raw message

scripts/codeconverter/codeconverter/test_regexps.py new file +272 -0

272 lines not on this page · raw message

scripts/codeconverter/codeconverter/utils.py new file +65 -0

66 lines not on this page · raw message

scripts/codeconverter/converter.py new file +113 -0

114 lines not on this page · raw message

Signature · 1 line
2.26.2
#83 lore raw

PATCH 33/41 Delete duplicate QOM typedefs

In reply to Eduardo Habkost

Generated using:

 $ ./scripts/codeconverter/converter.py -i \
   --pattern=QOMDuplicatedTypedefs $(git grep -l '' -- '*.[ch]')
---
 include/crypto/secret_keyring.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
include/crypto/secret_keyring.h +4 -4
index 9f371ad251..4345eb048e 100644
@@ -39,14 +39,14 @@
 typedef struct QCryptoSecretKeyring QCryptoSecretKeyring;
 typedef struct QCryptoSecretKeyringClass QCryptoSecretKeyringClass;
 
-typedef struct QCryptoSecretKeyring {
+struct QCryptoSecretKeyring {
     QCryptoSecretCommon parent;
     int32_t serial;
-} QCryptoSecretKeyring;
+};
 
 
-typedef struct QCryptoSecretKeyringClass {
+struct QCryptoSecretKeyringClass {
     QCryptoSecretCommonClass parent;
-} QCryptoSecretKeyringClass;
+};
 
 #endif /* QCRYPTO_SECRET_KEYRING_H */
Signature · 1 line
2.26.2
Reviewed-by on v1 33/41
#84 lore raw

Re: [PATCH 33/41] [automated] Delete duplicate QOM typedefs

Quoted 9 lines · Eduardo Habkost

Generated using:

 $ ./scripts/codeconverter/converter.py -i \
   --pattern=QOMDuplicatedTypedefs $(git grep -l '' -- '*.[ch]')
---
 include/crypto/secret_keyring.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#85 lore raw

PATCH 34/41 Use TYPE_INFO macro

In reply to Eduardo Habkost

Generated using:

  $ ./scripts/codeconverter/converter.py -i --passes=2 \
    --pattern=TypeRegisterCall,TypeInitMacro $(git grep -l TypeInfo -- '*.[ch]')
---
 accel/accel.c                       |  6 +-----
 accel/kvm/kvm-all.c                 |  6 +-----
 accel/qtest.c                       |  6 +-----
 accel/tcg/tcg-all.c                 |  6 +-----
 accel/xen/xen-all.c                 |  6 +-----
 authz/base.c                        |  6 +-----
 authz/list.c                        |  7 +------
 authz/listfile.c                    |  7 +------
 authz/pamacct.c                     |  7 +------
 authz/simple.c                      |  7 +------
 backends/cryptodev-builtin.c        |  7 +------
 backends/cryptodev-vhost-user.c     |  7 +------
 backends/cryptodev.c                |  7 +------
 backends/dbus-vmstate.c             |  7 +------
 backends/hostmem-file.c             |  6 +-----
 backends/hostmem-memfd.c            |  2 +-
 backends/hostmem-ram.c              |  6 +-----
 backends/hostmem.c                  |  6 +-----
 backends/rng-builtin.c              |  6 +-----
 backends/rng-egd.c                  |  6 +-----
 backends/rng-random.c               |  6 +-----
 backends/rng.c                      |  6 +-----
 backends/tpm/tpm_backend.c          |  8 ++------
 backends/tpm/tpm_emulator.c         |  6 +-----
 backends/tpm/tpm_passthrough.c      |  6 +-----
 backends/vhost-user.c               |  6 +-----
 block/throttle-groups.c             |  6 +-----
 chardev/baum.c                      |  6 +-----
 chardev/char-console.c              |  6 +-----
 chardev/char-fd.c                   |  6 +-----
 chardev/char-mux.c                  |  6 +-----
 chardev/char-null.c                 |  6 +-----
 chardev/char-parallel.c             |  6 +-----
 chardev/char-pty.c                  |  6 +-----
 chardev/char-ringbuf.c              |  8 ++------
 chardev/char-socket.c               |  6 +-----
 chardev/char-udp.c                  |  6 +-----
 chardev/char-win-stdio.c            |  6 +-----
 chardev/char-win.c                  |  6 +-----
 chardev/char.c                      |  6 +-----
 chardev/msmouse.c                   |  6 +-----
 chardev/spice.c                     | 10 +++-------
 chardev/testdev.c                   |  6 +-----
 chardev/wctablet.c                  |  6 +-----
 crypto/secret.c                     |  7 +------
 crypto/secret_common.c              |  7 +------
 crypto/secret_keyring.c             |  7 +------
 crypto/tls-cipher-suites.c          |  6 +-----
 crypto/tlscreds.c                   |  7 +------
 crypto/tlscredsanon.c               |  7 +------
 crypto/tlscredspsk.c                |  7 +------
 crypto/tlscredsx509.c               |  7 +------
 gdbstub.c                           |  6 +-----
 hw/9pfs/virtio-9p-device.c          |  6 +-----
 hw/acpi/generic_event_device.c      |  6 +-----
 hw/acpi/piix4.c                     |  6 +-----
 hw/acpi/vmgenid.c                   |  6 +-----
 hw/adc/stm32f2xx_adc.c              |  6 +-----
 hw/alpha/typhoon.c                  |  8 ++------
 hw/arm/allwinner-a10.c              |  6 +-----
 hw/arm/allwinner-h3.c               |  6 +-----
 hw/arm/armsse.c                     |  2 +-
 hw/arm/armv7m.c                     |  8 ++------
 hw/arm/bcm2835_peripherals.c        |  6 +-----
 hw/arm/bcm2836.c                    |  2 +-
 hw/arm/boot.c                       |  6 +-----
 hw/arm/collie.c                     |  6 +-----
 hw/arm/digic.c                      |  6 +-----
 hw/arm/exynos4210.c                 |  6 +-----
 hw/arm/exynos4_boards.c             |  8 ++------
 hw/arm/fsl-imx25.c                  |  6 +-----
 hw/arm/fsl-imx31.c                  |  6 +-----
 hw/arm/fsl-imx6.c                   |  6 +-----
 hw/arm/fsl-imx6ul.c                 |  6 +-----
 hw/arm/fsl-imx7.c                   |  6 +-----
 hw/arm/gumstix.c                    |  8 ++------
 hw/arm/highbank.c                   | 14 +++-----------
 hw/arm/integratorcp.c               | 10 +++-------
 hw/arm/microbit.c                   |  6 +-----
 hw/arm/mps2-tz.c                    | 10 +++-------
 hw/arm/mps2.c                       | 10 +++-------
 hw/arm/msf2-soc.c                   |  6 +-----
 hw/arm/musca.c                      | 10 +++-------
 hw/arm/musicpal.c                   | 22 +++++++++-------------
 hw/arm/nrf51_soc.c                  |  6 +-----
 hw/arm/nseries.c                    |  8 ++------
 hw/arm/omap_sx1.c                   |  8 ++------
 hw/arm/palm.c                       |  6 +-----
 hw/arm/pxa2xx.c                     | 14 +++++---------
 hw/arm/pxa2xx_gpio.c                |  6 +-----
 hw/arm/pxa2xx_pic.c                 |  6 +-----
 hw/arm/realview.c                   | 12 ++++--------
 hw/arm/sbsa-ref.c                   |  6 +-----
 hw/arm/smmu-common.c                |  6 +-----
 hw/arm/spitz.c                      | 28 ++++++++++------------------
 hw/arm/stellaris.c                  | 18 +++++-------------
 hw/arm/stm32f205_soc.c              |  6 +-----
 hw/arm/stm32f405_soc.c              |  6 +-----
 hw/arm/strongarm.c                  | 16 ++++++----------
 hw/arm/tosa.c                       | 10 +++-------
 hw/arm/versatilepb.c                | 14 +++-----------
 hw/arm/vexpress.c                   | 10 +++-------
 hw/arm/virt.c                       |  6 +-----
 hw/arm/xilinx_zynq.c                |  6 +-----
 hw/arm/xlnx-versal-virt.c           |  6 +-----
 hw/arm/xlnx-versal.c                |  6 +-----
 hw/arm/xlnx-zcu102.c                |  6 +-----
 hw/arm/xlnx-zynqmp.c                |  6 +-----
 hw/audio/cs4231.c                   |  6 +-----
 hw/audio/hda-codec.c                | 12 ++++--------
 hw/audio/intel-hda.c                | 10 +++++-----
 hw/audio/marvell_88w8618.c          |  6 +-----
 hw/audio/milkymist-ac97.c           |  6 +-----
 hw/audio/pcspk.c                    |  2 +-
 hw/audio/pl041.c                    |  6 +-----
 hw/audio/wm8750.c                   |  6 +-----
 hw/block/fdc.c                      | 16 ++++++----------
 hw/block/m25p80.c                   |  2 +-
 hw/block/nand.c                     |  6 +-----
 hw/block/nvme.c                     |  6 +-----
 hw/block/onenand.c                  |  6 +-----
 hw/block/pflash_cfi01.c             |  6 +-----
 hw/block/pflash_cfi02.c             |  6 +-----
 hw/block/swim.c                     | 10 +++-------
 hw/block/vhost-user-blk.c           |  6 +-----
 hw/block/virtio-blk.c               |  6 +-----
 hw/block/xen-block.c                | 10 +++-------
 hw/char/avr_usart.c                 |  6 +-----
 hw/char/bcm2835_aux.c               |  6 +-----
 hw/char/cadence_uart.c              |  6 +-----
 hw/char/cmsdk-apb-uart.c            |  6 +-----
 hw/char/debugcon.c                  |  6 +-----
 hw/char/digic-uart.c                |  6 +-----
 hw/char/escc.c                      |  6 +-----
 hw/char/etraxfs_ser.c               |  6 +-----
 hw/char/exynos4210_uart.c           |  6 +-----
 hw/char/grlib_apbuart.c             |  6 +-----
 hw/char/ibex_uart.c                 |  6 +-----
 hw/char/imx_serial.c                |  6 +-----
 hw/char/ipoctal232.c                |  6 +-----
 hw/char/lm32_juart.c                |  6 +-----
 hw/char/lm32_uart.c                 |  6 +-----
 hw/char/mcf_uart.c                  |  6 +-----
 hw/char/milkymist-uart.c            |  6 +-----
 hw/char/nrf51_uart.c                |  6 +-----
 hw/char/parallel.c                  |  6 +-----
 hw/char/pl011.c                     |  8 ++------
 hw/char/renesas_sci.c               |  6 +-----
 hw/char/sclpconsole-lm.c            |  6 +-----
 hw/char/sclpconsole.c               |  6 +-----
 hw/char/serial-isa.c                |  6 +-----
 hw/char/serial-pci-multi.c          |  8 ++------
 hw/char/serial-pci.c                |  6 +-----
 hw/char/serial.c                    | 10 +++-------
 hw/char/spapr_vty.c                 |  2 +-
 hw/char/stm32f2xx_usart.c           |  6 +-----
 hw/char/terminal3270.c              |  6 +-----
 hw/char/virtio-console.c            |  8 ++------
 hw/char/virtio-serial-bus.c         | 10 +++-------
 hw/char/xilinx_uartlite.c           |  6 +-----
 hw/core/bus.c                       |  6 +-----
 hw/core/clock.c                     |  6 +-----
 hw/core/cpu.c                       |  6 +-----
 hw/core/fw-path-provider.c          |  6 +-----
 hw/core/generic-loader.c            |  6 +-----
 hw/core/hotplug.c                   |  6 +-----
 hw/core/irq.c                       |  6 +-----
 hw/core/machine.c                   |  6 +-----
 hw/core/nmi.c                       |  6 +-----
 hw/core/or-irq.c                    |  6 +-----
 hw/core/platform-bus.c              |  6 +-----
 hw/core/qdev.c                      |  6 +-----
 hw/core/register.c                  |  6 +-----
 hw/core/resettable.c                |  6 +-----
 hw/core/split-irq.c                 |  6 +-----
 hw/core/stream.c                    |  6 +-----
 hw/core/sysbus.c                    |  8 ++------
 hw/core/vmstate-if.c                |  6 +-----
 hw/cpu/a15mpcore.c                  |  6 +-----
 hw/cpu/a9mpcore.c                   |  6 +-----
 hw/cpu/arm11mpcore.c                |  6 +-----
 hw/cpu/cluster.c                    |  6 +-----
 hw/cpu/core.c                       |  6 +-----
 hw/cpu/realview_mpcore.c            |  6 +-----
 hw/display/ads7846.c                |  6 +-----
 hw/display/artist.c                 |  6 +-----
 hw/display/ati.c                    |  6 +-----
 hw/display/bcm2835_fb.c             |  6 +-----
 hw/display/bochs-display.c          |  6 +-----
 hw/display/cg3.c                    |  6 +-----
 hw/display/cirrus_vga.c             |  6 +-----
 hw/display/cirrus_vga_isa.c         |  6 +-----
 hw/display/dpcd.c                   |  6 +-----
 hw/display/exynos4210_fimd.c        |  6 +-----
 hw/display/g364fb.c                 |  6 +-----
 hw/display/i2c-ddc.c                |  6 +-----
 hw/display/jazz_led.c               |  6 +-----
 hw/display/macfb.c                  |  8 ++------
 hw/display/milkymist-tmu2.c         |  6 +-----
 hw/display/milkymist-vgafb.c        |  6 +-----
 hw/display/next-fb.c                |  6 +-----
 hw/display/pl110.c                  | 10 +++-------
 hw/display/qxl.c                    | 10 +++-------
 hw/display/ramfb-standalone.c       |  6 +-----
 hw/display/sii9022.c                |  6 +-----
 hw/display/sm501.c                  |  8 ++------
 hw/display/ssd0303.c                |  6 +-----
 hw/display/ssd0323.c                |  6 +-----
 hw/display/tcx.c                    |  6 +-----
 hw/display/vga-isa.c                |  6 +-----
 hw/display/vga-pci.c                | 10 +++-------
 hw/display/vhost-user-gpu.c         |  6 +-----
 hw/display/virtio-gpu-base.c        |  7 +------
 hw/display/virtio-gpu-pci.c         |  2 +-
 hw/display/virtio-gpu.c             |  6 +-----
 hw/display/virtio-vga.c             |  2 +-
 hw/display/vmware_vga.c             |  6 +-----
 hw/display/xlnx_dp.c                |  6 +-----
 hw/dma/bcm2835_dma.c                |  6 +-----
 hw/dma/i82374.c                     |  6 +-----
 hw/dma/i8257.c                      |  6 +-----
 hw/dma/pl080.c                      |  8 ++------
 hw/dma/pl330.c                      |  6 +-----
 hw/dma/puv3_dma.c                   |  6 +-----
 hw/dma/pxa2xx_dma.c                 |  6 +-----
 hw/dma/rc4030.c                     |  8 ++------
 hw/dma/sparc32_dma.c                | 12 ++++--------
 hw/dma/xilinx_axidma.c              | 10 +++-------
 hw/dma/xlnx-zdma.c                  |  6 +-----
 hw/dma/xlnx-zynq-devcfg.c           |  6 +-----
 hw/dma/xlnx_dpdma.c                 |  6 +-----
 hw/gpio/aspeed_gpio.c               | 14 +++++---------
 hw/gpio/bcm2835_gpio.c              |  6 +-----
 hw/gpio/gpio_key.c                  |  6 +-----
 hw/gpio/imx_gpio.c                  |  6 +-----
 hw/gpio/max7310.c                   |  6 +-----
 hw/gpio/mpc8xxx.c                   |  6 +-----
 hw/gpio/nrf51_gpio.c                |  6 +-----
 hw/gpio/omap_gpio.c                 |  8 ++------
 hw/gpio/pl061.c                     |  8 ++------
 hw/gpio/puv3_gpio.c                 |  6 +-----
 hw/gpio/zaurus.c                    |  6 +-----
 hw/hppa/dino.c                      |  6 +-----
 hw/hppa/lasi.c                      |  6 +-----
 hw/hyperv/hyperv.c                  |  6 +-----
 hw/hyperv/hyperv_testdev.c          |  6 +-----
 hw/hyperv/vmbus.c                   | 10 +++-------
 hw/i2c/aspeed_i2c.c                 | 12 ++++--------
 hw/i2c/bitbang_i2c.c                |  6 +-----
 hw/i2c/core.c                       |  8 ++------
 hw/i2c/exynos4210_i2c.c             |  6 +-----
 hw/i2c/imx_i2c.c                    |  6 +-----
 hw/i2c/microbit_i2c.c               |  6 +-----
 hw/i2c/mpc_i2c.c                    |  6 +-----
 hw/i2c/omap_i2c.c                   |  6 +-----
 hw/i2c/ppc4xx_i2c.c                 |  6 +-----
 hw/i2c/smbus_eeprom.c               |  6 +-----
 hw/i2c/smbus_ich9.c                 |  6 +-----
 hw/i2c/smbus_slave.c                |  6 +-----
 hw/i2c/versatile_i2c.c              |  6 +-----
 hw/i386/amd_iommu.c                 | 10 +++-------
 hw/i386/intel_iommu.c               |  8 ++------
 hw/i386/kvm/apic.c                  |  6 +-----
 hw/i386/kvm/clock.c                 |  6 +-----
 hw/i386/kvm/i8254.c                 |  6 +-----
 hw/i386/kvm/i8259.c                 |  6 +-----
 hw/i386/kvm/ioapic.c                |  6 +-----
 hw/i386/kvmvapic.c                  |  6 +-----
 hw/i386/microvm.c                   |  6 +-----
 hw/i386/pc.c                        |  6 +-----
 hw/i386/pc_piix.c                   |  6 +-----
 hw/i386/port92.c                    |  6 +-----
 hw/i386/vmmouse.c                   |  6 +-----
 hw/i386/vmport.c                    |  6 +-----
 hw/i386/x86-iommu.c                 |  6 +-----
 hw/i386/x86.c                       |  6 +-----
 hw/i386/xen/xen_apic.c              |  6 +-----
 hw/i386/xen/xen_platform.c          |  6 +-----
 hw/i386/xen/xen_pvdevice.c          |  6 +-----
 hw/ide/ahci-allwinner.c             |  6 +-----
 hw/ide/ahci.c                       |  6 +-----
 hw/ide/cmd646.c                     |  6 +-----
 hw/ide/ich.c                        |  6 +-----
 hw/ide/isa.c                        |  6 +-----
 hw/ide/macio.c                      |  6 +-----
 hw/ide/microdrive.c                 |  8 ++------
 hw/ide/mmio.c                       |  6 +-----
 hw/ide/pci.c                        |  6 +-----
 hw/ide/piix.c                       | 10 +++-------
 hw/ide/qdev.c                       | 14 +++++---------
 hw/ide/sii3112.c                    |  6 +-----
 hw/ide/via.c                        |  6 +-----
 hw/input/adb-kbd.c                  |  6 +-----
 hw/input/adb-mouse.c                |  6 +-----
 hw/input/adb.c                      |  8 ++------
 hw/input/lm832x.c                   |  6 +-----
 hw/input/milkymist-softusb.c        |  6 +-----
 hw/input/pckbd.c                    |  6 +-----
 hw/input/pl050.c                    | 10 +++-------
 hw/input/vhost-user-input.c         |  6 +-----
 hw/input/virtio-input-hid.c         | 12 ++++--------
 hw/input/virtio-input-host.c        |  6 +-----
 hw/input/virtio-input.c             |  6 +-----
 hw/intc/allwinner-a10-pic.c         |  6 +-----
 hw/intc/apic.c                      |  6 +-----
 hw/intc/apic_common.c               |  6 +-----
 hw/intc/arm_gic.c                   |  6 +-----
 hw/intc/arm_gic_common.c            |  6 +-----
 hw/intc/arm_gic_kvm.c               |  6 +-----
 hw/intc/arm_gicv2m.c                |  6 +-----
 hw/intc/arm_gicv3.c                 |  6 +-----
 hw/intc/arm_gicv3_common.c          |  6 +-----
 hw/intc/arm_gicv3_its_common.c      |  6 +-----
 hw/intc/arm_gicv3_its_kvm.c         |  6 +-----
 hw/intc/arm_gicv3_kvm.c             |  6 +-----
 hw/intc/armv7m_nvic.c               |  6 +-----
 hw/intc/aspeed_vic.c                |  6 +-----
 hw/intc/bcm2835_ic.c                |  6 +-----
 hw/intc/bcm2836_control.c           |  6 +-----
 hw/intc/etraxfs_pic.c               |  6 +-----
 hw/intc/exynos4210_combiner.c       |  6 +-----
 hw/intc/exynos4210_gic.c            | 12 ++----------
 hw/intc/grlib_irqmp.c               |  6 +-----
 hw/intc/heathrow_pic.c              |  6 +-----
 hw/intc/i8259.c                     |  6 +-----
 hw/intc/i8259_common.c              |  6 +-----
 hw/intc/ibex_plic.c                 |  6 +-----
 hw/intc/imx_avic.c                  |  6 +-----
 hw/intc/imx_gpcv2.c                 |  6 +-----
 hw/intc/intc.c                      |  6 +-----
 hw/intc/ioapic.c                    |  6 +-----
 hw/intc/ioapic_common.c             |  6 +-----
 hw/intc/lm32_pic.c                  |  6 +-----
 hw/intc/loongson_liointc.c          |  6 +-----
 hw/intc/mips_gic.c                  |  6 +-----
 hw/intc/nios2_iic.c                 |  6 +-----
 hw/intc/omap_intc.c                 | 10 +++-------
 hw/intc/ompic.c                     |  6 +-----
 hw/intc/openpic.c                   |  6 +-----
 hw/intc/openpic_kvm.c               |  6 +-----
 hw/intc/pl190.c                     |  6 +-----
 hw/intc/pnv_xive.c                  |  6 +-----
 hw/intc/puv3_intc.c                 |  6 +-----
 hw/intc/realview_gic.c              |  6 +-----
 hw/intc/rx_icu.c                    |  6 +-----
 hw/intc/s390_flic.c                 |  8 ++------
 hw/intc/s390_flic_kvm.c             |  6 +-----
 hw/intc/slavio_intctl.c             |  6 +-----
 hw/intc/spapr_xive.c                |  6 +-----
 hw/intc/xics.c                      | 10 +++-------
 hw/intc/xics_pnv.c                  |  6 +-----
 hw/intc/xics_spapr.c                |  6 +-----
 hw/intc/xilinx_intc.c               |  6 +-----
 hw/intc/xive.c                      | 18 +++++++-----------
 hw/intc/xlnx-pmu-iomod-intc.c       |  6 +-----
 hw/intc/xlnx-zynqmp-ipi.c           |  6 +-----
 hw/ipack/ipack.c                    |  8 ++------
 hw/ipack/tpci200.c                  |  6 +-----
 hw/ipmi/ipmi.c                      |  8 ++------
 hw/ipmi/ipmi_bmc_sim.c              |  6 +-----
 hw/ipmi/isa_ipmi_bt.c               |  6 +-----
 hw/ipmi/isa_ipmi_kcs.c              |  6 +-----
 hw/ipmi/pci_ipmi_bt.c               |  6 +-----
 hw/ipmi/pci_ipmi_kcs.c              |  6 +-----
 hw/ipmi/smbus_ipmi.c                |  6 +-----
 hw/isa/i82378.c                     |  6 +-----
 hw/isa/isa-bus.c                    | 12 ++++--------
 hw/isa/isa-superio.c                |  8 ++------
 hw/isa/lpc_ich9.c                   |  6 +-----
 hw/isa/pc87312.c                    |  6 +-----
 hw/isa/piix3.c                      | 10 +++-------
 hw/isa/piix4.c                      |  6 +-----
 hw/isa/smc37c669-superio.c          |  6 +-----
 hw/isa/vt82c686.c                   | 14 +++++---------
 hw/lm32/lm32_boards.c               |  8 ++------
 hw/m68k/mcf_intc.c                  |  6 +-----
 hw/m68k/next-cube.c                 |  6 +-----
 hw/m68k/next-kbd.c                  |  6 +-----
 hw/m68k/q800.c                      |  6 +-----
 hw/mem/memory-device.c              |  6 +-----
 hw/mem/nvdimm.c                     |  6 +-----
 hw/mem/pc-dimm.c                    |  6 +-----
 hw/microblaze/xlnx-zynqmp-pmu.c     |  6 +-----
 hw/mips/boston.c                    |  6 +-----
 hw/mips/cps.c                       |  6 +-----
 hw/mips/gt64xxx_pci.c               |  8 ++------
 hw/mips/jazz.c                      |  8 ++------
 hw/mips/malta.c                     |  6 +-----
 hw/misc/a9scu.c                     |  6 +-----
 hw/misc/allwinner-cpucfg.c          |  6 +-----
 hw/misc/allwinner-h3-ccu.c          |  6 +-----
 hw/misc/allwinner-h3-dramc.c        |  6 +-----
 hw/misc/allwinner-h3-sysctrl.c      |  6 +-----
 hw/misc/allwinner-sid.c             |  6 +-----
 hw/misc/applesmc.c                  |  6 +-----
 hw/misc/arm11scu.c                  |  6 +-----
 hw/misc/arm_integrator_debug.c      |  6 +-----
 hw/misc/arm_l2x0.c                  |  6 +-----
 hw/misc/arm_sysctl.c                |  6 +-----
 hw/misc/armsse-cpuid.c              |  6 +-----
 hw/misc/armsse-mhu.c                |  6 +-----
 hw/misc/aspeed_scu.c                | 12 ++++--------
 hw/misc/aspeed_sdmc.c               | 12 ++++--------
 hw/misc/aspeed_xdma.c               |  6 +-----
 hw/misc/auxbus.c                    | 10 +++-------
 hw/misc/avr_power.c                 |  6 +-----
 hw/misc/bcm2835_mbox.c              |  6 +-----
 hw/misc/bcm2835_mphi.c              |  6 +-----
 hw/misc/bcm2835_property.c          |  6 +-----
 hw/misc/bcm2835_rng.c               |  6 +-----
 hw/misc/bcm2835_thermal.c           |  6 +-----
 hw/misc/debugexit.c                 |  6 +-----
 hw/misc/eccmemctl.c                 |  6 +-----
 hw/misc/empty_slot.c                |  6 +-----
 hw/misc/exynos4210_clk.c            |  2 +-
 hw/misc/exynos4210_pmu.c            |  6 +-----
 hw/misc/exynos4210_rng.c            |  6 +-----
 hw/misc/grlib_ahb_apb_pnp.c         |  8 ++------
 hw/misc/imx25_ccm.c                 |  6 +-----
 hw/misc/imx31_ccm.c                 |  6 +-----
 hw/misc/imx6_ccm.c                  |  6 +-----
 hw/misc/imx6_src.c                  |  6 +-----
 hw/misc/imx6ul_ccm.c                |  6 +-----
 hw/misc/imx7_ccm.c                  |  8 ++------
 hw/misc/imx7_gpr.c                  |  6 +-----
 hw/misc/imx7_snvs.c                 |  6 +-----
 hw/misc/imx_ccm.c                   |  6 +-----
 hw/misc/imx_rngc.c                  |  6 +-----
 hw/misc/iotkit-secctl.c             |  6 +-----
 hw/misc/iotkit-sysctl.c             |  6 +-----
 hw/misc/iotkit-sysinfo.c            |  6 +-----
 hw/misc/ivshmem.c                   | 10 +++-------
 hw/misc/mac_via.c                   | 10 +++-------
 hw/misc/macio/cuda.c                |  8 ++------
 hw/misc/macio/gpio.c                |  6 +-----
 hw/misc/macio/mac_dbdma.c           |  6 +-----
 hw/misc/macio/macio.c               | 12 ++++--------
 hw/misc/macio/pmu.c                 |  8 ++------
 hw/misc/max111x.c                   | 10 +++-------
 hw/misc/milkymist-hpdmc.c           |  6 +-----
 hw/misc/milkymist-pfpu.c            |  6 +-----
 hw/misc/mips_cmgcr.c                |  6 +-----
 hw/misc/mips_cpc.c                  |  6 +-----
 hw/misc/mips_itu.c                  |  6 +-----
 hw/misc/mos6522.c                   |  6 +-----
 hw/misc/mps2-fpgaio.c               |  6 +-----
 hw/misc/mps2-scc.c                  |  6 +-----
 hw/misc/msf2-sysreg.c               |  6 +-----
 hw/misc/mst_fpga.c                  |  6 +-----
 hw/misc/nrf51_rng.c                 |  6 +-----
 hw/misc/pc-testdev.c                |  6 +-----
 hw/misc/pca9552.c                   |  8 ++------
 hw/misc/pci-testdev.c               |  6 +-----
 hw/misc/puv3_pm.c                   |  6 +-----
 hw/misc/pvpanic.c                   |  6 +-----
 hw/misc/sga.c                       |  6 +-----
 hw/misc/slavio_misc.c               |  8 ++------
 hw/misc/stm32f2xx_syscfg.c          |  6 +-----
 hw/misc/stm32f4xx_exti.c            |  6 +-----
 hw/misc/stm32f4xx_syscfg.c          |  6 +-----
 hw/misc/tmp105.c                    |  6 +-----
 hw/misc/tmp421.c                    |  2 +-
 hw/misc/tz-mpc.c                    |  8 ++------
 hw/misc/tz-msc.c                    |  6 +-----
 hw/misc/tz-ppc.c                    |  6 +-----
 hw/misc/unimp.c                     |  6 +-----
 hw/misc/vmcoreinfo.c                |  6 +-----
 hw/misc/zynq-xadc.c                 |  6 +-----
 hw/misc/zynq_slcr.c                 |  6 +-----
 hw/net/allwinner-sun8i-emac.c       |  6 +-----
 hw/net/allwinner_emac.c             |  6 +-----
 hw/net/cadence_gem.c                |  6 +-----
 hw/net/can/can_kvaser_pci.c         |  6 +-----
 hw/net/can/can_mioe3680_pci.c       |  6 +-----
 hw/net/can/can_pcm3680_pci.c        |  6 +-----
 hw/net/dp8393x.c                    |  6 +-----
 hw/net/e1000.c                      |  2 +-
 hw/net/e1000e.c                     |  6 +-----
 hw/net/etraxfs_eth.c                |  6 +-----
 hw/net/fsl_etsec/etsec.c            |  6 +-----
 hw/net/ftgmac100.c                  |  8 ++------
 hw/net/imx_fec.c                    |  8 ++------
 hw/net/lan9118.c                    |  6 +-----
 hw/net/lance.c                      |  6 +-----
 hw/net/lasi_i82596.c                |  6 +-----
 hw/net/mcf_fec.c                    |  6 +-----
 hw/net/milkymist-minimac2.c         |  6 +-----
 hw/net/mipsnet.c                    |  6 +-----
 hw/net/msf2-emac.c                  |  6 +-----
 hw/net/ne2000-isa.c                 |  6 +-----
 hw/net/ne2000-pci.c                 |  6 +-----
 hw/net/opencores_eth.c              |  6 +-----
 hw/net/pcnet-pci.c                  |  6 +-----
 hw/net/rocker/rocker.c              |  6 +-----
 hw/net/rtl8139.c                    |  6 +-----
 hw/net/smc91c111.c                  |  6 +-----
 hw/net/spapr_llan.c                 |  2 +-
 hw/net/stellaris_enet.c             |  6 +-----
 hw/net/sungem.c                     |  6 +-----
 hw/net/sunhme.c                     |  6 +-----
 hw/net/tulip.c                      |  6 +-----
 hw/net/virtio-net.c                 |  6 +-----
 hw/net/vmxnet3.c                    |  2 +-
 hw/net/xgmac.c                      |  6 +-----
 hw/net/xilinx_axienet.c             | 10 +++-------
 hw/net/xilinx_ethlite.c             |  6 +-----
 hw/nubus/mac-nubus-bridge.c         |  6 +-----
 hw/nubus/nubus-bridge.c             |  6 +-----
 hw/nubus/nubus-bus.c                |  6 +-----
 hw/nubus/nubus-device.c             |  6 +-----
 hw/nvram/ds1225y.c                  |  6 +-----
 hw/nvram/eeprom_at24c.c             |  6 +-----
 hw/nvram/fw_cfg.c                   | 12 ++++--------
 hw/nvram/mac_nvram.c                |  6 +-----
 hw/nvram/nrf51_nvm.c                |  6 +-----
 hw/nvram/spapr_nvram.c              |  6 +-----
 hw/pci-bridge/dec.c                 | 10 +++-------
 hw/pci-bridge/i82801b11.c           |  6 +-----
 hw/pci-bridge/ioh3420.c             |  6 +-----
 hw/pci-bridge/pci_bridge_dev.c      |  8 ++------
 hw/pci-bridge/pci_expander_bridge.c | 14 +++++---------
 hw/pci-bridge/pcie_pci_bridge.c     |  6 +-----
 hw/pci-bridge/pcie_root_port.c      |  6 +-----
 hw/pci-bridge/simba.c               |  6 +-----
 hw/pci-bridge/xio3130_downstream.c  |  6 +-----
 hw/pci-bridge/xio3130_upstream.c    |  6 +-----
 hw/pci-host/bonito.c                |  8 ++------
 hw/pci-host/designware.c            |  8 ++------
 hw/pci-host/gpex.c                  |  8 ++------
 hw/pci-host/grackle.c               |  8 ++------
 hw/pci-host/i440fx.c                |  8 ++------
 hw/pci-host/pnv_phb3.c              | 12 ++++--------
 hw/pci-host/pnv_phb3_msi.c          |  6 +-----
 hw/pci-host/pnv_phb3_pbcq.c         |  6 +-----
 hw/pci-host/pnv_phb4.c              | 12 ++++--------
 hw/pci-host/pnv_phb4_pec.c          |  8 ++------
 hw/pci-host/ppce500.c               |  8 ++------
 hw/pci-host/prep.c                  |  8 ++------
 hw/pci-host/q35.c                   |  8 ++------
 hw/pci-host/sabre.c                 |  8 ++------
 hw/pci-host/uninorth.c              | 18 +++++++++---------
 hw/pci-host/versatile.c             | 10 +++-------
 hw/pci-host/xen_igd_pt.c            |  6 +-----
 hw/pci-host/xilinx-pcie.c           |  8 ++------
 hw/pci/pci.c                        | 14 +++++---------
 hw/pci/pci_bridge.c                 |  6 +-----
 hw/pci/pci_host.c                   |  6 +-----
 hw/pci/pcie_host.c                  |  6 +-----
 hw/pci/pcie_port.c                  |  8 ++------
 hw/pcmcia/pcmcia.c                  |  6 +-----
 hw/pcmcia/pxa2xx.c                  |  6 +-----
 hw/ppc/e500.c                       |  8 ++------
 hw/ppc/e500plat.c                   |  6 +-----
 hw/ppc/mac_newworld.c               |  6 +-----
 hw/ppc/mac_oldworld.c               |  6 +-----
 hw/ppc/mpc8544_guts.c               |  6 +-----
 hw/ppc/mpc8544ds.c                  |  6 +-----
 hw/ppc/pnv_core.c                   |  6 +-----
 hw/ppc/pnv_homer.c                  | 10 +++-------
 hw/ppc/pnv_lpc.c                    | 12 ++++--------
 hw/ppc/pnv_occ.c                    | 10 +++-------
 hw/ppc/pnv_pnor.c                   |  6 +-----
 hw/ppc/pnv_psi.c                    | 12 ++++--------
 hw/ppc/pnv_xscom.c                  |  6 +-----
 hw/ppc/ppc405_boards.c              |  8 ++------
 hw/ppc/ppc440_pcix.c                |  6 +-----
 hw/ppc/ppc440_uc.c                  |  6 +-----
 hw/ppc/ppc4xx_pci.c                 |  8 ++------
 hw/ppc/ppce500_spin.c               |  6 +-----
 hw/ppc/prep_systemio.c              |  6 +-----
 hw/ppc/rs6000_mc.c                  |  6 +-----
 hw/ppc/spapr.c                      |  6 +-----
 hw/ppc/spapr_drc.c                  | 16 ++++++++--------
 hw/ppc/spapr_iommu.c                |  8 ++------
 hw/ppc/spapr_irq.c                  |  6 +-----
 hw/ppc/spapr_pci.c                  |  6 +-----
 hw/ppc/spapr_rng.c                  |  6 +-----
 hw/ppc/spapr_rtc.c                  |  6 +-----
 hw/ppc/spapr_tpm_proxy.c            |  2 +-
 hw/ppc/spapr_vio.c                  | 10 +++-------
 hw/rdma/rdma.c                      |  6 +-----
 hw/rdma/vmw/pvrdma_main.c           |  6 +-----
 hw/riscv/opentitan.c                |  6 +-----
 hw/riscv/riscv_hart.c               |  6 +-----
 hw/riscv/sifive_clint.c             |  6 +-----
 hw/riscv/sifive_e.c                 | 12 ++----------
 hw/riscv/sifive_e_prci.c            |  6 +-----
 hw/riscv/sifive_gpio.c              |  6 +-----
 hw/riscv/sifive_plic.c              |  6 +-----
 hw/riscv/sifive_test.c              |  6 +-----
 hw/riscv/sifive_u.c                 | 12 ++----------
 hw/riscv/sifive_u_otp.c             |  6 +-----
 hw/riscv/sifive_u_prci.c            |  6 +-----
 hw/riscv/virt.c                     |  6 +-----
 hw/rtc/allwinner-rtc.c              | 12 ++++--------
 hw/rtc/aspeed_rtc.c                 |  6 +-----
 hw/rtc/ds1338.c                     |  6 +-----
 hw/rtc/exynos4210_rtc.c             |  6 +-----
 hw/rtc/goldfish_rtc.c               |  6 +-----
 hw/rtc/m41t80.c                     |  6 +-----
 hw/rtc/m48t59-isa.c                 |  2 +-
 hw/rtc/m48t59.c                     |  4 ++--
 hw/rtc/mc146818rtc.c                |  6 +-----
 hw/rtc/pl031.c                      |  6 +-----
 hw/rtc/sun4v-rtc.c                  |  6 +-----
 hw/rtc/twl92230.c                   |  6 +-----
 hw/rtc/xlnx-zynqmp-rtc.c            |  6 +-----
 hw/s390x/3270-ccw.c                 |  6 +-----
 hw/s390x/ap-bridge.c                |  8 ++------
 hw/s390x/ap-device.c                |  6 +-----
 hw/s390x/ccw-device.c               |  6 +-----
 hw/s390x/css-bridge.c               |  8 ++------
 hw/s390x/event-facility.c           | 10 +++-------
 hw/s390x/ipl.c                      |  6 +-----
 hw/s390x/s390-ccw.c                 |  6 +-----
 hw/s390x/s390-pci-bus.c             | 14 +++++---------
 hw/s390x/s390-skeys-kvm.c           |  6 +-----
 hw/s390x/s390-skeys.c               |  8 ++------
 hw/s390x/s390-stattrib-kvm.c        |  6 +-----
 hw/s390x/s390-stattrib.c            |  8 ++------
 hw/s390x/s390-virtio-ccw.c          |  6 +-----
 hw/s390x/sclp.c                     |  6 +-----
 hw/s390x/sclpcpu.c                  |  6 +-----
 hw/s390x/sclpquiesce.c              |  6 +-----
 hw/s390x/tod-kvm.c                  |  6 +-----
 hw/s390x/tod-qemu.c                 |  6 +-----
 hw/s390x/tod.c                      |  6 +-----
 hw/s390x/vhost-vsock-ccw.c          |  6 +-----
 hw/s390x/virtio-ccw-9p.c            |  6 +-----
 hw/s390x/virtio-ccw-balloon.c       |  6 +-----
 hw/s390x/virtio-ccw-blk.c           |  6 +-----
 hw/s390x/virtio-ccw-crypto.c        |  6 +-----
 hw/s390x/virtio-ccw-gpu.c           |  6 +-----
 hw/s390x/virtio-ccw-input.c         | 14 +++++---------
 hw/s390x/virtio-ccw-net.c           |  6 +-----
 hw/s390x/virtio-ccw-rng.c           |  6 +-----
 hw/s390x/virtio-ccw-scsi.c          |  4 ++--
 hw/s390x/virtio-ccw-serial.c        |  6 +-----
 hw/s390x/virtio-ccw.c               |  8 ++------
 hw/scsi/esp-pci.c                   |  8 ++------
 hw/scsi/esp.c                       |  6 +-----
 hw/scsi/lsi53c895a.c                |  8 ++------
 hw/scsi/megasas.c                   |  2 +-
 hw/scsi/scsi-bus.c                  |  8 ++------
 hw/scsi/scsi-disk.c                 | 10 +++++-----
 hw/scsi/scsi-generic.c              |  6 +-----
 hw/scsi/spapr_vscsi.c               |  6 +-----
 hw/scsi/vhost-scsi-common.c         |  6 +-----
 hw/scsi/vhost-scsi.c                |  6 +-----
 hw/scsi/vhost-user-scsi.c           |  6 +-----
 hw/scsi/virtio-scsi.c               |  8 ++------
 hw/scsi/vmw_pvscsi.c                |  7 +------
 hw/sd/allwinner-sdhost.c            | 12 ++++--------
 hw/sd/aspeed_sdhci.c                |  6 +-----
 hw/sd/bcm2835_sdhost.c              |  8 ++------
 hw/sd/core.c                        |  6 +-----
 hw/sd/milkymist-memcard.c           |  6 +-----
 hw/sd/pl181.c                       |  6 +-----
 hw/sd/pxa2xx_mmci.c                 |  8 ++------
 hw/sd/sd.c                          |  6 +-----
 hw/sd/sdhci-pci.c                   |  6 +-----
 hw/sd/sdhci.c                       | 12 ++++--------
 hw/sd/ssi-sd.c                      |  6 +-----
 hw/sh4/sh_pci.c                     |  8 ++------
 hw/sparc/sun4m.c                    | 28 ++++++++++++++--------------
 hw/sparc/sun4m_iommu.c              |  8 ++------
 hw/sparc64/niagara.c                |  6 +-----
 hw/sparc64/sun4u.c                  | 12 ++++++------
 hw/sparc64/sun4u_iommu.c            |  8 ++------
 hw/ssi/aspeed_smc.c                 |  2 +-
 hw/ssi/imx_spi.c                    |  6 +-----
 hw/ssi/mss-spi.c                    |  6 +-----
 hw/ssi/pl022.c                      |  6 +-----
 hw/ssi/ssi.c                        |  8 ++------
 hw/ssi/stm32f2xx_spi.c              |  6 +-----
 hw/ssi/xilinx_spi.c                 |  6 +-----
 hw/ssi/xilinx_spips.c               | 10 +++-------
 hw/timer/a9gtimer.c                 |  6 +-----
 hw/timer/allwinner-a10-pit.c        |  6 +-----
 hw/timer/altera_timer.c             |  6 +-----
 hw/timer/arm_mptimer.c              |  6 +-----
 hw/timer/arm_timer.c                |  8 ++------
 hw/timer/armv7m_systick.c           |  6 +-----
 hw/timer/aspeed_timer.c             | 12 ++++--------
 hw/timer/avr_timer16.c              |  6 +-----
 hw/timer/bcm2835_systmr.c           |  6 +-----
 hw/timer/cadence_ttc.c              |  6 +-----
 hw/timer/cmsdk-apb-dualtimer.c      |  6 +-----
 hw/timer/cmsdk-apb-timer.c          |  6 +-----
 hw/timer/digic-timer.c              |  6 +-----
 hw/timer/etraxfs_timer.c            |  6 +-----
 hw/timer/exynos4210_mct.c           |  6 +-----
 hw/timer/exynos4210_pwm.c           |  6 +-----
 hw/timer/grlib_gptimer.c            |  6 +-----
 hw/timer/hpet.c                     |  6 +-----
 hw/timer/i8254.c                    |  6 +-----
 hw/timer/i8254_common.c             |  6 +-----
 hw/timer/imx_epit.c                 |  6 +-----
 hw/timer/imx_gpt.c                  | 12 ++++--------
 hw/timer/lm32_timer.c               |  6 +-----
 hw/timer/milkymist-sysctl.c         |  6 +-----
 hw/timer/mss-timer.c                |  6 +-----
 hw/timer/nrf51_timer.c              |  6 +-----
 hw/timer/puv3_ost.c                 |  6 +-----
 hw/timer/pxa2xx_timer.c             | 10 +++-------
 hw/timer/renesas_cmt.c              |  6 +-----
 hw/timer/renesas_tmr.c              |  6 +-----
 hw/timer/slavio_timer.c             |  6 +-----
 hw/timer/stm32f2xx_timer.c          |  6 +-----
 hw/timer/xilinx_timer.c             |  6 +-----
 hw/tpm/tpm_crb.c                    |  6 +-----
 hw/tpm/tpm_spapr.c                  |  6 +-----
 hw/tpm/tpm_tis_isa.c                |  6 +-----
 hw/tpm/tpm_tis_sysbus.c             |  6 +-----
 hw/usb/bus.c                        |  8 ++------
 hw/usb/ccid-card-emulated.c         |  6 +-----
 hw/usb/ccid-card-passthru.c         |  6 +-----
 hw/usb/chipidea.c                   |  6 +-----
 hw/usb/dev-audio.c                  |  2 +-
 hw/usb/dev-hid.c                    |  8 ++++----
 hw/usb/dev-hub.c                    |  6 +-----
 hw/usb/dev-mtp.c                    |  6 +-----
 hw/usb/dev-network.c                |  6 +-----
 hw/usb/dev-serial.c                 |  6 +++---
 hw/usb/dev-smartcard-reader.c       |  6 +++---
 hw/usb/dev-storage.c                | 10 +++-------
 hw/usb/dev-uas.c                    |  6 +-----
 hw/usb/dev-wacom.c                  |  2 +-
 hw/usb/hcd-dwc2.c                   |  6 +-----
 hw/usb/hcd-ehci-pci.c               |  2 +-
 hw/usb/hcd-ehci-sysbus.c            | 18 +++++++-----------
 hw/usb/hcd-ohci-pci.c               |  6 +-----
 hw/usb/hcd-ohci.c                   |  6 +-----
 hw/usb/hcd-uhci.c                   |  2 +-
 hw/usb/hcd-xhci-nec.c               |  6 +-----
 hw/usb/hcd-xhci.c                   |  8 ++------
 hw/usb/host-libusb.c                |  6 +-----
 hw/usb/imx-usb-phy.c                |  6 +-----
 hw/usb/redirect.c                   |  6 +-----
 hw/usb/tusb6010.c                   |  6 +-----
 hw/vfio/amd-xgbe.c                  |  6 +-----
 hw/vfio/ap.c                        |  6 +-----
 hw/vfio/calxeda-xgmac.c             |  6 +-----
 hw/vfio/ccw.c                       |  6 +-----
 hw/vfio/igd.c                       |  6 +-----
 hw/vfio/pci.c                       |  8 ++------
 hw/vfio/platform.c                  |  6 +-----
 hw/virtio/vhost-user-fs.c           |  6 +-----
 hw/virtio/vhost-user-vsock.c        |  6 +-----
 hw/virtio/vhost-vsock-common.c      |  6 +-----
 hw/virtio/vhost-vsock.c             |  6 +-----
 hw/virtio/virtio-balloon.c          |  6 +-----
 hw/virtio/virtio-bus.c              |  6 +-----
 hw/virtio/virtio-crypto.c           |  6 +-----
 hw/virtio/virtio-input-pci.c        |  4 ++--
 hw/virtio/virtio-iommu.c            |  8 ++------
 hw/virtio/virtio-mem.c              |  6 +-----
 hw/virtio/virtio-mmio.c             |  8 ++------
 hw/virtio/virtio-pci.c              |  4 ++--
 hw/virtio/virtio-pmem.c             |  6 +-----
 hw/virtio/virtio-rng.c              |  6 +-----
 hw/virtio/virtio.c                  |  6 +-----
 hw/watchdog/cmsdk-apb-watchdog.c    |  8 ++------
 hw/watchdog/wdt_aspeed.c            |  8 ++++----
 hw/watchdog/wdt_diag288.c           |  2 +-
 hw/watchdog/wdt_i6300esb.c          |  2 +-
 hw/watchdog/wdt_ib700.c             |  2 +-
 hw/watchdog/wdt_imx2.c              |  2 +-
 hw/xen/xen-bus.c                    | 10 +++-------
 hw/xen/xen-legacy-backend.c         | 10 +++-------
 hw/xen/xen_pt.c                     |  6 +-----
 hw/xtensa/xtfpga.c                  | 20 ++++++++------------
 io/channel-buffer.c                 |  6 +-----
 io/channel-command.c                |  6 +-----
 io/channel-file.c                   |  6 +-----
 io/channel-socket.c                 |  6 +-----
 io/channel-tls.c                    |  6 +-----
 io/channel-websock.c                |  6 +-----
 io/channel.c                        |  6 +-----
 io/dns-resolver.c                   |  6 +-----
 io/net-listener.c                   |  6 +-----
 iothread.c                          |  6 +-----
 migration/migration.c               |  6 +-----
 migration/rdma.c                    |  6 +-----
 net/can/can_core.c                  |  6 +-----
 net/can/can_host.c                  |  6 +-----
 net/can/can_socketcan.c             |  6 +-----
 net/colo-compare.c                  |  6 +-----
 net/dump.c                          |  6 +-----
 net/filter-buffer.c                 |  6 +-----
 net/filter-mirror.c                 |  8 ++------
 net/filter-replay.c                 |  6 +-----
 net/filter-rewriter.c               |  6 +-----
 net/filter.c                        |  6 +-----
 qom/container.c                     |  6 +-----
 scsi/pr-manager-helper.c            |  6 +-----
 scsi/pr-manager.c                   |  7 +------
 softmmu/memory.c                    |  8 ++------
 target/arm/cpu.c                    |  4 ++--
 target/arm/cpu64.c                  |  2 +-
 target/hppa/cpu.c                   |  6 +-----
 target/i386/cpu.c                   |  8 ++++----
 target/i386/hax-all.c               |  6 +-----
 target/i386/hvf/hvf.c               |  6 +-----
 target/i386/sev.c                   |  7 +------
 target/i386/whpx-all.c              |  6 +-----
 target/microblaze/cpu.c             |  6 +-----
 target/mips/cpu.c                   |  2 +-
 target/nios2/cpu.c                  |  6 +-----
 target/ppc/translate_init.inc.c     |  4 ++--
 target/rx/cpu.c                     |  8 ++------
 target/s390x/cpu.c                  |  6 +-----
 target/s390x/cpu_models.c           |  6 +++---
 target/sparc/cpu.c                  |  2 +-
 target/tilegx/cpu.c                 |  6 +-----
 target/xtensa/cpu.c                 |  6 +-----
 ui/console.c                        |  6 +-----
 ui/input-barrier.c                  |  6 +-----
 ui/input-linux.c                    |  6 +-----
 819 files changed, 1183 insertions(+), 4322 deletions(-)
accel/accel.c +1 -5
index cb555e3b06..5239dd7f45 100644
@@ -36,6 +36,7 @@ static const TypeInfo accel_type = {
     .class_size = sizeof(AccelClass),
     .instance_size = sizeof(AccelState),
 };
+TYPE_INFO(accel_type)
 
 /* Lookup AccelClass from opt_name. Returns NULL if not found */
 AccelClass *accel_find(const char *opt_name)
@@ -77,9 +78,4 @@ void accel_setup_post(MachineState *ms)
     }
 }
 
-static void register_accel_types(void)
-{
-    type_register_static(&accel_type);
-}
 
-type_init(register_accel_types);
accel/kvm/kvm-all.c +1 -5
index 63ef6af9a1..ab89d0ef94 100644
@@ -3208,10 +3208,6 @@ static const TypeInfo kvm_accel_type = {
     .class_init = kvm_accel_class_init,
     .instance_size = sizeof(KVMState),
 };
+TYPE_INFO(kvm_accel_type)
 
-static void kvm_type_init(void)
-{
-    type_register_static(&kvm_accel_type);
-}
 
-type_init(kvm_type_init);
accel/qtest.c +1 -5
index 5b88f55921..d19a6297bb 100644
@@ -45,10 +45,6 @@ static const TypeInfo qtest_accel_type = {
     .parent = TYPE_ACCEL,
     .class_init = qtest_accel_class_init,
 };
+TYPE_INFO(qtest_accel_type)
 
-static void qtest_type_init(void)
-{
-    type_register_static(&qtest_accel_type);
-}
 
-type_init(qtest_type_init);
accel/tcg/tcg-all.c +1 -5
index eace2c113b..c29e72fb1f 100644
@@ -217,10 +217,6 @@ static const TypeInfo tcg_accel_type = {
     .class_init = tcg_accel_class_init,
     .instance_size = sizeof(TCGState),
 };
+TYPE_INFO(tcg_accel_type)
 
-static void register_accel_types(void)
-{
-    type_register_static(&tcg_accel_type);
-}
 
-type_init(register_accel_types);
accel/xen/xen-all.c +1 -5
index 60b971d0a8..888053a39f 100644
@@ -213,10 +213,6 @@ static const TypeInfo xen_accel_type = {
     .parent = TYPE_ACCEL,
     .class_init = xen_accel_class_init,
 };
+TYPE_INFO(xen_accel_type)
 
-static void xen_type_init(void)
-{
-    type_register_static(&xen_accel_type);
-}
 
-type_init(xen_type_init);
authz/base.c +1 -5
index c75bce3fd1..619b4bb706 100644
@@ -73,11 +73,7 @@ static const TypeInfo authz_info = {
     .class_size = sizeof(QAuthZClass),
     .abstract = true,
 };
+TYPE_INFO(authz_info)
 
-static void qauthz_register_types(void)
-{
-    type_register_static(&authz_info);
-}
 
-type_init(qauthz_register_types)
 
authz/list.c +1 -6
index 8e904bfc93..bfe1310d47 100644
@@ -259,13 +259,8 @@ static const TypeInfo qauthz_list_info = {
         { }
     }
 };
+TYPE_INFO(qauthz_list_info)
 
 
-static void
-qauthz_list_register_types(void)
-{
-    type_register_static(&qauthz_list_info);
-}
 
 
-type_init(qauthz_list_register_types);
authz/listfile.c +1 -6
index 666df872ad..048255aa76 100644
@@ -270,13 +270,8 @@ static const TypeInfo qauthz_list_file_info = {
         { }
     }
 };
+TYPE_INFO(qauthz_list_file_info)
 
 
-static void
-qauthz_list_file_register_types(void)
-{
-    type_register_static(&qauthz_list_file_info);
-}
 
 
-type_init(qauthz_list_file_register_types);
authz/pamacct.c +1 -6
index 3c6be43916..7dd240f654 100644
@@ -136,13 +136,8 @@ static const TypeInfo qauthz_pam_info = {
         { }
     }
 };
+TYPE_INFO(qauthz_pam_info)
 
 
-static void
-qauthz_pam_register_types(void)
-{
-    type_register_static(&qauthz_pam_info);
-}
 
 
-type_init(qauthz_pam_register_types);
authz/simple.c +1 -6
index 84954b80a5..f9c53df352 100644
@@ -103,13 +103,8 @@ static const TypeInfo qauthz_simple_info = {
         { }
     }
 };
+TYPE_INFO(qauthz_simple_info)
 
 
-static void
-qauthz_simple_register_types(void)
-{
-    type_register_static(&qauthz_simple_info);
-}
 
 
-type_init(qauthz_simple_register_types);
backends/cryptodev-builtin.c +1 -6
index 14316333fe..cb3690383f 100644
@@ -384,11 +384,6 @@ static const TypeInfo cryptodev_builtin_info = {
     .class_init = cryptodev_builtin_class_init,
     .instance_size = sizeof(CryptoDevBackendBuiltin),
 };
+TYPE_INFO(cryptodev_builtin_info)
 
-static void
-cryptodev_builtin_register_types(void)
-{
-    type_register_static(&cryptodev_builtin_info);
-}
 
-type_init(cryptodev_builtin_register_types);
backends/cryptodev-vhost-user.c +1 -6
index dbe5a8aae6..0fffa10214 100644
@@ -372,11 +372,6 @@ static const TypeInfo cryptodev_vhost_user_info = {
     .instance_finalize = cryptodev_vhost_user_finalize,
     .instance_size = sizeof(CryptoDevBackendVhostUser),
 };
+TYPE_INFO(cryptodev_vhost_user_info)
 
-static void
-cryptodev_vhost_user_register_types(void)
-{
-    type_register_static(&cryptodev_vhost_user_info);
-}
 
-type_init(cryptodev_vhost_user_register_types);
backends/cryptodev.c +1 -6
index ada4ebe78b..9180af54e9 100644
@@ -245,11 +245,6 @@ static const TypeInfo cryptodev_backend_info = {
         { }
     }
 };
+TYPE_INFO(cryptodev_backend_info)
 
-static void
-cryptodev_backend_register_types(void)
-{
-    type_register_static(&cryptodev_backend_info);
-}
 
-type_init(cryptodev_backend_register_types);
backends/dbus-vmstate.c +1 -6
index 56361a6272..d8cc3e7e25 100644
@@ -499,11 +499,6 @@ static const TypeInfo dbus_vmstate_info = {
         { }
     }
 };
+TYPE_INFO(dbus_vmstate_info)
 
-static void
-register_types(void)
-{
-    type_register_static(&dbus_vmstate_info);
-}
 
-type_init(register_types);
backends/hostmem-file.c +1 -5
index 5b819020b4..5037357cd0 100644
@@ -199,10 +199,6 @@ static const TypeInfo file_backend_info = {
     .instance_finalize = file_backend_instance_finalize,
     .instance_size = sizeof(HostMemoryBackendFile),
 };
+TYPE_INFO(file_backend_info)
 
-static void register_types(void)
-{
-    type_register_static(&file_backend_info);
-}
 
-type_init(register_types);
backends/hostmem-memfd.c +1 -1
index 4c040a7541..4b4f13a3ca 100644
@@ -161,11 +161,11 @@ static const TypeInfo memfd_backend_info = {
     .class_init = memfd_backend_class_init,
     .instance_size = sizeof(HostMemoryBackendMemfd),
 };
+TYPE_INFO(memfd_backend_info)
 
 static void register_types(void)
 {
     if (qemu_memfd_check(MFD_ALLOW_SEALING)) {
-        type_register_static(&memfd_backend_info);
     }
 }
 
backends/hostmem-ram.c +1 -5
index 5cc53e76c9..3bbe53f1ce 100644
@@ -45,10 +45,6 @@ static const TypeInfo ram_backend_info = {
     .parent = TYPE_MEMORY_BACKEND,
     .class_init = ram_backend_class_init,
 };
+TYPE_INFO(ram_backend_info)
 
-static void register_types(void)
-{
-    type_register_static(&ram_backend_info);
-}
 
-type_init(register_types);
backends/hostmem.c +1 -5
index 4bde00e8e7..49d15e61be 100644
@@ -516,10 +516,6 @@ static const TypeInfo host_memory_backend_info = {
         { }
     }
 };
+TYPE_INFO(host_memory_backend_info)
 
-static void register_types(void)
-{
-    type_register_static(&host_memory_backend_info);
-}
 
-type_init(register_types);
backends/rng-builtin.c +1 -5
index ba1b8d66b8..d6afd54b3e 100644
@@ -68,10 +68,6 @@ static const TypeInfo rng_builtin_info = {
     .instance_finalize = rng_builtin_finalize,
     .class_init = rng_builtin_class_init,
 };
+TYPE_INFO(rng_builtin_info)
 
-static void register_types(void)
-{
-    type_register_static(&rng_builtin_info);
-}
 
-type_init(register_types);
backends/rng-egd.c +1 -5
index 7aaa6ee239..90d57417ff 100644
@@ -165,10 +165,6 @@ static const TypeInfo rng_egd_info = {
     .instance_init = rng_egd_init,
     .instance_finalize = rng_egd_finalize,
 };
+TYPE_INFO(rng_egd_info)
 
-static void register_types(void)
-{
-    type_register_static(&rng_egd_info);
-}
 
-type_init(register_types);
backends/rng-random.c +1 -5
index 32998d8ee7..59dba2b3f4 100644
@@ -144,10 +144,6 @@ static const TypeInfo rng_random_info = {
     .instance_init = rng_random_init,
     .instance_finalize = rng_random_finalize,
 };
+TYPE_INFO(rng_random_info)
 
-static void register_types(void)
-{
-    type_register_static(&rng_random_info);
-}
 
-type_init(register_types);
backends/rng.c +1 -5
index 484f04e891..dcea7a89e9 100644
@@ -139,10 +139,6 @@ static const TypeInfo rng_backend_info = {
         { }
     }
 };
+TYPE_INFO(rng_backend_info)
 
-static void register_types(void)
-{
-    type_register_static(&rng_backend_info);
-}
 
-type_init(register_types);
backends/tpm/tpm_backend.c +2 -6
index 375587e743..9aac3df542 100644
@@ -192,17 +192,13 @@ static const TypeInfo tpm_backend_info = {
     .class_size = sizeof(TPMBackendClass),
     .abstract = true,
 };
+TYPE_INFO(tpm_backend_info)
 
 static const TypeInfo tpm_if_info = {
     .name = TYPE_TPM_IF,
     .parent = TYPE_INTERFACE,
     .class_size = sizeof(TPMIfClass),
 };
+TYPE_INFO(tpm_if_info)
 
-static void register_types(void)
-{
-    type_register_static(&tpm_backend_info);
-    type_register_static(&tpm_if_info);
-}
 
-type_init(register_types);
backends/tpm/tpm_emulator.c +1 -5
index a9b0f55e67..ac441337d9 100644
@@ -996,10 +996,6 @@ static const TypeInfo tpm_emulator_info = {
     .instance_init = tpm_emulator_inst_init,
     .instance_finalize = tpm_emulator_inst_finalize,
 };
+TYPE_INFO(tpm_emulator_info)
 
-static void tpm_emulator_register(void)
-{
-    type_register_static(&tpm_emulator_info);
-}
 
-type_init(tpm_emulator_register)
backends/tpm/tpm_passthrough.c +1 -5
index 7403807ec4..8e67b4b7d6 100644
@@ -396,10 +396,6 @@ static const TypeInfo tpm_passthrough_info = {
     .instance_init = tpm_passthrough_inst_init,
     .instance_finalize = tpm_passthrough_inst_finalize,
 };
+TYPE_INFO(tpm_passthrough_info)
 
-static void tpm_passthrough_register(void)
-{
-    type_register_static(&tpm_passthrough_info);
-}
 
-type_init(tpm_passthrough_register)
backends/vhost-user.c +1 -5
index 9e6e198546..25873b1981 100644
@@ -199,10 +199,6 @@ static const TypeInfo vhost_user_backend_info = {
     .instance_finalize = vhost_user_backend_finalize,
     .class_size = sizeof(VhostUserBackendClass),
 };
+TYPE_INFO(vhost_user_backend_info)
 
-static void register_types(void)
-{
-    type_register_static(&vhost_user_backend_info);
-}
 
-type_init(register_types);
block/throttle-groups.c +1 -5
index 4e28365d8d..49f68bef50 100644
@@ -968,10 +968,6 @@ static const TypeInfo throttle_group_info = {
         { }
     },
 };
+TYPE_INFO(throttle_group_info)
 
-static void throttle_groups_init(void)
-{
-    type_register_static(&throttle_group_info);
-}
 
-type_init(throttle_groups_init);
chardev/baum.c +1 -5
index 9c95e7bc79..f111ebfe05 100644
@@ -677,10 +677,6 @@ static const TypeInfo char_braille_type_info = {
     .instance_finalize = char_braille_finalize,
     .class_init = char_braille_class_init,
 };
+TYPE_INFO(char_braille_type_info)
 
-static void register_types(void)
-{
-    type_register_static(&char_braille_type_info);
-}
 
-type_init(register_types);
chardev/char-console.c +1 -5
index 6c4ce5dbce..89b083c5b9 100644
@@ -46,10 +46,6 @@ static const TypeInfo char_console_type_info = {
     .parent = TYPE_CHARDEV_WIN,
     .class_init = char_console_class_init,
 };
+TYPE_INFO(char_console_type_info)
 
-static void register_types(void)
-{
-    type_register_static(&char_console_type_info);
-}
 
-type_init(register_types);
chardev/char-fd.c +1 -5
index c2d8101106..b263e285f0 100644
@@ -161,10 +161,6 @@ static const TypeInfo char_fd_type_info = {
     .class_init = char_fd_class_init,
     .abstract = true,
 };
+TYPE_INFO(char_fd_type_info)
 
-static void register_types(void)
-{
-    type_register_static(&char_fd_type_info);
-}
 
-type_init(register_types);
chardev/char-mux.c +1 -5
index 6f980bb836..c3be4e40e5 100644
@@ -394,10 +394,6 @@ static const TypeInfo char_mux_type_info = {
     .instance_size = sizeof(MuxChardev),
     .instance_finalize = char_mux_finalize,
 };
+TYPE_INFO(char_mux_type_info)
 
-static void register_types(void)
-{
-    type_register_static(&char_mux_type_info);
-}
 
-type_init(register_types);
chardev/char-null.c +1 -5
index 1c6a2900f9..ce43ccdda6 100644
@@ -47,10 +47,6 @@ static const TypeInfo char_null_type_info = {
     .instance_size = sizeof(Chardev),
     .class_init = char_null_class_init,
 };
+TYPE_INFO(char_null_type_info)
 
-static void register_types(void)
-{
-    type_register_static(&char_null_type_info);
-}
 
-type_init(register_types);
chardev/char-parallel.c +1 -5
index 05e7efbd6c..dd60ef9898 100644
@@ -308,12 +308,8 @@ static const TypeInfo char_parallel_type_info = {
     .instance_finalize = char_parallel_finalize,
     .class_init = char_parallel_class_init,
 };
+TYPE_INFO(char_parallel_type_info)
 
-static void register_types(void)
-{
-    type_register_static(&char_parallel_type_info);
-}
 
-type_init(register_types);
 
 #endif
chardev/char-pty.c +1 -5
index 1cc501a481..40d7bddba3 100644
@@ -243,10 +243,6 @@ static const TypeInfo char_pty_type_info = {
     .instance_finalize = char_pty_finalize,
     .class_init = char_pty_class_init,
 };
+TYPE_INFO(char_pty_type_info)
 
-static void register_types(void)
-{
-    type_register_static(&char_pty_type_info);
-}
 
-type_init(register_types);
chardev/char-ringbuf.c +2 -6
index 67397a8ce9..fe9881b85b 100644
@@ -237,17 +237,13 @@ static const TypeInfo char_ringbuf_type_info = {
     .instance_size = sizeof(RingBufChardev),
     .instance_finalize = char_ringbuf_finalize,
 };
+TYPE_INFO(char_ringbuf_type_info)
 
 /* Bug-compatibility: */
 static const TypeInfo char_memory_type_info = {
     .name = TYPE_CHARDEV_MEMORY,
     .parent = TYPE_CHARDEV_RINGBUF,
 };
+TYPE_INFO(char_memory_type_info)
 
-static void register_types(void)
-{
-    type_register_static(&char_ringbuf_type_info);
-    type_register_static(&char_memory_type_info);
-}
 
-type_init(register_types);
chardev/char-socket.c +1 -5
index ef62dbf3d7..8c4ff2effb 100644
@@ -1510,10 +1510,6 @@ static const TypeInfo char_socket_type_info = {
     .instance_finalize = char_socket_finalize,
     .class_init = char_socket_class_init,
 };
+TYPE_INFO(char_socket_type_info)
 
-static void register_types(void)
-{
-    type_register_static(&char_socket_type_info);
-}
 
-type_init(register_types);
chardev/char-udp.c +1 -5
index bba4145f96..0d175b62e0 100644
@@ -234,10 +234,6 @@ static const TypeInfo char_udp_type_info = {
     .instance_finalize = char_udp_finalize,
     .class_init = char_udp_class_init,
 };
+TYPE_INFO(char_udp_type_info)
 
-static void register_types(void)
-{
-    type_register_static(&char_udp_type_info);
-}
 
-type_init(register_types);
chardev/char-win-stdio.c +1 -5
index 99afda353c..a6794d26d7 100644
@@ -260,10 +260,6 @@ static const TypeInfo char_win_stdio_type_info = {
     .class_init = char_win_stdio_class_init,
     .abstract = true,
 };
+TYPE_INFO(char_win_stdio_type_info)
 
-static void register_types(void)
-{
-    type_register_static(&char_win_stdio_type_info);
-}
 
-type_init(register_types);
chardev/char-win.c +1 -5
index d4fb44c4dc..f7965c1aca 100644
@@ -235,10 +235,6 @@ static const TypeInfo char_win_type_info = {
     .class_init = char_win_class_init,
     .abstract = true,
 };
+TYPE_INFO(char_win_type_info)
 
-static void register_types(void)
-{
-    type_register_static(&char_win_type_info);
-}
 
-type_init(register_types);
chardev/char.c +1 -5
index 77e7ec814f..9665aa5b20 100644
@@ -304,6 +304,7 @@ static const TypeInfo char_type_info = {
     .class_size = sizeof(ChardevClass),
     .class_init = char_class_init,
 };
+TYPE_INFO(char_type_info)
 
 static bool qemu_chr_is_busy(Chardev *s)
 {
@@ -1168,9 +1169,4 @@ void qemu_chr_cleanup(void)
     object_unparent(get_chardevs_root());
 }
 
-static void register_types(void)
-{
-    type_register_static(&char_type_info);
-}
 
-type_init(register_types);
chardev/msmouse.c +1 -5
index 6d8f06fed4..680c772f6f 100644
@@ -182,10 +182,6 @@ static const TypeInfo char_msmouse_type_info = {
     .instance_finalize = char_msmouse_finalize,
     .class_init = char_msmouse_class_init,
 };
+TYPE_INFO(char_msmouse_type_info)
 
-static void register_types(void)
-{
-    type_register_static(&char_msmouse_type_info);
-}
 
-type_init(register_types);
chardev/spice.c +3 -7
index bf7ea1e294..08555d6c43 100644
@@ -383,6 +383,7 @@ static const TypeInfo char_spice_type_info = {
     .class_init = char_spice_class_init,
     .abstract = true,
 };
+TYPE_INFO(char_spice_type_info)
 
 static void char_spicevmc_class_init(ObjectClass *oc, void *data)
 {
@@ -398,6 +399,7 @@ static const TypeInfo char_spicevmc_type_info = {
     .parent = TYPE_CHARDEV_SPICE,
     .class_init = char_spicevmc_class_init,
 };
+TYPE_INFO(char_spicevmc_type_info)
 
 static void char_spiceport_class_init(ObjectClass *oc, void *data)
 {
@@ -413,12 +415,6 @@ static const TypeInfo char_spiceport_type_info = {
     .parent = TYPE_CHARDEV_SPICE,
     .class_init = char_spiceport_class_init,
 };
+TYPE_INFO(char_spiceport_type_info)
 
-static void register_types(void)
-{
-    type_register_static(&char_spice_type_info);
-    type_register_static(&char_spicevmc_type_info);
-    type_register_static(&char_spiceport_type_info);
-}
 
-type_init(register_types);
chardev/testdev.c +1 -5
index 368a8c041e..0c0ddc17d7 100644
@@ -121,10 +121,6 @@ static const TypeInfo char_testdev_type_info = {
     .instance_size = sizeof(TestdevChardev),
     .class_init = char_testdev_class_init,
 };
+TYPE_INFO(char_testdev_type_info)
 
-static void register_types(void)
-{
-    type_register_static(&char_testdev_type_info);
-}
 
-type_init(register_types);
chardev/wctablet.c +1 -5
index e9cb7ca710..95c7504002 100644
@@ -356,10 +356,6 @@ static const TypeInfo wctablet_type_info = {
     .instance_finalize = wctablet_chr_finalize,
     .class_init = wctablet_chr_class_init,
 };
+TYPE_INFO(wctablet_type_info)
 
-static void register_types(void)
-{
-     type_register_static(&wctablet_type_info);
-}
 
-type_init(register_types);
crypto/secret.c +1 -6
index 281cb81f0f..c07011d388 100644
@@ -153,13 +153,8 @@ static const TypeInfo qcrypto_secret_info = {
         { }
     }
 };
+TYPE_INFO(qcrypto_secret_info)
 
 
-static void
-qcrypto_secret_register_types(void)
-{
-    type_register_static(&qcrypto_secret_info);
-}
 
 
-type_init(qcrypto_secret_register_types);
crypto/secret_common.c +1 -6
index b03d530867..80d7d75b4d 100644
@@ -391,13 +391,8 @@ static const TypeInfo qcrypto_secret_info = {
     .class_init = qcrypto_secret_class_init,
     .abstract = true,
 };
+TYPE_INFO(qcrypto_secret_info)
 
 
-static void
-qcrypto_secret_register_types(void)
-{
-    type_register_static(&qcrypto_secret_info);
-}
 
 
-type_init(qcrypto_secret_register_types);
crypto/secret_keyring.c +1 -6
index 8bfc58ebf4..821d2e421b 100644
@@ -136,13 +136,8 @@ static const TypeInfo qcrypto_secret_info = {
         { }
     }
 };
+TYPE_INFO(qcrypto_secret_info)
 
 
-static void
-qcrypto_secret_register_types(void)
-{
-    type_register_static(&qcrypto_secret_info);
-}
 
 
-type_init(qcrypto_secret_register_types);
crypto/tls-cipher-suites.c +1 -5
index 0d305b684b..e92a380a24 100644
@@ -117,10 +117,6 @@ static const TypeInfo qcrypto_tls_cipher_suites_info = {
         { }
     }
 };
+TYPE_INFO(qcrypto_tls_cipher_suites_info)
 
-static void qcrypto_tls_cipher_suites_register_types(void)
-{
-    type_register_static(&qcrypto_tls_cipher_suites_info);
-}
 
-type_init(qcrypto_tls_cipher_suites_register_types);
crypto/tlscreds.c +1 -6
index b68735f06f..bb3e6667b9 100644
@@ -270,13 +270,8 @@ static const TypeInfo qcrypto_tls_creds_info = {
     .class_size = sizeof(QCryptoTLSCredsClass),
     .abstract = true,
 };
+TYPE_INFO(qcrypto_tls_creds_info)
 
 
-static void
-qcrypto_tls_creds_register_types(void)
-{
-    type_register_static(&qcrypto_tls_creds_info);
-}
 
 
-type_init(qcrypto_tls_creds_register_types);
crypto/tlscredsanon.c +1 -6
index 30275b6847..16162e60b6 100644
@@ -203,13 +203,8 @@ static const TypeInfo qcrypto_tls_creds_anon_info = {
         { }
     }
 };
+TYPE_INFO(qcrypto_tls_creds_anon_info)
 
 
-static void
-qcrypto_tls_creds_anon_register_types(void)
-{
-    type_register_static(&qcrypto_tls_creds_anon_info);
-}
 
 
-type_init(qcrypto_tls_creds_anon_register_types);
crypto/tlscredspsk.c +1 -6
index e26807b899..ea890f5837 100644
@@ -294,13 +294,8 @@ static const TypeInfo qcrypto_tls_creds_psk_info = {
         { }
     }
 };
+TYPE_INFO(qcrypto_tls_creds_psk_info)
 
 
-static void
-qcrypto_tls_creds_psk_register_types(void)
-{
-    type_register_static(&qcrypto_tls_creds_psk_info);
-}
 
 
-type_init(qcrypto_tls_creds_psk_register_types);
crypto/tlscredsx509.c +1 -6
index dd7267ccdb..77f1beaf8b 100644
@@ -829,13 +829,8 @@ static const TypeInfo qcrypto_tls_creds_x509_info = {
         { }
     }
 };
+TYPE_INFO(qcrypto_tls_creds_x509_info)
 
 
-static void
-qcrypto_tls_creds_x509_register_types(void)
-{
-    type_register_static(&qcrypto_tls_creds_x509_info);
-}
 
 
-type_init(qcrypto_tls_creds_x509_register_types);
gdbstub.c +1 -5
index f3a318cd7f..03d0fb9890 100644
@@ -3308,6 +3308,7 @@ static const TypeInfo char_gdb_type_info = {
     .parent = TYPE_CHARDEV,
     .class_init = char_gdb_class_init,
 };
+TYPE_INFO(char_gdb_type_info)
 
 static int find_cpu_clusters(Object *child, void *opaque)
 {
@@ -3440,10 +3441,5 @@ void gdbserver_cleanup(void)
     }
 }
 
-static void register_types(void)
-{
-    type_register_static(&char_gdb_type_info);
-}
 
-type_init(register_types);
 #endif
hw/9pfs/virtio-9p-device.c +1 -5
index 36f3aa9352..4d16e2033f 100644
@@ -259,10 +259,6 @@ static const TypeInfo virtio_device_info = {
     .instance_size = sizeof(V9fsVirtioState),
     .class_init = virtio_9p_class_init,
 };
+TYPE_INFO(virtio_device_info)
 
-static void virtio_9p_register_types(void)
-{
-    type_register_static(&virtio_device_info);
-}
 
-type_init(virtio_9p_register_types)
hw/acpi/generic_event_device.c +1 -5
index b8abdefa1c..e766835af6 100644
@@ -363,10 +363,6 @@ static const TypeInfo acpi_ged_info = {
         { }
     }
 };
+TYPE_INFO(acpi_ged_info)
 
-static void acpi_ged_register_types(void)
-{
-    type_register_static(&acpi_ged_info);
-}
 
-type_init(acpi_ged_register_types)
hw/acpi/piix4.c +1 -5
index 26bac4f16c..f27f6660f9 100644
@@ -684,10 +684,6 @@ static const TypeInfo piix4_pm_info = {
         { }
     }
 };
+TYPE_INFO(piix4_pm_info)
 
-static void piix4_pm_register_types(void)
-{
-    type_register_static(&piix4_pm_info);
-}
 
-type_init(piix4_pm_register_types)
hw/acpi/vmgenid.c +1 -5
index 2df7623d74..ca62b6f161 100644
@@ -237,13 +237,9 @@ static const TypeInfo vmgenid_device_info = {
     .instance_size = sizeof(VmGenIdState),
     .class_init    = vmgenid_device_class_init,
 };
+TYPE_INFO(vmgenid_device_info)
 
-static void vmgenid_register_types(void)
-{
-    type_register_static(&vmgenid_device_info);
-}
 
-type_init(vmgenid_register_types)
 
 GuidInfo *qmp_query_vm_generation_id(Error **errp)
 {
hw/adc/stm32f2xx_adc.c +1 -5
index 01a0b14e69..647a47c706 100644
@@ -299,10 +299,6 @@ static const TypeInfo stm32f2xx_adc_info = {
     .instance_init = stm32f2xx_adc_init,
     .class_init    = stm32f2xx_adc_class_init,
 };
+TYPE_INFO(stm32f2xx_adc_info)
 
-static void stm32f2xx_adc_register_types(void)
-{
-    type_register_static(&stm32f2xx_adc_info);
-}
 
-type_init(stm32f2xx_adc_register_types)
hw/alpha/typhoon.c +2 -6
index 29d44dfb06..637411c10b 100644
@@ -940,6 +940,7 @@ static const TypeInfo typhoon_pcihost_info = {
     .parent        = TYPE_PCI_HOST_BRIDGE,
     .instance_size = sizeof(TyphoonState),
 };
+TYPE_INFO(typhoon_pcihost_info)
 
 static void typhoon_iommu_memory_region_class_init(ObjectClass *klass,
                                                    void *data)
@@ -954,11 +955,6 @@ static const TypeInfo typhoon_iommu_memory_region_info = {
     .name = TYPE_TYPHOON_IOMMU_MEMORY_REGION,
     .class_init = typhoon_iommu_memory_region_class_init,
 };
+TYPE_INFO(typhoon_iommu_memory_region_info)
 
-static void typhoon_register_types(void)
-{
-    type_register_static(&typhoon_pcihost_info);
-    type_register_static(&typhoon_iommu_memory_region_info);
-}
 
-type_init(typhoon_register_types)
hw/arm/allwinner-a10.c +1 -5
index e258463747..1dad8a226b 100644
@@ -182,10 +182,6 @@ static const TypeInfo aw_a10_type_info = {
     .instance_init = aw_a10_init,
     .class_init = aw_a10_class_init,
 };
+TYPE_INFO(aw_a10_type_info)
 
-static void aw_a10_register_types(void)
-{
-    type_register_static(&aw_a10_type_info);
-}
 
-type_init(aw_a10_register_types)
hw/arm/allwinner-h3.c +1 -5
index 341abe6718..c59d2ffc3e 100644
@@ -446,10 +446,6 @@ static const TypeInfo allwinner_h3_type_info = {
     .instance_init = allwinner_h3_init,
     .class_init = allwinner_h3_class_init,
 };
+TYPE_INFO(allwinner_h3_type_info)
 
-static void allwinner_h3_register_types(void)
-{
-    type_register_static(&allwinner_h3_type_info);
-}
 
-type_init(allwinner_h3_register_types)
hw/arm/armsse.c +1 -1
index dcbff9bd8f..71ebfd6757 100644
@@ -1167,12 +1167,12 @@ static const TypeInfo armsse_info = {
         { }
     }
 };
+TYPE_INFO(armsse_info)
 
 static void armsse_register_types(void)
 {
     int i;
 
-    type_register_static(&armsse_info);
 
     for (i = 0; i < ARRAY_SIZE(armsse_variants); i++) {
         TypeInfo ti = {
hw/arm/armv7m.c +2 -6
index aa831d6653..684cdd5417 100644
@@ -280,6 +280,7 @@ static const TypeInfo armv7m_info = {
     .instance_init = armv7m_instance_init,
     .class_init = armv7m_class_init,
 };
+TYPE_INFO(armv7m_info)
 
 static void armv7m_reset(void *opaque)
 {
@@ -359,11 +360,6 @@ static const TypeInfo bitband_info = {
     .instance_init = bitband_init,
     .class_init    = bitband_class_init,
 };
+TYPE_INFO(bitband_info)
 
-static void armv7m_register_types(void)
-{
-    type_register_static(&bitband_info);
-    type_register_static(&armv7m_info);
-}
 
-type_init(armv7m_register_types)
hw/arm/bcm2835_peripherals.c +1 -5
index a9d7f53f6e..3d45e4ab7f 100644
@@ -373,10 +373,6 @@ static const TypeInfo bcm2835_peripherals_type_info = {
     .instance_init = bcm2835_peripherals_init,
     .class_init = bcm2835_peripherals_class_init,
 };
+TYPE_INFO(bcm2835_peripherals_type_info)
 
-static void bcm2835_peripherals_register_types(void)
-{
-    type_register_static(&bcm2835_peripherals_type_info);
-}
 
-type_init(bcm2835_peripherals_register_types)
hw/arm/bcm2836.c +1 -1
index f15cc3b405..7ae9bbdbca 100644
@@ -168,12 +168,12 @@ static const TypeInfo bcm283x_type_info = {
     .class_size = sizeof(BCM283XClass),
     .abstract = true,
 };
+TYPE_INFO(bcm283x_type_info)
 
 static void bcm2836_register_types(void)
 {
     int i;
 
-    type_register_static(&bcm283x_type_info);
     for (i = 0; i < ARRAY_SIZE(bcm283x_socs); i++) {
         TypeInfo ti = {
             .name = bcm283x_socs[i].name,
hw/arm/boot.c +1 -5
index 3e9816af80..0ee0934e81 100644
@@ -1317,10 +1317,6 @@ static const TypeInfo arm_linux_boot_if_info = {
     .parent = TYPE_INTERFACE,
     .class_size = sizeof(ARMLinuxBootIfClass),
 };
+TYPE_INFO(arm_linux_boot_if_info)
 
-static void arm_linux_boot_register_types(void)
-{
-    type_register_static(&arm_linux_boot_if_info);
-}
 
-type_init(arm_linux_boot_register_types)
hw/arm/collie.c +1 -5
index 4b35ef4bed..041bab40ef 100644
@@ -85,9 +85,5 @@ static const TypeInfo collie_machine_typeinfo = {
     .class_init = collie_machine_class_init,
     .instance_size = sizeof(CollieMachineState),
 };
+TYPE_INFO(collie_machine_typeinfo)
 
-static void collie_machine_register_types(void)
-{
-    type_register_static(&collie_machine_typeinfo);
-}
-type_init(collie_machine_register_types);
hw/arm/digic.c +1 -5
index 614232165c..aae48a4f04 100644
@@ -98,10 +98,6 @@ static const TypeInfo digic_type_info = {
     .instance_init = digic_init,
     .class_init = digic_class_init,
 };
+TYPE_INFO(digic_type_info)
 
-static void digic_register_types(void)
-{
-    type_register_static(&digic_type_info);
-}
 
-type_init(digic_register_types)
hw/arm/exynos4210.c +1 -5
index 081bbff317..e42677ded7 100644
@@ -502,10 +502,6 @@ static const TypeInfo exynos4210_info = {
     .instance_init = exynos4210_init,
     .class_init = exynos4210_class_init,
 };
+TYPE_INFO(exynos4210_info)
 
-static void exynos4210_register_types(void)
-{
-    type_register_static(&exynos4210_info);
-}
 
-type_init(exynos4210_register_types)
hw/arm/exynos4_boards.c +2 -6
index 56b729141b..7761a0fe97 100644
@@ -169,6 +169,7 @@ static const TypeInfo nuri_type = {
     .parent = TYPE_MACHINE,
     .class_init = nuri_class_init,
 };
+TYPE_INFO(nuri_type)
 
 static void smdkc210_class_init(ObjectClass *oc, void *data)
 {
@@ -187,11 +188,6 @@ static const TypeInfo smdkc210_type = {
     .parent = TYPE_MACHINE,
     .class_init = smdkc210_class_init,
 };
+TYPE_INFO(smdkc210_type)
 
-static void exynos4_machines_init(void)
-{
-    type_register_static(&nuri_type);
-    type_register_static(&smdkc210_type);
-}
 
-type_init(exynos4_machines_init)
hw/arm/fsl-imx25.c +1 -5
index 08a98f828f..256681a31a 100644
@@ -342,10 +342,6 @@ static const TypeInfo fsl_imx25_type_info = {
     .instance_init = fsl_imx25_init,
     .class_init = fsl_imx25_class_init,
 };
+TYPE_INFO(fsl_imx25_type_info)
 
-static void fsl_imx25_register_types(void)
-{
-    type_register_static(&fsl_imx25_type_info);
-}
 
-type_init(fsl_imx25_register_types)
hw/arm/fsl-imx31.c +1 -5
index 0983998bb4..6e8c780737 100644
@@ -245,10 +245,6 @@ static const TypeInfo fsl_imx31_type_info = {
     .instance_init = fsl_imx31_init,
     .class_init = fsl_imx31_class_init,
 };
+TYPE_INFO(fsl_imx31_type_info)
 
-static void fsl_imx31_register_types(void)
-{
-    type_register_static(&fsl_imx31_type_info);
-}
 
-type_init(fsl_imx31_register_types)
hw/arm/fsl-imx6.c +1 -5
index 00dafe3f62..917642a97f 100644
@@ -473,10 +473,6 @@ static const TypeInfo fsl_imx6_type_info = {
     .instance_init = fsl_imx6_init,
     .class_init = fsl_imx6_class_init,
 };
+TYPE_INFO(fsl_imx6_type_info)
 
-static void fsl_imx6_register_types(void)
-{
-    type_register_static(&fsl_imx6_type_info);
-}
 
-type_init(fsl_imx6_register_types)
hw/arm/fsl-imx6ul.c +1 -5
index e0128d7316..39b5ab528f 100644
@@ -631,9 +631,5 @@ static const TypeInfo fsl_imx6ul_type_info = {
     .instance_init = fsl_imx6ul_init,
     .class_init = fsl_imx6ul_class_init,
 };
+TYPE_INFO(fsl_imx6ul_type_info)
 
-static void fsl_imx6ul_register_types(void)
-{
-    type_register_static(&fsl_imx6ul_type_info);
-}
-type_init(fsl_imx6ul_register_types)
hw/arm/fsl-imx7.c +1 -5
index 2ff2cab924..5b062dd294 100644
@@ -577,9 +577,5 @@ static const TypeInfo fsl_imx7_type_info = {
     .instance_init = fsl_imx7_init,
     .class_init = fsl_imx7_class_init,
 };
+TYPE_INFO(fsl_imx7_type_info)
 
-static void fsl_imx7_register_types(void)
-{
-    type_register_static(&fsl_imx7_type_info);
-}
-type_init(fsl_imx7_register_types)
hw/arm/gumstix.c +2 -6
index 3a4bc332c4..bb88fae49c 100644
@@ -121,6 +121,7 @@ static const TypeInfo connex_type = {
     .parent = TYPE_MACHINE,
     .class_init = connex_class_init,
 };
+TYPE_INFO(connex_type)
 
 static void verdex_class_init(ObjectClass *oc, void *data)
 {
@@ -137,11 +138,6 @@ static const TypeInfo verdex_type = {
     .parent = TYPE_MACHINE,
     .class_init = verdex_class_init,
 };
+TYPE_INFO(verdex_type)
 
-static void gumstix_machine_init(void)
-{
-    type_register_static(&connex_type);
-    type_register_static(&verdex_type);
-}
 
-type_init(gumstix_machine_init)
hw/arm/highbank.c +3 -11
index c96f2ab9cf..07dad406b4 100644
@@ -213,13 +213,9 @@ static const TypeInfo highbank_regs_info = {
     .instance_init = highbank_regs_init,
     .class_init    = highbank_regs_class_init,
 };
+TYPE_INFO(highbank_regs_info)
 
-static void highbank_regs_register_types(void)
-{
-    type_register_static(&highbank_regs_info);
-}
 
-type_init(highbank_regs_register_types)
 
 static struct arm_boot_info highbank_binfo;
 
@@ -434,6 +430,7 @@ static const TypeInfo highbank_type = {
     .parent = TYPE_MACHINE,
     .class_init = highbank_class_init,
 };
+TYPE_INFO(highbank_type)
 
 static void midway_class_init(ObjectClass *oc, void *data)
 {
@@ -453,11 +450,6 @@ static const TypeInfo midway_type = {
     .parent = TYPE_MACHINE,
     .class_init = midway_class_init,
 };
+TYPE_INFO(midway_type)
 
-static void calxeda_machines_init(void)
-{
-    type_register_static(&highbank_type);
-    type_register_static(&midway_type);
-}
 
-type_init(calxeda_machines_init)
hw/arm/integratorcp.c +3 -7
index f304c2b4f0..1be8ed5228 100644
@@ -706,6 +706,7 @@ static const TypeInfo core_info = {
     .instance_init = integratorcm_init,
     .class_init    = core_class_init,
 };
+TYPE_INFO(core_info)
 
 static const TypeInfo icp_pic_info = {
     .name          = TYPE_INTEGRATOR_PIC,
@@ -714,6 +715,7 @@ static const TypeInfo icp_pic_info = {
     .instance_init = icp_pic_init,
     .class_init    = icp_pic_class_init,
 };
+TYPE_INFO(icp_pic_info)
 
 static const TypeInfo icp_ctrl_regs_info = {
     .name          = TYPE_ICP_CONTROL_REGS,
@@ -722,12 +724,6 @@ static const TypeInfo icp_ctrl_regs_info = {
     .instance_init = icp_control_init,
     .class_init    = icp_control_class_init,
 };
+TYPE_INFO(icp_ctrl_regs_info)
 
-static void integratorcp_register_types(void)
-{
-    type_register_static(&icp_pic_info);
-    type_register_static(&core_info);
-    type_register_static(&icp_ctrl_regs_info);
-}
 
-type_init(integratorcp_register_types)
hw/arm/microbit.c +1 -5
index a91acab1cb..92331aebf1 100644
@@ -75,10 +75,6 @@ static const TypeInfo microbit_info = {
     .instance_size = sizeof(MicrobitMachineState),
     .class_init = microbit_machine_class_init,
 };
+TYPE_INFO(microbit_info)
 
-static void microbit_machine_init(void)
-{
-    type_register_static(&microbit_info);
-}
 
-type_init(microbit_machine_init);
hw/arm/mps2-tz.c +3 -7
index 28d9e8bfac..0a1819fd67 100644
@@ -692,24 +692,20 @@ static const TypeInfo mps2tz_info = {
         { }
     },
 };
+TYPE_INFO(mps2tz_info)
 
 static const TypeInfo mps2tz_an505_info = {
     .name = TYPE_MPS2TZ_AN505_MACHINE,
     .parent = TYPE_MPS2TZ_MACHINE,
     .class_init = mps2tz_an505_class_init,
 };
+TYPE_INFO(mps2tz_an505_info)
 
 static const TypeInfo mps2tz_an521_info = {
     .name = TYPE_MPS2TZ_AN521_MACHINE,
     .parent = TYPE_MPS2TZ_MACHINE,
     .class_init = mps2tz_an521_class_init,
 };
+TYPE_INFO(mps2tz_an521_info)
 
-static void mps2tz_machine_init(void)
-{
-    type_register_static(&mps2tz_info);
-    type_register_static(&mps2tz_an505_info);
-    type_register_static(&mps2tz_an521_info);
-}
 
-type_init(mps2tz_machine_init);
hw/arm/mps2.c +3 -7
index 9f12934ca8..4ca6e1ce12 100644
@@ -428,24 +428,20 @@ static const TypeInfo mps2_info = {
     .class_size = sizeof(MPS2MachineClass),
     .class_init = mps2_class_init,
 };
+TYPE_INFO(mps2_info)
 
 static const TypeInfo mps2_an385_info = {
     .name = TYPE_MPS2_AN385_MACHINE,
     .parent = TYPE_MPS2_MACHINE,
     .class_init = mps2_an385_class_init,
 };
+TYPE_INFO(mps2_an385_info)
 
 static const TypeInfo mps2_an511_info = {
     .name = TYPE_MPS2_AN511_MACHINE,
     .parent = TYPE_MPS2_MACHINE,
     .class_init = mps2_an511_class_init,
 };
+TYPE_INFO(mps2_an511_info)
 
-static void mps2_machine_init(void)
-{
-    type_register_static(&mps2_info);
-    type_register_static(&mps2_an385_info);
-    type_register_static(&mps2_an511_info);
-}
 
-type_init(mps2_machine_init);
hw/arm/msf2-soc.c +1 -5
index d2c29e82d1..5e922b1942 100644
@@ -234,10 +234,6 @@ static const TypeInfo m2sxxx_soc_info = {
     .instance_init = m2sxxx_soc_initfn,
     .class_init    = m2sxxx_soc_class_init,
 };
+TYPE_INFO(m2sxxx_soc_info)
 
-static void m2sxxx_soc_types(void)
-{
-    type_register_static(&m2sxxx_soc_info);
-}
 
-type_init(m2sxxx_soc_types)
hw/arm/musca.c +3 -7
index 4bc737f93b..8afc118134 100644
@@ -647,24 +647,20 @@ static const TypeInfo musca_info = {
     .class_size = sizeof(MuscaMachineClass),
     .class_init = musca_class_init,
 };
+TYPE_INFO(musca_info)
 
 static const TypeInfo musca_a_info = {
     .name = TYPE_MUSCA_A_MACHINE,
     .parent = TYPE_MUSCA_MACHINE,
     .class_init = musca_a_class_init,
 };
+TYPE_INFO(musca_a_info)
 
 static const TypeInfo musca_b1_info = {
     .name = TYPE_MUSCA_B1_MACHINE,
     .parent = TYPE_MUSCA_MACHINE,
     .class_init = musca_b1_class_init,
 };
+TYPE_INFO(musca_b1_info)
 
-static void musca_machine_init(void)
-{
-    type_register_static(&musca_info);
-    type_register_static(&musca_a_info);
-    type_register_static(&musca_b1_info);
-}
 
-type_init(musca_machine_init);
hw/arm/musicpal.c +9 -13
index c3b9780f35..9decd7abd1 100644
@@ -447,6 +447,7 @@ static const TypeInfo mv88w8618_eth_info = {
     .instance_init = mv88w8618_eth_init,
     .class_init    = mv88w8618_eth_class_init,
 };
+TYPE_INFO(mv88w8618_eth_info)
 
 /* LCD register offsets */
 #define MP_LCD_IRQCTRL          0x180
@@ -678,6 +679,7 @@ static const TypeInfo musicpal_lcd_info = {
     .instance_init = musicpal_lcd_init,
     .class_init    = musicpal_lcd_class_init,
 };
+TYPE_INFO(musicpal_lcd_info)
 
 /* PIC register offsets */
 #define MP_PIC_STATUS           0x00
@@ -800,6 +802,7 @@ static const TypeInfo mv88w8618_pic_info = {
     .instance_init = mv88w8618_pic_init,
     .class_init    = mv88w8618_pic_class_init,
 };
+TYPE_INFO(mv88w8618_pic_info)
 
 /* PIT register offsets */
 #define MP_PIT_TIMER1_LENGTH    0x00
@@ -984,6 +987,7 @@ static const TypeInfo mv88w8618_pit_info = {
     .instance_init = mv88w8618_pit_init,
     .class_init    = mv88w8618_pit_class_init,
 };
+TYPE_INFO(mv88w8618_pit_info)
 
 /* Flash config register offsets */
 #define MP_FLASHCFG_CFGR0    0x04
@@ -1069,6 +1073,7 @@ static const TypeInfo mv88w8618_flashcfg_info = {
     .instance_init = mv88w8618_flashcfg_init,
     .class_init    = mv88w8618_flashcfg_class_init,
 };
+TYPE_INFO(mv88w8618_flashcfg_info)
 
 /* Misc register offsets */
 #define MP_MISC_BOARD_REVISION  0x18
@@ -1123,6 +1128,7 @@ static const TypeInfo musicpal_misc_info = {
     .instance_init = musicpal_misc_init,
     .instance_size = sizeof(MusicPalMiscState),
 };
+TYPE_INFO(musicpal_misc_info)
 
 /* WLAN register offsets */
 #define MP_WLAN_MAGIC1          0x11c
@@ -1411,6 +1417,7 @@ static const TypeInfo musicpal_gpio_info = {
     .instance_init = musicpal_gpio_init,
     .class_init    = musicpal_gpio_class_init,
 };
+TYPE_INFO(musicpal_gpio_info)
 
 /* Keyboard codes & masks */
 #define KEY_RELEASED            0x80
@@ -1570,6 +1577,7 @@ static const TypeInfo musicpal_key_info = {
     .instance_init = musicpal_key_init,
     .class_init    = musicpal_key_class_init,
 };
+TYPE_INFO(musicpal_key_info)
 
 static struct arm_boot_info musicpal_binfo = {
     .loader_start = 0x0,
@@ -1725,18 +1733,6 @@ static const TypeInfo mv88w8618_wlan_info = {
     .instance_size = sizeof(SysBusDevice),
     .class_init    = mv88w8618_wlan_class_init,
 };
+TYPE_INFO(mv88w8618_wlan_info)
 
-static void musicpal_register_types(void)
-{
-    type_register_static(&mv88w8618_pic_info);
-    type_register_static(&mv88w8618_pit_info);
-    type_register_static(&mv88w8618_flashcfg_info);
-    type_register_static(&mv88w8618_eth_info);
-    type_register_static(&mv88w8618_wlan_info);
-    type_register_static(&musicpal_lcd_info);
-    type_register_static(&musicpal_gpio_info);
-    type_register_static(&musicpal_key_info);
-    type_register_static(&musicpal_misc_info);
-}
 
-type_init(musicpal_register_types)
hw/arm/nrf51_soc.c +1 -5
index e15981e019..aabb59330c 100644
@@ -219,9 +219,5 @@ static const TypeInfo nrf51_soc_info = {
     .instance_init = nrf51_soc_init,
     .class_init    = nrf51_soc_class_init,
 };
+TYPE_INFO(nrf51_soc_info)
 
-static void nrf51_soc_types(void)
-{
-    type_register_static(&nrf51_soc_info);
-}
-type_init(nrf51_soc_types)
hw/arm/nseries.c +2 -6
index e48092ca04..08e7a604c0 100644
@@ -1441,6 +1441,7 @@ static const TypeInfo n800_type = {
     .parent = TYPE_MACHINE,
     .class_init = n800_class_init,
 };
+TYPE_INFO(n800_type)
 
 static void n810_class_init(ObjectClass *oc, void *data)
 {
@@ -1461,11 +1462,6 @@ static const TypeInfo n810_type = {
     .parent = TYPE_MACHINE,
     .class_init = n810_class_init,
 };
+TYPE_INFO(n810_type)
 
-static void nseries_machine_init(void)
-{
-    type_register_static(&n800_type);
-    type_register_static(&n810_type);
-}
 
-type_init(nseries_machine_init)
hw/arm/omap_sx1.c +2 -6
index 57829b3744..f453c18067 100644
@@ -229,6 +229,7 @@ static const TypeInfo sx1_machine_v2_type = {
     .parent = TYPE_MACHINE,
     .class_init = sx1_machine_v2_class_init,
 };
+TYPE_INFO(sx1_machine_v2_type)
 
 static void sx1_machine_v1_class_init(ObjectClass *oc, void *data)
 {
@@ -247,11 +248,6 @@ static const TypeInfo sx1_machine_v1_type = {
     .parent = TYPE_MACHINE,
     .class_init = sx1_machine_v1_class_init,
 };
+TYPE_INFO(sx1_machine_v1_type)
 
-static void sx1_machine_init(void)
-{
-    type_register_static(&sx1_machine_v1_type);
-    type_register_static(&sx1_machine_v2_type);
-}
 
-type_init(sx1_machine_init)
hw/arm/palm.c +1 -5
index e7bc9ea4c6..7980d321ee 100644
@@ -183,6 +183,7 @@ static const TypeInfo palm_misc_gpio_info = {
      * need to set up reset or vmstate, and has no realize method.
      */
 };
+TYPE_INFO(palm_misc_gpio_info)
 
 static void palmte_gpio_setup(struct omap_mpu_state_s *cpu)
 {
@@ -313,9 +314,4 @@ static void palmte_machine_init(MachineClass *mc)
 
 DEFINE_MACHINE("cheetah", palmte_machine_init)
 
-static void palm_register_types(void)
-{
-    type_register_static(&palm_misc_gpio_info);
-}
 
-type_init(palm_register_types)
hw/arm/pxa2xx.c +5 -9
index 6203c4cfe0..391aeb6229 100644
@@ -1237,6 +1237,7 @@ static const TypeInfo pxa2xx_rtc_sysbus_info = {
     .instance_init = pxa2xx_rtc_init,
     .class_init    = pxa2xx_rtc_sysbus_class_init,
 };
+TYPE_INFO(pxa2xx_rtc_sysbus_info)
 
 /* I2C Interface */
 
@@ -1501,6 +1502,7 @@ static const TypeInfo pxa2xx_i2c_slave_info = {
     .instance_size = sizeof(PXA2xxI2CSlaveState),
     .class_init    = pxa2xx_i2c_slave_class_init,
 };
+TYPE_INFO(pxa2xx_i2c_slave_info)
 
 PXA2xxI2CState *pxa2xx_i2c_init(hwaddr base,
                 qemu_irq irq, uint32_t region_size)
@@ -1571,6 +1573,7 @@ static const TypeInfo pxa2xx_i2c_info = {
     .instance_init = pxa2xx_i2c_initfn,
     .class_init    = pxa2xx_i2c_class_init,
 };
+TYPE_INFO(pxa2xx_i2c_info)
 
 /* PXA Inter-IC Sound Controller */
 static void pxa2xx_i2s_reset(PXA2xxI2SState *i2s)
@@ -2064,6 +2067,7 @@ static const TypeInfo pxa2xx_fir_info = {
     .class_init = pxa2xx_fir_class_init,
     .instance_init = pxa2xx_fir_instance_init,
 };
+TYPE_INFO(pxa2xx_fir_info)
 
 static PXA2xxFIrState *pxa2xx_fir_init(MemoryRegion *sysmem,
                                        hwaddr base,
@@ -2360,14 +2364,6 @@ static const TypeInfo pxa2xx_ssp_info = {
     .instance_init = pxa2xx_ssp_init,
     .class_init    = pxa2xx_ssp_class_init,
 };
+TYPE_INFO(pxa2xx_ssp_info)
 
-static void pxa2xx_register_types(void)
-{
-    type_register_static(&pxa2xx_i2c_slave_info);
-    type_register_static(&pxa2xx_ssp_info);
-    type_register_static(&pxa2xx_i2c_info);
-    type_register_static(&pxa2xx_rtc_sysbus_info);
-    type_register_static(&pxa2xx_fir_info);
-}
 
-type_init(pxa2xx_register_types)
hw/arm/pxa2xx_gpio.c +1 -5
index d6d0d0b08e..a0f3592f17 100644
@@ -361,10 +361,6 @@ static const TypeInfo pxa2xx_gpio_info = {
     .instance_init = pxa2xx_gpio_initfn,
     .class_init    = pxa2xx_gpio_class_init,
 };
+TYPE_INFO(pxa2xx_gpio_info)
 
-static void pxa2xx_gpio_register_types(void)
-{
-    type_register_static(&pxa2xx_gpio_info);
-}
 
-type_init(pxa2xx_gpio_register_types)
hw/arm/pxa2xx_pic.c +1 -5
index ceee6aa48d..bfc0dd8df6 100644
@@ -330,10 +330,6 @@ static const TypeInfo pxa2xx_pic_info = {
     .instance_size = sizeof(PXA2xxPICState),
     .class_init    = pxa2xx_pic_class_init,
 };
+TYPE_INFO(pxa2xx_pic_info)
 
-static void pxa2xx_pic_register_types(void)
-{
-    type_register_static(&pxa2xx_pic_info);
-}
 
-type_init(pxa2xx_pic_register_types)
hw/arm/realview.c +4 -8
index c1ff172b13..493097b1c5 100644
@@ -394,6 +394,7 @@ static const TypeInfo realview_eb_type = {
     .parent = TYPE_MACHINE,
     .class_init = realview_eb_class_init,
 };
+TYPE_INFO(realview_eb_type)
 
 static void realview_eb_mpcore_class_init(ObjectClass *oc, void *data)
 {
@@ -412,6 +413,7 @@ static const TypeInfo realview_eb_mpcore_type = {
     .parent = TYPE_MACHINE,
     .class_init = realview_eb_mpcore_class_init,
 };
+TYPE_INFO(realview_eb_mpcore_type)
 
 static void realview_pb_a8_class_init(ObjectClass *oc, void *data)
 {
@@ -428,6 +430,7 @@ static const TypeInfo realview_pb_a8_type = {
     .parent = TYPE_MACHINE,
     .class_init = realview_pb_a8_class_init,
 };
+TYPE_INFO(realview_pb_a8_type)
 
 static void realview_pbx_a9_class_init(ObjectClass *oc, void *data)
 {
@@ -445,13 +448,6 @@ static const TypeInfo realview_pbx_a9_type = {
     .parent = TYPE_MACHINE,
     .class_init = realview_pbx_a9_class_init,
 };
+TYPE_INFO(realview_pbx_a9_type)
 
-static void realview_machine_init(void)
-{
-    type_register_static(&realview_eb_type);
-    type_register_static(&realview_eb_mpcore_type);
-    type_register_static(&realview_pb_a8_type);
-    type_register_static(&realview_pbx_a9_type);
-}
 
-type_init(realview_machine_init)
hw/arm/sbsa-ref.c +1 -5
index f030a416fd..e6715ab638 100644
@@ -797,10 +797,6 @@ static const TypeInfo sbsa_ref_info = {
     .class_init    = sbsa_ref_class_init,
     .instance_size = sizeof(SBSAMachineState),
 };
+TYPE_INFO(sbsa_ref_info)
 
-static void sbsa_ref_machine_init(void)
-{
-    type_register_static(&sbsa_ref_info);
-}
 
-type_init(sbsa_ref_machine_init);
hw/arm/smmu-common.c +1 -5
index e13a5f4a7c..265eed7b5b 100644
@@ -477,11 +477,7 @@ static const TypeInfo smmu_base_info = {
     .class_init    = smmu_base_class_init,
     .abstract      = true,
 };
+TYPE_INFO(smmu_base_info)
 
-static void smmu_base_register_types(void)
-{
-    type_register_static(&smmu_base_info);
-}
 
-type_init(smmu_base_register_types)
 
hw/arm/spitz.c +10 -18
index 7ac8254aa6..9c762ecedd 100644
@@ -1055,6 +1055,7 @@ static const TypeInfo spitz_common_info = {
     .class_size = sizeof(SpitzMachineClass),
     .class_init = spitz_common_class_init,
 };
+TYPE_INFO(spitz_common_info)
 
 static void akitapda_class_init(ObjectClass *oc, void *data)
 {
@@ -1072,6 +1073,7 @@ static const TypeInfo akitapda_type = {
     .parent = TYPE_SPITZ_MACHINE,
     .class_init = akitapda_class_init,
 };
+TYPE_INFO(akitapda_type)
 
 static void spitzpda_class_init(ObjectClass *oc, void *data)
 {
@@ -1089,6 +1091,7 @@ static const TypeInfo spitzpda_type = {
     .parent = TYPE_SPITZ_MACHINE,
     .class_init = spitzpda_class_init,
 };
+TYPE_INFO(spitzpda_type)
 
 static void borzoipda_class_init(ObjectClass *oc, void *data)
 {
@@ -1106,6 +1109,7 @@ static const TypeInfo borzoipda_type = {
     .parent = TYPE_SPITZ_MACHINE,
     .class_init = borzoipda_class_init,
 };
+TYPE_INFO(borzoipda_type)
 
 static void terrierpda_class_init(ObjectClass *oc, void *data)
 {
@@ -1123,17 +1127,9 @@ static const TypeInfo terrierpda_type = {
     .parent = TYPE_SPITZ_MACHINE,
     .class_init = terrierpda_class_init,
 };
+TYPE_INFO(terrierpda_type)
 
-static void spitz_machine_init(void)
-{
-    type_register_static(&spitz_common_info);
-    type_register_static(&akitapda_type);
-    type_register_static(&spitzpda_type);
-    type_register_static(&borzoipda_type);
-    type_register_static(&terrierpda_type);
-}
 
-type_init(spitz_machine_init)
 
 static bool is_version_0(void *opaque, int version_id)
 {
@@ -1175,6 +1171,7 @@ static const TypeInfo sl_nand_info = {
     .instance_init = sl_nand_init,
     .class_init    = sl_nand_class_init,
 };
+TYPE_INFO(sl_nand_info)
 
 static VMStateDescription vmstate_spitz_kbd = {
     .name = "spitz-keyboard",
@@ -1204,6 +1201,7 @@ static const TypeInfo spitz_keyboard_info = {
     .instance_init = spitz_keyboard_init,
     .class_init    = spitz_keyboard_class_init,
 };
+TYPE_INFO(spitz_keyboard_info)
 
 static const VMStateDescription vmstate_corgi_ssp_regs = {
     .name = "corgi-ssp",
@@ -1232,6 +1230,7 @@ static const TypeInfo corgi_ssp_info = {
     .instance_size = sizeof(CorgiSSPState),
     .class_init    = corgi_ssp_class_init,
 };
+TYPE_INFO(corgi_ssp_info)
 
 static const VMStateDescription vmstate_spitz_lcdtg_regs = {
     .name = "spitz-lcdtg",
@@ -1261,6 +1260,7 @@ static const TypeInfo spitz_lcdtg_info = {
     .instance_size = sizeof(SpitzLCDTG),
     .class_init    = spitz_lcdtg_class_init,
 };
+TYPE_INFO(spitz_lcdtg_info)
 
 static const TypeInfo spitz_misc_gpio_info = {
     .name = TYPE_SPITZ_MISC_GPIO,
@@ -1272,14 +1272,6 @@ static const TypeInfo spitz_misc_gpio_info = {
      * need to set up reset or vmstate, and does not have a realize method.
      */
 };
+TYPE_INFO(spitz_misc_gpio_info)
 
-static void spitz_register_types(void)
-{
-    type_register_static(&corgi_ssp_info);
-    type_register_static(&spitz_lcdtg_info);
-    type_register_static(&spitz_keyboard_info);
-    type_register_static(&sl_nand_info);
-    type_register_static(&spitz_misc_gpio_info);
-}
 
-type_init(spitz_register_types)
hw/arm/stellaris.c +5 -13
index 5f9d080180..0bf2be0e27 100644
@@ -1482,6 +1482,7 @@ static const TypeInfo lm3s811evb_type = {
     .parent = TYPE_MACHINE,
     .class_init = lm3s811evb_class_init,
 };
+TYPE_INFO(lm3s811evb_type)
 
 static void lm3s6965evb_class_init(ObjectClass *oc, void *data)
 {
@@ -1498,14 +1499,9 @@ static const TypeInfo lm3s6965evb_type = {
     .parent = TYPE_MACHINE,
     .class_init = lm3s6965evb_class_init,
 };
+TYPE_INFO(lm3s6965evb_type)
 
-static void stellaris_machine_init(void)
-{
-    type_register_static(&lm3s811evb_type);
-    type_register_static(&lm3s6965evb_type);
-}
 
-type_init(stellaris_machine_init)
 
 static void stellaris_i2c_class_init(ObjectClass *klass, void *data)
 {
@@ -1521,6 +1517,7 @@ static const TypeInfo stellaris_i2c_info = {
     .instance_init = stellaris_i2c_init,
     .class_init    = stellaris_i2c_class_init,
 };
+TYPE_INFO(stellaris_i2c_info)
 
 static void stellaris_gptm_class_init(ObjectClass *klass, void *data)
 {
@@ -1537,6 +1534,7 @@ static const TypeInfo stellaris_gptm_info = {
     .instance_init = stellaris_gptm_init,
     .class_init    = stellaris_gptm_class_init,
 };
+TYPE_INFO(stellaris_gptm_info)
 
 static void stellaris_adc_class_init(ObjectClass *klass, void *data)
 {
@@ -1552,12 +1550,6 @@ static const TypeInfo stellaris_adc_info = {
     .instance_init = stellaris_adc_init,
     .class_init    = stellaris_adc_class_init,
 };
+TYPE_INFO(stellaris_adc_info)
 
-static void stellaris_register_types(void)
-{
-    type_register_static(&stellaris_i2c_info);
-    type_register_static(&stellaris_gptm_info);
-    type_register_static(&stellaris_adc_info);
-}
 
-type_init(stellaris_register_types)
hw/arm/stm32f205_soc.c +1 -5
index a4f3344db2..38d2ea8b77 100644
@@ -195,10 +195,6 @@ static const TypeInfo stm32f205_soc_info = {
     .instance_init = stm32f205_soc_initfn,
     .class_init    = stm32f205_soc_class_init,
 };
+TYPE_INFO(stm32f205_soc_info)
 
-static void stm32f205_soc_types(void)
-{
-    type_register_static(&stm32f205_soc_info);
-}
 
-type_init(stm32f205_soc_types)
hw/arm/stm32f405_soc.c +1 -5
index cb04c11198..e24ff4c472 100644
@@ -271,10 +271,6 @@ static const TypeInfo stm32f405_soc_info = {
     .instance_init = stm32f405_soc_initfn,
     .class_init    = stm32f405_soc_class_init,
 };
+TYPE_INFO(stm32f405_soc_info)
 
-static void stm32f405_soc_types(void)
-{
-    type_register_static(&stm32f405_soc_info);
-}
 
-type_init(stm32f405_soc_types)
hw/arm/strongarm.c +6 -10
index 2639b9ae55..5c1fb66b98 100644
@@ -235,6 +235,7 @@ static const TypeInfo strongarm_pic_info = {
     .instance_init = strongarm_pic_initfn,
     .class_init    = strongarm_pic_class_init,
 };
+TYPE_INFO(strongarm_pic_info)
 
 /* Real-Time Clock */
 #define RTAR 0x00 /* RTC Alarm register */
@@ -466,6 +467,7 @@ static const TypeInfo strongarm_rtc_sysbus_info = {
     .instance_init = strongarm_rtc_init,
     .class_init    = strongarm_rtc_sysbus_class_init,
 };
+TYPE_INFO(strongarm_rtc_sysbus_info)
 
 /* GPIO */
 #define GPLR 0x00
@@ -708,6 +710,7 @@ static const TypeInfo strongarm_gpio_info = {
     .instance_init = strongarm_gpio_initfn,
     .class_init    = strongarm_gpio_class_init,
 };
+TYPE_INFO(strongarm_gpio_info)
 
 /* Peripheral Pin Controller */
 #define PPDR 0x00
@@ -878,6 +881,7 @@ static const TypeInfo strongarm_ppc_info = {
     .instance_init = strongarm_ppc_init,
     .class_init    = strongarm_ppc_class_init,
 };
+TYPE_INFO(strongarm_ppc_info)
 
 /* UART Ports */
 #define UTCR0 0x00
@@ -1345,6 +1349,7 @@ static const TypeInfo strongarm_uart_info = {
     .instance_init = strongarm_uart_init,
     .class_init    = strongarm_uart_class_init,
 };
+TYPE_INFO(strongarm_uart_info)
 
 /* Synchronous Serial Ports */
 
@@ -1591,6 +1596,7 @@ static const TypeInfo strongarm_ssp_info = {
     .instance_init = strongarm_ssp_init,
     .class_init    = strongarm_ssp_class_init,
 };
+TYPE_INFO(strongarm_ssp_info)
 
 /* Main CPU functions */
 StrongARMState *sa1110_init(const char *cpu_type)
@@ -1643,14 +1649,4 @@ StrongARMState *sa1110_init(const char *cpu_type)
     return s;
 }
 
-static void strongarm_register_types(void)
-{
-    type_register_static(&strongarm_pic_info);
-    type_register_static(&strongarm_rtc_sysbus_info);
-    type_register_static(&strongarm_gpio_info);
-    type_register_static(&strongarm_ppc_info);
-    type_register_static(&strongarm_uart_info);
-    type_register_static(&strongarm_ssp_info);
-}
 
-type_init(strongarm_register_types)
hw/arm/tosa.c +3 -7
index e29566f7b3..86a1a21adf 100644
@@ -299,6 +299,7 @@ static const TypeInfo tosa_dac_info = {
     .instance_size = sizeof(TosaDACState),
     .class_init    = tosa_dac_class_init,
 };
+TYPE_INFO(tosa_dac_info)
 
 static void tosa_ssp_class_init(ObjectClass *klass, void *data)
 {
@@ -314,6 +315,7 @@ static const TypeInfo tosa_ssp_info = {
     .instance_size = sizeof(SSISlave),
     .class_init    = tosa_ssp_class_init,
 };
+TYPE_INFO(tosa_ssp_info)
 
 static const TypeInfo tosa_misc_gpio_info = {
     .name          = "tosa-misc-gpio",
@@ -325,12 +327,6 @@ static const TypeInfo tosa_misc_gpio_info = {
      * need to set up reset or vmstate, and has no realize method.
      */
 };
+TYPE_INFO(tosa_misc_gpio_info)
 
-static void tosa_register_types(void)
-{
-    type_register_static(&tosa_dac_info);
-    type_register_static(&tosa_ssp_info);
-    type_register_static(&tosa_misc_gpio_info);
-}
 
-type_init(tosa_register_types)
hw/arm/versatilepb.c +3 -11
index 9dc93182b6..c89fe65d97 100644
@@ -404,6 +404,7 @@ static const TypeInfo versatilepb_type = {
     .parent = TYPE_MACHINE,
     .class_init = versatilepb_class_init,
 };
+TYPE_INFO(versatilepb_type)
 
 static void versatileab_class_init(ObjectClass *oc, void *data)
 {
@@ -422,14 +423,9 @@ static const TypeInfo versatileab_type = {
     .parent = TYPE_MACHINE,
     .class_init = versatileab_class_init,
 };
+TYPE_INFO(versatileab_type)
 
-static void versatile_machine_init(void)
-{
-    type_register_static(&versatilepb_type);
-    type_register_static(&versatileab_type);
-}
 
-type_init(versatile_machine_init)
 
 static void vpb_sic_class_init(ObjectClass *klass, void *data)
 {
@@ -445,10 +441,6 @@ static const TypeInfo vpb_sic_info = {
     .instance_init = vpb_sic_init,
     .class_init    = vpb_sic_class_init,
 };
+TYPE_INFO(vpb_sic_info)
 
-static void versatilepb_register_types(void)
-{
-    type_register_static(&vpb_sic_info);
-}
 
-type_init(versatilepb_register_types)
hw/arm/vexpress.c +3 -7
index 1dc971c34f..4efbe82cb3 100644
@@ -822,6 +822,7 @@ static const TypeInfo vexpress_info = {
     .class_size = sizeof(VexpressMachineClass),
     .class_init = vexpress_class_init,
 };
+TYPE_INFO(vexpress_info)
 
 static const TypeInfo vexpress_a9_info = {
     .name = TYPE_VEXPRESS_A9_MACHINE,
@@ -829,6 +830,7 @@ static const TypeInfo vexpress_a9_info = {
     .class_init = vexpress_a9_class_init,
     .instance_init = vexpress_a9_instance_init,
 };
+TYPE_INFO(vexpress_a9_info)
 
 static const TypeInfo vexpress_a15_info = {
     .name = TYPE_VEXPRESS_A15_MACHINE,
@@ -836,12 +838,6 @@ static const TypeInfo vexpress_a15_info = {
     .class_init = vexpress_a15_class_init,
     .instance_init = vexpress_a15_instance_init,
 };
+TYPE_INFO(vexpress_a15_info)
 
-static void vexpress_machine_init(void)
-{
-    type_register_static(&vexpress_info);
-    type_register_static(&vexpress_a9_info);
-    type_register_static(&vexpress_a15_info);
-}
 
-type_init(vexpress_machine_init);
hw/arm/virt.c +1 -5
index ecfee362a1..5528121d37 100644
@@ -2539,12 +2539,8 @@ static const TypeInfo virt_machine_info = {
          { }
     },
 };
+TYPE_INFO(virt_machine_info)
 
-static void machvirt_machine_init(void)
-{
-    type_register_static(&virt_machine_info);
-}
-type_init(machvirt_machine_init);
 
 static void virt_machine_5_1_options(MachineClass *mc)
 {
hw/arm/xilinx_zynq.c +1 -5
index 32aa7323d9..0ba9e8c708 100644
@@ -355,10 +355,6 @@ static const TypeInfo zynq_machine_type = {
     .class_init = zynq_machine_class_init,
     .instance_size = sizeof(ZynqMachineState),
 };
+TYPE_INFO(zynq_machine_type)
 
-static void zynq_machine_register_types(void)
-{
-    type_register_static(&zynq_machine_type);
-}
 
-type_init(zynq_machine_register_types)
hw/arm/xlnx-versal-virt.c +1 -5
index 4b3152ee77..f55295a816 100644
@@ -574,11 +574,7 @@ static const TypeInfo versal_virt_machine_init_typeinfo = {
     .instance_init = versal_virt_machine_instance_init,
     .instance_size = sizeof(VersalVirt),
 };
+TYPE_INFO(versal_virt_machine_init_typeinfo)
 
-static void versal_virt_machine_init_register_types(void)
-{
-    type_register_static(&versal_virt_machine_init_typeinfo);
-}
 
-type_init(versal_virt_machine_init_register_types)
 
hw/arm/xlnx-versal.c +1 -5
index e3aa4bd1e5..7f3bc84962 100644
@@ -378,10 +378,6 @@ static const TypeInfo versal_info = {
     .instance_init = versal_init,
     .class_init = versal_class_init,
 };
+TYPE_INFO(versal_info)
 
-static void versal_register_types(void)
-{
-    type_register_static(&versal_info);
-}
 
-type_init(versal_register_types);
hw/arm/xlnx-zcu102.c +1 -5
index 5997262459..6d1f38a99c 100644
@@ -244,10 +244,6 @@ static const TypeInfo xlnx_zcu102_machine_init_typeinfo = {
     .instance_init = xlnx_zcu102_machine_instance_init,
     .instance_size = sizeof(XlnxZCU102),
 };
+TYPE_INFO(xlnx_zcu102_machine_init_typeinfo)
 
-static void xlnx_zcu102_machine_init_register_types(void)
-{
-    type_register_static(&xlnx_zcu102_machine_init_typeinfo);
-}
 
-type_init(xlnx_zcu102_machine_init_register_types)
hw/arm/xlnx-zynqmp.c +1 -5
index c435b9d52a..9448e71059 100644
@@ -637,10 +637,6 @@ static const TypeInfo xlnx_zynqmp_type_info = {
     .instance_init = xlnx_zynqmp_init,
     .class_init = xlnx_zynqmp_class_init,
 };
+TYPE_INFO(xlnx_zynqmp_type_info)
 
-static void xlnx_zynqmp_register_types(void)
-{
-    type_register_static(&xlnx_zynqmp_type_info);
-}
 
-type_init(xlnx_zynqmp_register_types)
hw/audio/cs4231.c +1 -5
index 11a6328fc2..2f8f75845e 100644
@@ -178,10 +178,6 @@ static const TypeInfo cs4231_info = {
     .instance_init = cs4231_init,
     .class_init    = cs4231_class_init,
 };
+TYPE_INFO(cs4231_info)
 
-static void cs4231_register_types(void)
-{
-    type_register_static(&cs4231_info);
-}
 
-type_init(cs4231_register_types)
hw/audio/hda-codec.c +4 -8
index cbd92b72f2..b6ea5b3b75 100644
@@ -901,6 +901,7 @@ static const TypeInfo hda_audio_info = {
     .class_init    = hda_audio_base_class_init,
     .abstract      = true,
 };
+TYPE_INFO(hda_audio_info)
 
 static void hda_audio_output_class_init(ObjectClass *klass, void *data)
 {
@@ -917,6 +918,7 @@ static const TypeInfo hda_audio_output_info = {
     .instance_size = sizeof(HDAAudioState),
     .class_init    = hda_audio_output_class_init,
 };
+TYPE_INFO(hda_audio_output_info)
 
 static void hda_audio_duplex_class_init(ObjectClass *klass, void *data)
 {
@@ -933,6 +935,7 @@ static const TypeInfo hda_audio_duplex_info = {
     .instance_size = sizeof(HDAAudioState),
     .class_init    = hda_audio_duplex_class_init,
 };
+TYPE_INFO(hda_audio_duplex_info)
 
 static void hda_audio_micro_class_init(ObjectClass *klass, void *data)
 {
@@ -949,13 +952,6 @@ static const TypeInfo hda_audio_micro_info = {
     .instance_size = sizeof(HDAAudioState),
     .class_init    = hda_audio_micro_class_init,
 };
+TYPE_INFO(hda_audio_micro_info)
 
-static void hda_audio_register_types(void)
-{
-    type_register_static(&hda_audio_info);
-    type_register_static(&hda_audio_output_info);
-    type_register_static(&hda_audio_duplex_info);
-    type_register_static(&hda_audio_micro_info);
-}
 
-type_init(hda_audio_register_types)
hw/audio/intel-hda.c +5 -5
index f6cea49686..ceae0b33af 100644
@@ -46,6 +46,7 @@ static const TypeInfo hda_codec_bus_info = {
     .parent = TYPE_BUS,
     .instance_size = sizeof(HDACodecBus),
 };
+TYPE_INFO(hda_codec_bus_info)
 
 void hda_codec_bus_init(DeviceState *dev, HDACodecBus *bus, size_t bus_size,
                         hda_codec_response_func response,
@@ -1266,18 +1267,21 @@ static const TypeInfo intel_hda_info = {
         { },
     },
 };
+TYPE_INFO(intel_hda_info)
 
 static const TypeInfo intel_hda_info_ich6 = {
     .name          = "intel-hda",
     .parent        = TYPE_INTEL_HDA_GENERIC,
     .class_init    = intel_hda_class_init_ich6,
 };
+TYPE_INFO(intel_hda_info_ich6)
 
 static const TypeInfo intel_hda_info_ich9 = {
     .name          = "ich9-intel-hda",
     .parent        = TYPE_INTEL_HDA_GENERIC,
     .class_init    = intel_hda_class_init_ich9,
 };
+TYPE_INFO(intel_hda_info_ich9)
 
 static void hda_codec_device_class_init(ObjectClass *klass, void *data)
 {
@@ -1297,6 +1301,7 @@ static const TypeInfo hda_codec_device_type_info = {
     .class_size = sizeof(HDACodecDeviceClass),
     .class_init = hda_codec_device_class_init,
 };
+TYPE_INFO(hda_codec_device_type_info)
 
 /*
  * create intel hda controller with codec attached to it,
@@ -1319,11 +1324,6 @@ static int intel_hda_and_codec_init(PCIBus *bus)
 
 static void intel_hda_register_types(void)
 {
-    type_register_static(&hda_codec_bus_info);
-    type_register_static(&intel_hda_info);
-    type_register_static(&intel_hda_info_ich6);
-    type_register_static(&intel_hda_info_ich9);
-    type_register_static(&hda_codec_device_type_info);
     pci_register_soundhw("hda", "Intel HD Audio", intel_hda_and_codec_init);
 }
 
hw/audio/marvell_88w8618.c +1 -5
index 8dfacec693..1dcee64ef0 100644
@@ -304,10 +304,6 @@ static const TypeInfo mv88w8618_audio_info = {
     .instance_init = mv88w8618_audio_init,
     .class_init    = mv88w8618_audio_class_init,
 };
+TYPE_INFO(mv88w8618_audio_info)
 
-static void mv88w8618_register_types(void)
-{
-    type_register_static(&mv88w8618_audio_info);
-}
 
-type_init(mv88w8618_register_types)
hw/audio/milkymist-ac97.c +1 -5
index 0fa38adbe2..051dc3bfad 100644
@@ -352,10 +352,6 @@ static const TypeInfo milkymist_ac97_info = {
     .instance_init = milkymist_ac97_init,
     .class_init    = milkymist_ac97_class_init,
 };
+TYPE_INFO(milkymist_ac97_info)
 
-static void milkymist_ac97_register_types(void)
-{
-    type_register_static(&milkymist_ac97_info);
-}
 
-type_init(milkymist_ac97_register_types)
hw/audio/pcspk.c +1 -1
index ea539e7605..ed7730fc18 100644
@@ -244,6 +244,7 @@ static const TypeInfo pcspk_info = {
     .instance_init  = pcspk_initfn,
     .class_init     = pcspk_class_initfn,
 };
+TYPE_INFO(pcspk_info)
 
 static int pcspk_audio_init_soundhw(ISABus *bus)
 {
@@ -256,7 +257,6 @@ static int pcspk_audio_init_soundhw(ISABus *bus)
 
 static void pcspk_register(void)
 {
-    type_register_static(&pcspk_info);
     isa_register_soundhw("pcspk", "PC speaker", pcspk_audio_init_soundhw);
 }
 type_init(pcspk_register)
hw/audio/pl041.c +1 -5
index c3d3eab6ed..96748cb15a 100644
@@ -650,10 +650,6 @@ static const TypeInfo pl041_device_info = {
     .instance_init = pl041_init,
     .class_init    = pl041_device_class_init,
 };
+TYPE_INFO(pl041_device_info)
 
-static void pl041_register_types(void)
-{
-    type_register_static(&pl041_device_info);
-}
 
-type_init(pl041_register_types)
hw/audio/wm8750.c +1 -5
index 92b2902a10..d867442d29 100644
@@ -726,10 +726,6 @@ static const TypeInfo wm8750_info = {
     .instance_size = sizeof(WM8750State),
     .class_init    = wm8750_class_init,
 };
+TYPE_INFO(wm8750_info)
 
-static void wm8750_register_types(void)
-{
-    type_register_static(&wm8750_info);
-}
 
-type_init(wm8750_register_types)
hw/block/fdc.c +6 -10
index e9ed3eef45..5e7013a752 100644
@@ -80,6 +80,7 @@ static const TypeInfo floppy_bus_info = {
     .parent = TYPE_BUS,
     .instance_size = sizeof(FloppyBus),
 };
+TYPE_INFO(floppy_bus_info)
 
 static void floppy_bus_create(FDCtrl *fdc, FloppyBus *bus, DeviceState *dev)
 {
@@ -620,6 +621,7 @@ static const TypeInfo floppy_drive_info = {
     .instance_size = sizeof(FloppyDrive),
     .class_init = floppy_drive_class_init,
 };
+TYPE_INFO(floppy_drive_info)
 
 /********************************************************/
 /* Intel 82078 floppy disk controller emulation          */
@@ -2940,6 +2942,7 @@ static const TypeInfo isa_fdc_info = {
     .class_init    = isabus_fdc_class_init,
     .instance_init = isabus_fdc_instance_init,
 };
+TYPE_INFO(isa_fdc_info)
 
 static const VMStateDescription vmstate_sysbus_fdc ={
     .name = "fdc",
@@ -2980,6 +2983,7 @@ static const TypeInfo sysbus_fdc_info = {
     .instance_init = sysbus_fdc_initfn,
     .class_init    = sysbus_fdc_class_init,
 };
+TYPE_INFO(sysbus_fdc_info)
 
 static Property sun4m_fdc_properties[] = {
     DEFINE_PROP_DRIVE("drive", FDCtrlSysBus, state.qdev_for_drives[0].blk),
@@ -3006,6 +3010,7 @@ static const TypeInfo sun4m_fdc_info = {
     .instance_init = sun4m_fdc_initfn,
     .class_init    = sun4m_fdc_class_init,
 };
+TYPE_INFO(sun4m_fdc_info)
 
 static void sysbus_fdc_common_class_init(ObjectClass *klass, void *data)
 {
@@ -3024,15 +3029,6 @@ static const TypeInfo sysbus_fdc_type_info = {
     .abstract      = true,
     .class_init    = sysbus_fdc_common_class_init,
 };
+TYPE_INFO(sysbus_fdc_type_info)
 
-static void fdc_register_types(void)
-{
-    type_register_static(&isa_fdc_info);
-    type_register_static(&sysbus_fdc_type_info);
-    type_register_static(&sysbus_fdc_info);
-    type_register_static(&sun4m_fdc_info);
-    type_register_static(&floppy_bus_info);
-    type_register_static(&floppy_drive_info);
-}
 
-type_init(fdc_register_types)
hw/block/m25p80.c +1 -1
index 8227088441..7f9492eee6 100644
@@ -1407,12 +1407,12 @@ static const TypeInfo m25p80_info = {
     .class_size     = sizeof(M25P80Class),
     .abstract       = true,
 };
+TYPE_INFO(m25p80_info)
 
 static void m25p80_register_types(void)
 {
     int i;
 
-    type_register_static(&m25p80_info);
     for (i = 0; i < ARRAY_SIZE(known_devices); ++i) {
         TypeInfo ti = {
             .name       = known_devices[i].part_name,
hw/block/nand.c +1 -5
index 654e0cb5d1..991a6e13e8 100644
@@ -457,11 +457,8 @@ static const TypeInfo nand_info = {
     .instance_size = sizeof(NANDFlashState),
     .class_init    = nand_class_init,
 };
+TYPE_INFO(nand_info)
 
-static void nand_register_types(void)
-{
-    type_register_static(&nand_info);
-}
 
 /*
  * Chip inputs are CLE, ALE, CE, WP, GND and eight I/O pins.  Chip
@@ -655,7 +652,6 @@ DeviceState *nand_init(BlockBackend *blk, int manf_id, int chip_id)
     return dev;
 }
 
-type_init(nand_register_types)
 
 #else
 
hw/block/nvme.c +1 -5
index 3426e17e65..a8fe997626 100644
@@ -1697,10 +1697,6 @@ static const TypeInfo nvme_info = {
         { }
     },
 };
+TYPE_INFO(nvme_info)
 
-static void nvme_register_types(void)
-{
-    type_register_static(&nvme_info);
-}
 
-type_init(nvme_register_types)
hw/block/onenand.c +1 -5
index 898ac563a3..d2c4e140e9 100644
@@ -854,11 +854,8 @@ static const TypeInfo onenand_info = {
     .instance_size = sizeof(OneNANDState),
     .class_init    = onenand_class_init,
 };
+TYPE_INFO(onenand_info)
 
-static void onenand_register_types(void)
-{
-    type_register_static(&onenand_info);
-}
 
 void *onenand_raw_otp(DeviceState *onenand_device)
 {
@@ -867,4 +864,3 @@ void *onenand_raw_otp(DeviceState *onenand_device)
     return s->otp;
 }
 
-type_init(onenand_register_types)
hw/block/pflash_cfi01.c +1 -5
index 8ab1d66310..252a6e340b 100644
@@ -940,13 +940,9 @@ static const TypeInfo pflash_cfi01_info = {
     .instance_size  = sizeof(PFlashCFI01),
     .class_init     = pflash_cfi01_class_init,
 };
+TYPE_INFO(pflash_cfi01_info)
 
-static void pflash_cfi01_register_types(void)
-{
-    type_register_static(&pflash_cfi01_info);
-}
 
-type_init(pflash_cfi01_register_types)
 
 PFlashCFI01 *pflash_cfi01_register(hwaddr base,
                                    const char *name,
hw/block/pflash_cfi02.c +1 -5
index eb02fccfa5..4806761e9c 100644
@@ -977,13 +977,9 @@ static const TypeInfo pflash_cfi02_info = {
     .instance_size  = sizeof(PFlashCFI02),
     .class_init     = pflash_cfi02_class_init,
 };
+TYPE_INFO(pflash_cfi02_info)
 
-static void pflash_cfi02_register_types(void)
-{
-    type_register_static(&pflash_cfi02_info);
-}
 
-type_init(pflash_cfi02_register_types)
 
 PFlashCFI02 *pflash_cfi02_register(hwaddr base,
                                    const char *name,
hw/block/swim.c +3 -7
index 74f56e8f46..1c7edecd93 100644
@@ -252,12 +252,14 @@ static const TypeInfo swim_drive_info = {
     .instance_size = sizeof(SWIMDrive),
     .class_init = swim_drive_class_init,
 };
+TYPE_INFO(swim_drive_info)
 
 static const TypeInfo swim_bus_info = {
     .name = TYPE_SWIM_BUS,
     .parent = TYPE_BUS,
     .instance_size = sizeof(SWIMBus),
 };
+TYPE_INFO(swim_bus_info)
 
 static void iwmctrl_write(void *opaque, hwaddr reg, uint64_t value,
                           unsigned size)
@@ -481,12 +483,6 @@ static const TypeInfo sysbus_swim_info = {
     .instance_init = sysbus_swim_init,
     .class_init    = sysbus_swim_class_init,
 };
+TYPE_INFO(sysbus_swim_info)
 
-static void swim_register_types(void)
-{
-    type_register_static(&sysbus_swim_info);
-    type_register_static(&swim_bus_info);
-    type_register_static(&swim_drive_info);
-}
 
-type_init(swim_register_types)
hw/block/vhost-user-blk.c +1 -5
index a00b854736..f8490ece8f 100644
@@ -561,10 +561,6 @@ static const TypeInfo vhost_user_blk_info = {
     .instance_init = vhost_user_blk_instance_init,
     .class_init = vhost_user_blk_class_init,
 };
+TYPE_INFO(vhost_user_blk_info)
 
-static void virtio_register_types(void)
-{
-    type_register_static(&vhost_user_blk_info);
-}
 
-type_init(virtio_register_types)
hw/block/virtio-blk.c +1 -5
index 413783693c..aedc9dbeec 100644
@@ -1327,10 +1327,6 @@ static const TypeInfo virtio_blk_info = {
     .instance_init = virtio_blk_instance_init,
     .class_init = virtio_blk_class_init,
 };
+TYPE_INFO(virtio_blk_info)
 
-static void virtio_register_types(void)
-{
-    type_register_static(&virtio_blk_info);
-}
 
-type_init(virtio_register_types)
hw/block/xen-block.c +3 -7
index 8a7a3f5452..055b55dcf6 100644
@@ -555,6 +555,7 @@ static const TypeInfo xen_block_type_info = {
     .class_size = sizeof(XenBlockDeviceClass),
     .class_init = xen_block_class_init,
 };
+TYPE_INFO(xen_block_type_info)
 
 static void xen_disk_unrealize(XenBlockDevice *blockdev)
 {
@@ -594,6 +595,7 @@ static const TypeInfo xen_disk_type_info = {
     .instance_size = sizeof(XenDiskDevice),
     .class_init = xen_disk_class_init,
 };
+TYPE_INFO(xen_disk_type_info)
 
 static void xen_cdrom_unrealize(XenBlockDevice *blockdev)
 {
@@ -641,15 +643,9 @@ static const TypeInfo xen_cdrom_type_info = {
     .instance_size = sizeof(XenCDRomDevice),
     .class_init = xen_cdrom_class_init,
 };
+TYPE_INFO(xen_cdrom_type_info)
 
-static void xen_block_register_types(void)
-{
-    type_register_static(&xen_block_type_info);
-    type_register_static(&xen_disk_type_info);
-    type_register_static(&xen_cdrom_type_info);
-}
 
-type_init(xen_block_register_types)
 
 static void xen_block_blockdev_del(const char *node_name, Error **errp)
 {
hw/char/avr_usart.c +1 -5
index fbe2a112b7..da605c9f96 100644
@@ -311,10 +311,6 @@ static const TypeInfo avr_usart_info = {
     .instance_init = avr_usart_init,
     .class_init    = avr_usart_class_init,
 };
+TYPE_INFO(avr_usart_info)
 
-static void avr_usart_register_types(void)
-{
-    type_register_static(&avr_usart_info);
-}
 
-type_init(avr_usart_register_types)
hw/char/bcm2835_aux.c +1 -5
index ee3dd40e3c..7f19205355 100644
@@ -309,10 +309,6 @@ static const TypeInfo bcm2835_aux_info = {
     .instance_init = bcm2835_aux_init,
     .class_init    = bcm2835_aux_class_init,
 };
+TYPE_INFO(bcm2835_aux_info)
 
-static void bcm2835_aux_register_types(void)
-{
-    type_register_static(&bcm2835_aux_info);
-}
 
-type_init(bcm2835_aux_register_types)
hw/char/cadence_uart.c +1 -5
index e196906c92..cdc8b9c71d 100644
@@ -613,10 +613,6 @@ static const TypeInfo cadence_uart_info = {
     .instance_init = cadence_uart_init,
     .class_init    = cadence_uart_class_init,
 };
+TYPE_INFO(cadence_uart_info)
 
-static void cadence_uart_register_types(void)
-{
-    type_register_static(&cadence_uart_info);
-}
 
-type_init(cadence_uart_register_types)
hw/char/cmsdk-apb-uart.c +1 -5
index 626b68f2ec..2b5e10a5e9 100644
@@ -399,10 +399,6 @@ static const TypeInfo cmsdk_apb_uart_info = {
     .instance_init = cmsdk_apb_uart_init,
     .class_init = cmsdk_apb_uart_class_init,
 };
+TYPE_INFO(cmsdk_apb_uart_info)
 
-static void cmsdk_apb_uart_register_types(void)
-{
-    type_register_static(&cmsdk_apb_uart_info);
-}
 
-type_init(cmsdk_apb_uart_register_types);
hw/char/debugcon.c +1 -5
index c8d938efb5..7c29b9cbcf 100644
@@ -135,10 +135,6 @@ static const TypeInfo debugcon_isa_info = {
     .instance_size = sizeof(ISADebugconState),
     .class_init    = debugcon_isa_class_initfn,
 };
+TYPE_INFO(debugcon_isa_info)
 
-static void debugcon_register_types(void)
-{
-    type_register_static(&debugcon_isa_info);
-}
 
-type_init(debugcon_register_types)
hw/char/digic-uart.c +1 -5
index e130cb4692..c86059ed0b 100644
@@ -193,10 +193,6 @@ static const TypeInfo digic_uart_info = {
     .instance_init = digic_uart_init,
     .class_init = digic_uart_class_init,
 };
+TYPE_INFO(digic_uart_info)
 
-static void digic_uart_register_types(void)
-{
-    type_register_static(&digic_uart_info);
-}
 
-type_init(digic_uart_register_types)
hw/char/escc.c +1 -5
index 7d16ee8688..da8e089407 100644
@@ -876,10 +876,6 @@ static const TypeInfo escc_info = {
     .instance_init = escc_init1,
     .class_init    = escc_class_init,
 };
+TYPE_INFO(escc_info)
 
-static void escc_register_types(void)
-{
-    type_register_static(&escc_info);
-}
 
-type_init(escc_register_types)
hw/char/etraxfs_ser.c +1 -5
index 947bdb649a..5b70c85b9b 100644
@@ -255,10 +255,6 @@ static const TypeInfo etraxfs_ser_info = {
     .instance_init = etraxfs_ser_init,
     .class_init    = etraxfs_ser_class_init,
 };
+TYPE_INFO(etraxfs_ser_info)
 
-static void etraxfs_serial_register_types(void)
-{
-    type_register_static(&etraxfs_ser_info);
-}
 
-type_init(etraxfs_serial_register_types)
hw/char/exynos4210_uart.c +1 -5
index 9c8ab3a77d..a59826a3df 100644
@@ -723,10 +723,6 @@ static const TypeInfo exynos4210_uart_info = {
     .instance_init = exynos4210_uart_init,
     .class_init    = exynos4210_uart_class_init,
 };
+TYPE_INFO(exynos4210_uart_info)
 
-static void exynos4210_uart_register(void)
-{
-    type_register_static(&exynos4210_uart_info);
-}
 
-type_init(exynos4210_uart_register)
hw/char/grlib_apbuart.c +1 -5
index 16d0feac59..581111ce75 100644
@@ -294,10 +294,6 @@ static const TypeInfo grlib_apbuart_info = {
     .instance_size = sizeof(UART),
     .class_init    = grlib_apbuart_class_init,
 };
+TYPE_INFO(grlib_apbuart_info)
 
-static void grlib_apbuart_register_types(void)
-{
-    type_register_static(&grlib_apbuart_info);
-}
 
-type_init(grlib_apbuart_register_types)
hw/char/ibex_uart.c +1 -5
index cc49a35013..f88f69f98c 100644
@@ -507,10 +507,6 @@ static const TypeInfo ibex_uart_info = {
     .instance_init = ibex_uart_init,
     .class_init    = ibex_uart_class_init,
 };
+TYPE_INFO(ibex_uart_info)
 
-static void ibex_uart_register_types(void)
-{
-    type_register_static(&ibex_uart_info);
-}
 
-type_init(ibex_uart_register_types)
hw/char/imx_serial.c +1 -5
index 731b8fc64c..17abb067ea 100644
@@ -382,10 +382,6 @@ static const TypeInfo imx_serial_info = {
     .instance_init  = imx_serial_init,
     .class_init     = imx_serial_class_init,
 };
+TYPE_INFO(imx_serial_info)
 
-static void imx_serial_register_types(void)
-{
-    type_register_static(&imx_serial_info);
-}
 
-type_init(imx_serial_register_types)
hw/char/ipoctal232.c +1 -5
index d7c497b939..b94ebf2791 100644
@@ -598,10 +598,6 @@ static const TypeInfo ipoctal_info = {
     .instance_size = sizeof(IPOctalState),
     .class_init    = ipoctal_class_init,
 };
+TYPE_INFO(ipoctal_info)
 
-static void ipoctal_register_types(void)
-{
-    type_register_static(&ipoctal_info);
-}
 
-type_init(ipoctal_register_types)
hw/char/lm32_juart.c +1 -5
index 3f34861233..bd4a778d38 100644
@@ -156,10 +156,6 @@ static const TypeInfo lm32_juart_info = {
     .instance_size = sizeof(LM32JuartState),
     .class_init    = lm32_juart_class_init,
 };
+TYPE_INFO(lm32_juart_info)
 
-static void lm32_juart_register_types(void)
-{
-    type_register_static(&lm32_juart_info);
-}
 
-type_init(lm32_juart_register_types)
hw/char/lm32_uart.c +1 -5
index b0b1092889..266808790f 100644
@@ -304,10 +304,6 @@ static const TypeInfo lm32_uart_info = {
     .instance_init = lm32_uart_init,
     .class_init    = lm32_uart_class_init,
 };
+TYPE_INFO(lm32_uart_info)
 
-static void lm32_uart_register_types(void)
-{
-    type_register_static(&lm32_uart_info);
-}
 
-type_init(lm32_uart_register_types)
hw/char/mcf_uart.c +1 -5
index 8d1b7f2bca..ec41736980 100644
@@ -332,13 +332,9 @@ static const TypeInfo mcf_uart_info = {
     .instance_init = mcf_uart_instance_init,
     .class_init    = mcf_uart_class_init,
 };
+TYPE_INFO(mcf_uart_info)
 
-static void mcf_uart_register(void)
-{
-    type_register_static(&mcf_uart_info);
-}
 
-type_init(mcf_uart_register)
 
 void *mcf_uart_init(qemu_irq irq, Chardev *chrdrv)
 {
hw/char/milkymist-uart.c +1 -5
index 1439efb42a..d3cb7c9140 100644
@@ -249,10 +249,6 @@ static const TypeInfo milkymist_uart_info = {
     .instance_init = milkymist_uart_init,
     .class_init    = milkymist_uart_class_init,
 };
+TYPE_INFO(milkymist_uart_info)
 
-static void milkymist_uart_register_types(void)
-{
-    type_register_static(&milkymist_uart_info);
-}
 
-type_init(milkymist_uart_register_types)
hw/char/nrf51_uart.c +1 -5
index d1fef77acd..0715f8b019 100644
@@ -325,10 +325,6 @@ static const TypeInfo nrf51_uart_info = {
     .instance_init = nrf51_uart_init,
     .class_init = nrf51_uart_class_init
 };
+TYPE_INFO(nrf51_uart_info)
 
-static void nrf51_uart_register_types(void)
-{
-    type_register_static(&nrf51_uart_info);
-}
 
-type_init(nrf51_uart_register_types)
hw/char/parallel.c +1 -5
index c0f34bf924..8f09384066 100644
@@ -659,10 +659,6 @@ static const TypeInfo parallel_isa_info = {
     .instance_size = sizeof(ISAParallelState),
     .class_init    = parallel_isa_class_initfn,
 };
+TYPE_INFO(parallel_isa_info)
 
-static void parallel_register_types(void)
-{
-    type_register_static(&parallel_isa_info);
-}
 
-type_init(parallel_register_types)
hw/char/pl011.c +2 -6
index 13e784f9d9..422c9e660a 100644
@@ -366,6 +366,7 @@ static const TypeInfo pl011_arm_info = {
     .instance_init = pl011_init,
     .class_init    = pl011_class_init,
 };
+TYPE_INFO(pl011_arm_info)
 
 static void pl011_luminary_init(Object *obj)
 {
@@ -379,11 +380,6 @@ static const TypeInfo pl011_luminary_info = {
     .parent        = TYPE_PL011,
     .instance_init = pl011_luminary_init,
 };
+TYPE_INFO(pl011_luminary_info)
 
-static void pl011_register_types(void)
-{
-    type_register_static(&pl011_arm_info);
-    type_register_static(&pl011_luminary_info);
-}
 
-type_init(pl011_register_types)
hw/char/renesas_sci.c +1 -5
index 5d7c6e6523..041557a4f1 100644
@@ -341,10 +341,6 @@ static const TypeInfo rsci_info = {
     .instance_init = rsci_init,
     .class_init = rsci_class_init,
 };
+TYPE_INFO(rsci_info)
 
-static void rsci_register_types(void)
-{
-    type_register_static(&rsci_info);
-}
 
-type_init(rsci_register_types)
hw/char/sclpconsole-lm.c +1 -5
index 2b5f37b6a2..0a277b8c37 100644
@@ -361,10 +361,6 @@ static const TypeInfo sclp_console_info = {
     .class_init    = console_class_init,
     .class_size    = sizeof(SCLPEventClass),
 };
+TYPE_INFO(sclp_console_info)
 
-static void register_types(void)
-{
-    type_register_static(&sclp_console_info);
-}
 
-type_init(register_types)
hw/char/sclpconsole.c +1 -5
index 5c7664905e..2e960973e2 100644
@@ -277,10 +277,6 @@ static const TypeInfo sclp_console_info = {
     .class_init    = console_class_init,
     .class_size    = sizeof(SCLPEventClass),
 };
+TYPE_INFO(sclp_console_info)
 
-static void register_types(void)
-{
-    type_register_static(&sclp_console_info);
-}
 
-type_init(register_types)
hw/char/serial-isa.c +1 -5
index b4c65949cd..35a1ee3a30 100644
@@ -146,13 +146,9 @@ static const TypeInfo serial_isa_info = {
     .instance_init = serial_isa_initfn,
     .class_init    = serial_isa_class_initfn,
 };
+TYPE_INFO(serial_isa_info)
 
-static void serial_register_types(void)
-{
-    type_register_static(&serial_isa_info);
-}
 
-type_init(serial_register_types)
 
 static void serial_isa_init(ISABus *bus, int index, Chardev *chr)
 {
hw/char/serial-pci-multi.c +2 -6
index 2cf3e44177..591c625b1d 100644
@@ -199,6 +199,7 @@ static const TypeInfo multi_2x_serial_pci_info = {
         { },
     },
 };
+TYPE_INFO(multi_2x_serial_pci_info)
 
 static const TypeInfo multi_4x_serial_pci_info = {
     .name          = "pci-serial-4x",
@@ -211,11 +212,6 @@ static const TypeInfo multi_4x_serial_pci_info = {
         { },
     },
 };
+TYPE_INFO(multi_4x_serial_pci_info)
 
-static void multi_serial_pci_register_types(void)
-{
-    type_register_static(&multi_2x_serial_pci_info);
-    type_register_static(&multi_4x_serial_pci_info);
-}
 
-type_init(multi_serial_pci_register_types)
hw/char/serial-pci.c +1 -5
index cd56924a43..02264f8b73 100644
@@ -119,10 +119,6 @@ static const TypeInfo serial_pci_info = {
         { },
     },
 };
+TYPE_INFO(serial_pci_info)
 
-static void serial_pci_register_types(void)
-{
-    type_register_static(&serial_pci_info);
-}
 
-type_init(serial_pci_register_types)
hw/char/serial.c +3 -7
index 2386479492..a40d967d70 100644
@@ -1024,6 +1024,7 @@ static const TypeInfo serial_io_info = {
     .instance_init = serial_io_instance_init,
     .class_init = serial_io_class_init,
 };
+TYPE_INFO(serial_io_info)
 
 static Property serial_properties[] = {
     DEFINE_PROP_CHR("chardev", SerialState, chr),
@@ -1048,6 +1049,7 @@ static const TypeInfo serial_info = {
     .instance_size = sizeof(SerialState),
     .class_init = serial_class_init,
 };
+TYPE_INFO(serial_info)
 
 /* Memory mapped interface */
 static uint64_t serial_mm_read(void *opaque, hwaddr addr,
@@ -1174,12 +1176,6 @@ static const TypeInfo serial_mm_info = {
     .instance_size = sizeof(SerialMM),
     .class_init = serial_mm_class_init,
 };
+TYPE_INFO(serial_mm_info)
 
-static void serial_register_types(void)
-{
-    type_register_static(&serial_info);
-    type_register_static(&serial_io_info);
-    type_register_static(&serial_mm_info);
-}
 
-type_init(serial_register_types)
hw/char/spapr_vty.c +1 -1
index 464a52342a..236dc2194a 100644
@@ -203,6 +203,7 @@ static const TypeInfo spapr_vty_info = {
     .instance_size = sizeof(SpaprVioVty),
     .class_init    = spapr_vty_class_init,
 };
+TYPE_INFO(spapr_vty_info)
 
 SpaprVioDevice *spapr_vty_get_default(SpaprVioBus *bus)
 {
@@ -266,7 +267,6 @@ static void spapr_vty_register_types(void)
 {
     spapr_register_hypercall(H_PUT_TERM_CHAR, h_put_term_char);
     spapr_register_hypercall(H_GET_TERM_CHAR, h_get_term_char);
-    type_register_static(&spapr_vty_info);
 }
 
 type_init(spapr_vty_register_types)
hw/char/stm32f2xx_usart.c +1 -5
index 0d661be6d3..f66bdbf796 100644
@@ -233,10 +233,6 @@ static const TypeInfo stm32f2xx_usart_info = {
     .instance_init = stm32f2xx_usart_init,
     .class_init    = stm32f2xx_usart_class_init,
 };
+TYPE_INFO(stm32f2xx_usart_info)
 
-static void stm32f2xx_usart_register_types(void)
-{
-    type_register_static(&stm32f2xx_usart_info);
-}
 
-type_init(stm32f2xx_usart_register_types)
hw/char/terminal3270.c +1 -5
index 2c47ebf007..6ba6052ac9 100644
@@ -302,10 +302,6 @@ static const TypeInfo ccw_terminal_info = {
     .class_init = terminal_class_init,
     .class_size = sizeof(EmulatedCcw3270Class),
 };
+TYPE_INFO(ccw_terminal_info)
 
-static void register_types(void)
-{
-    type_register_static(&ccw_terminal_info);
-}
 
-type_init(register_types)
hw/char/virtio-console.c +2 -6
index 4f46753ea3..0ac862df15 100644
@@ -270,6 +270,7 @@ static const TypeInfo virtconsole_info = {
     .parent        = TYPE_VIRTIO_CONSOLE_SERIAL_PORT,
     .class_init    = virtconsole_class_init,
 };
+TYPE_INFO(virtconsole_info)
 
 static Property virtserialport_properties[] = {
     DEFINE_PROP_CHR("chardev", VirtConsole, chr),
@@ -296,11 +297,6 @@ static const TypeInfo virtserialport_info = {
     .instance_size = sizeof(VirtConsole),
     .class_init    = virtserialport_class_init,
 };
+TYPE_INFO(virtserialport_info)
 
-static void virtconsole_register_types(void)
-{
-    type_register_static(&virtserialport_info);
-    type_register_static(&virtconsole_info);
-}
 
-type_init(virtconsole_register_types)
hw/char/virtio-serial-bus.c +3 -7
index f9a4428bd6..fdde8a8d69 100644
@@ -859,6 +859,7 @@ static const TypeInfo virtser_bus_info = {
     .instance_size = sizeof(VirtIOSerialBus),
     .class_init = virtser_bus_class_init,
 };
+TYPE_INFO(virtser_bus_info)
 
 static void virtser_bus_dev_print(Monitor *mon, DeviceState *qdev, int indent)
 {
@@ -1121,6 +1122,7 @@ static const TypeInfo virtio_serial_port_type_info = {
     .class_size = sizeof(VirtIOSerialPortClass),
     .class_init = virtio_serial_port_class_init,
 };
+TYPE_INFO(virtio_serial_port_type_info)
 
 static void virtio_serial_device_unrealize(DeviceState *dev)
 {
@@ -1205,12 +1207,6 @@ static const TypeInfo virtio_device_info = {
         { }
     }
 };
+TYPE_INFO(virtio_device_info)
 
-static void virtio_serial_register_types(void)
-{
-    type_register_static(&virtser_bus_info);
-    type_register_static(&virtio_serial_port_type_info);
-    type_register_static(&virtio_device_info);
-}
 
-type_init(virtio_serial_register_types)
hw/char/xilinx_uartlite.c +1 -5
index ae4ccd00c7..aad3fbc31e 100644
@@ -247,10 +247,6 @@ static const TypeInfo xilinx_uartlite_info = {
     .instance_init = xilinx_uartlite_init,
     .class_init    = xilinx_uartlite_class_init,
 };
+TYPE_INFO(xilinx_uartlite_info)
 
-static void xilinx_uart_register_types(void)
-{
-    type_register_static(&xilinx_uartlite_info);
-}
 
-type_init(xilinx_uart_register_types)
hw/core/bus.c +1 -5
index 6b987b6946..76762e3ab3 100644
@@ -325,10 +325,6 @@ static const TypeInfo bus_info = {
         { }
     },
 };
+TYPE_INFO(bus_info)
 
-static void bus_register_types(void)
-{
-    type_register_static(&bus_info);
-}
 
-type_init(bus_register_types)
hw/core/clock.c +1 -5
index 3c0daf7d4c..9ee9aeb932 100644
@@ -121,10 +121,6 @@ static const TypeInfo clock_info = {
     .instance_init     = clock_initfn,
     .instance_finalize = clock_finalizefn,
 };
+TYPE_INFO(clock_info)
 
-static void clock_register_types(void)
-{
-    type_register_static(&clock_info);
-}
 
-type_init(clock_register_types)
hw/core/cpu.c +1 -5
index 594441a150..df4d43bac4 100644
@@ -449,10 +449,6 @@ static const TypeInfo cpu_type_info = {
     .class_size = sizeof(CPUClass),
     .class_init = cpu_class_init,
 };
+TYPE_INFO(cpu_type_info)
 
-static void cpu_register_types(void)
-{
-    type_register_static(&cpu_type_info);
-}
 
-type_init(cpu_register_types)
hw/core/fw-path-provider.c +1 -5
index 4840faefd1..7f9f7eff15 100644
@@ -45,10 +45,6 @@ static const TypeInfo fw_path_provider_info = {
     .parent        = TYPE_INTERFACE,
     .class_size    = sizeof(FWPathProviderClass),
 };
+TYPE_INFO(fw_path_provider_info)
 
-static void fw_path_provider_register_types(void)
-{
-    type_register_static(&fw_path_provider_info);
-}
 
-type_init(fw_path_provider_register_types)
hw/core/generic-loader.c +1 -5
index a242c076f6..e463b0dc18 100644
@@ -212,10 +212,6 @@ static TypeInfo generic_loader_info = {
     .instance_size = sizeof(GenericLoaderState),
     .class_init = generic_loader_class_init,
 };
+TYPE_INFO(generic_loader_info)
 
-static void generic_loader_register_type(void)
-{
-    type_register_static(&generic_loader_info);
-}
 
-type_init(generic_loader_register_type)
hw/core/hotplug.c +1 -5
index 17ac986685..6460ac5e8f 100644
@@ -62,10 +62,6 @@ static const TypeInfo hotplug_handler_info = {
     .parent        = TYPE_INTERFACE,
     .class_size = sizeof(HotplugHandlerClass),
 };
+TYPE_INFO(hotplug_handler_info)
 
-static void hotplug_handler_register_types(void)
-{
-    type_register_static(&hotplug_handler_info);
-}
 
-type_init(hotplug_handler_register_types)
hw/core/irq.c +1 -5
index fb3045b912..8aebc22cb2 100644
@@ -136,10 +136,6 @@ static const TypeInfo irq_type_info = {
    .parent = TYPE_OBJECT,
    .instance_size = sizeof(struct IRQState),
 };
+TYPE_INFO(irq_type_info)
 
-static void irq_register_types(void)
-{
-    type_register_static(&irq_type_info);
-}
 
-type_init(irq_register_types)
hw/core/machine.c +1 -5
index 8d1a90c6cf..f8fb5cf259 100644
@@ -1146,10 +1146,6 @@ static const TypeInfo machine_info = {
     .instance_init = machine_initfn,
     .instance_finalize = machine_finalize,
 };
+TYPE_INFO(machine_info)
 
-static void machine_register_types(void)
-{
-    type_register_static(&machine_info);
-}
 
-type_init(machine_register_types)
hw/core/nmi.c +1 -5
index 481c4b3c7e..e14906f74d 100644
@@ -79,10 +79,6 @@ static const TypeInfo nmi_info = {
     .parent        = TYPE_INTERFACE,
     .class_size    = sizeof(NMIClass),
 };
+TYPE_INFO(nmi_info)
 
-static void nmi_register_types(void)
-{
-    type_register_static(&nmi_info);
-}
 
-type_init(nmi_register_types)
hw/core/or-irq.c +1 -5
index d8f3754e96..4ff195b3e2 100644
@@ -140,10 +140,6 @@ static const TypeInfo or_irq_type_info = {
    .instance_init = or_irq_init,
    .class_init = or_irq_class_init,
 };
+TYPE_INFO(or_irq_type_info)
 
-static void or_irq_register_types(void)
-{
-    type_register_static(&or_irq_type_info);
-}
 
-type_init(or_irq_register_types)
hw/core/platform-bus.c +1 -5
index 5037ca265e..5398bf92f5 100644
@@ -221,10 +221,6 @@ static const TypeInfo platform_bus_info = {
     .instance_size = sizeof(PlatformBusDevice),
     .class_init    = platform_bus_class_init,
 };
+TYPE_INFO(platform_bus_info)
 
-static void platform_bus_register_types(void)
-{
-    type_register_static(&platform_bus_info);
-}
 
-type_init(platform_bus_register_types)
hw/core/qdev.c +1 -5
index 96772a15bd..1b82b3fbf9 100644
@@ -1251,10 +1251,6 @@ static const TypeInfo device_type_info = {
         { }
     }
 };
+TYPE_INFO(device_type_info)
 
-static void qdev_register_types(void)
-{
-    type_register_static(&device_type_info);
-}
 
-type_init(qdev_register_types)
hw/core/register.c +1 -5
index ddf91eb445..2b25f993ce 100644
@@ -330,10 +330,6 @@ static const TypeInfo register_info = {
     .parent = TYPE_DEVICE,
     .class_init = register_class_init,
 };
+TYPE_INFO(register_info)
 
-static void register_register_types(void)
-{
-    type_register_static(&register_info);
-}
 
-type_init(register_register_types)
hw/core/resettable.c +1 -5
index 96a99ce39e..88ba81de71 100644
@@ -292,10 +292,6 @@ static const TypeInfo resettable_interface_info = {
     .parent     = TYPE_INTERFACE,
     .class_size = sizeof(ResettableClass),
 };
+TYPE_INFO(resettable_interface_info)
 
-static void reset_register_types(void)
-{
-    type_register_static(&resettable_interface_info);
-}
 
-type_init(reset_register_types)
hw/core/split-irq.c +1 -5
index 3b90af2e8f..35653c5d4d 100644
@@ -83,10 +83,6 @@ static const TypeInfo split_irq_type_info = {
    .instance_init = split_irq_init,
    .class_init = split_irq_class_init,
 };
+TYPE_INFO(split_irq_type_info)
 
-static void split_irq_register_types(void)
-{
-    type_register_static(&split_irq_type_info);
-}
 
-type_init(split_irq_register_types)
hw/core/stream.c +1 -5
index a65ad1208d..c1bb12537e 100644
@@ -24,11 +24,7 @@ static const TypeInfo stream_slave_info = {
     .parent        = TYPE_INTERFACE,
     .class_size = sizeof(StreamSlaveClass),
 };
+TYPE_INFO(stream_slave_info)
 
 
-static void stream_slave_register_types(void)
-{
-    type_register_static(&stream_slave_info);
-}
 
-type_init(stream_slave_register_types)
hw/core/sysbus.c +2 -6
index 70239b7e7d..9e89bfd8d4 100644
@@ -86,6 +86,7 @@ static const TypeInfo system_bus_info = {
     .instance_size = sizeof(BusState),
     .class_init = system_bus_class_init,
 };
+TYPE_INFO(system_bus_info)
 
 /* Check whether an IRQ source exists */
 bool sysbus_has_irq(SysBusDevice *dev, int n)
@@ -334,6 +335,7 @@ static const TypeInfo sysbus_device_type_info = {
     .class_size = sizeof(SysBusDeviceClass),
     .class_init = sysbus_device_class_init,
 };
+TYPE_INFO(sysbus_device_type_info)
 
 static BusState *main_system_bus;
 
@@ -355,10 +357,4 @@ BusState *sysbus_get_default(void)
     return main_system_bus;
 }
 
-static void sysbus_register_types(void)
-{
-    type_register_static(&system_bus_info);
-    type_register_static(&sysbus_device_type_info);
-}
 
-type_init(sysbus_register_types)
hw/core/vmstate-if.c +1 -5
index bf453620fe..3ad0c95df0 100644
@@ -14,10 +14,6 @@ static const TypeInfo vmstate_if_info = {
     .parent = TYPE_INTERFACE,
     .class_size = sizeof(VMStateIfClass),
 };
+TYPE_INFO(vmstate_if_info)
 
-static void vmstate_register_types(void)
-{
-    type_register_static(&vmstate_if_info);
-}
 
-type_init(vmstate_register_types);
hw/cpu/a15mpcore.c +1 -5
index c377be398d..78eb2a9517 100644
@@ -171,10 +171,6 @@ static const TypeInfo a15mp_priv_info = {
     .instance_init = a15mp_priv_initfn,
     .class_init = a15mp_priv_class_init,
 };
+TYPE_INFO(a15mp_priv_info)
 
-static void a15mp_register_types(void)
-{
-    type_register_static(&a15mp_priv_info);
-}
 
-type_init(a15mp_register_types)
hw/cpu/a9mpcore.c +1 -5
index 351295e518..a21de66857 100644
@@ -175,10 +175,6 @@ static const TypeInfo a9mp_priv_info = {
     .instance_init = a9mp_priv_initfn,
     .class_init    = a9mp_priv_class_init,
 };
+TYPE_INFO(a9mp_priv_info)
 
-static void a9mp_register_types(void)
-{
-    type_register_static(&a9mp_priv_info);
-}
 
-type_init(a9mp_register_types)
hw/cpu/arm11mpcore.c +1 -5
index 89c4e35143..55b0f0aaad 100644
@@ -160,10 +160,6 @@ static const TypeInfo mpcore_priv_info = {
     .instance_init = mpcore_priv_initfn,
     .class_init    = mpcore_priv_class_init,
 };
+TYPE_INFO(mpcore_priv_info)
 
-static void arm11mpcore_register_types(void)
-{
-    type_register_static(&mpcore_priv_info);
-}
 
-type_init(arm11mpcore_register_types)
hw/cpu/cluster.c +1 -5
index e444b7c29d..016b320889 100644
@@ -91,10 +91,6 @@ static const TypeInfo cpu_cluster_type_info = {
     .instance_size = sizeof(CPUClusterState),
     .class_init = cpu_cluster_class_init,
 };
+TYPE_INFO(cpu_cluster_type_info)
 
-static void cpu_cluster_register_types(void)
-{
-    type_register_static(&cpu_cluster_type_info);
-}
 
-type_init(cpu_cluster_register_types)
hw/cpu/core.c +1 -5
index 3a659291ea..2fc8b72a74 100644
@@ -91,10 +91,6 @@ static const TypeInfo cpu_core_type_info = {
     .instance_size = sizeof(CPUCore),
     .instance_init = cpu_core_instance_init,
 };
+TYPE_INFO(cpu_core_type_info)
 
-static void cpu_core_register_types(void)
-{
-    type_register_static(&cpu_core_type_info);
-}
 
-type_init(cpu_core_register_types)
hw/cpu/realview_mpcore.c +1 -5
index 96f4d2517a..0ae3019045 100644
@@ -128,10 +128,6 @@ static const TypeInfo mpcore_rirq_info = {
     .instance_init = mpcore_rirq_init,
     .class_init    = mpcore_rirq_class_init,
 };
+TYPE_INFO(mpcore_rirq_info)
 
-static void realview_mpcore_register_types(void)
-{
-    type_register_static(&mpcore_rirq_info);
-}
 
-type_init(realview_mpcore_register_types)
hw/display/ads7846.c +1 -5
index 56bf82fe07..94bb9db052 100644
@@ -174,10 +174,6 @@ static const TypeInfo ads7846_info = {
     .instance_size = sizeof(ADS7846State),
     .class_init    = ads7846_class_init,
 };
+TYPE_INFO(ads7846_info)
 
-static void ads7846_register_types(void)
-{
-    type_register_static(&ads7846_info);
-}
 
-type_init(ads7846_register_types)
hw/display/artist.c +1 -5
index 6261bfe65b..2e1b793a86 100644
@@ -1434,10 +1434,6 @@ static const TypeInfo artist_info = {
     .instance_init = artist_initfn,
     .class_init    = artist_class_init,
 };
+TYPE_INFO(artist_info)
 
-static void artist_register_types(void)
-{
-    type_register_static(&artist_info);
-}
 
-type_init(artist_register_types)
hw/display/ati.c +1 -5
index 4c3ad8f47b..5ddd252f34 100644
@@ -1043,10 +1043,6 @@ static const TypeInfo ati_vga_info = {
           { },
     },
 };
+TYPE_INFO(ati_vga_info)
 
-static void ati_vga_register_types(void)
-{
-    type_register_static(&ati_vga_info);
-}
 
-type_init(ati_vga_register_types)
hw/display/bcm2835_fb.c +1 -5
index 986c994522..e1f85fa948 100644
@@ -461,10 +461,6 @@ static TypeInfo bcm2835_fb_info = {
     .class_init    = bcm2835_fb_class_init,
     .instance_init = bcm2835_fb_init,
 };
+TYPE_INFO(bcm2835_fb_info)
 
-static void bcm2835_fb_register_types(void)
-{
-    type_register_static(&bcm2835_fb_info);
-}
 
-type_init(bcm2835_fb_register_types)
hw/display/bochs-display.c +1 -5
index a8e8ab8325..86869778ed 100644
@@ -381,10 +381,6 @@ static const TypeInfo bochs_display_type_info = {
         { },
     },
 };
+TYPE_INFO(bochs_display_type_info)
 
-static void bochs_display_register_types(void)
-{
-    type_register_static(&bochs_display_type_info);
-}
 
-type_init(bochs_display_register_types)
hw/display/cg3.c +1 -5
index 7cbe6e56ff..0e7e260ccf 100644
@@ -385,10 +385,6 @@ static const TypeInfo cg3_info = {
     .instance_init = cg3_initfn,
     .class_init    = cg3_class_init,
 };
+TYPE_INFO(cg3_info)
 
-static void cg3_register_types(void)
-{
-    type_register_static(&cg3_info);
-}
 
-type_init(cg3_register_types)
hw/display/cirrus_vga.c +1 -5
index 212d6f5e61..fe4d8a4fb8 100644
@@ -3028,10 +3028,6 @@ static const TypeInfo cirrus_vga_info = {
         { },
     },
 };
+TYPE_INFO(cirrus_vga_info)
 
-static void cirrus_vga_register_types(void)
-{
-    type_register_static(&cirrus_vga_info);
-}
 
-type_init(cirrus_vga_register_types)
hw/display/cirrus_vga_isa.c +1 -5
index 825ba57298..4d0e54b0f2 100644
@@ -90,10 +90,6 @@ static const TypeInfo isa_cirrus_vga_info = {
     .instance_size = sizeof(ISACirrusVGAState),
     .class_init = isa_cirrus_vga_class_init,
 };
+TYPE_INFO(isa_cirrus_vga_info)
 
-static void cirrus_vga_isa_register_types(void)
-{
-    type_register_static(&isa_cirrus_vga_info);
-}
 
-type_init(cirrus_vga_isa_register_types)
hw/display/dpcd.c +1 -5
index 64463654a1..ff5b655f0e 100644
@@ -156,10 +156,6 @@ static const TypeInfo dpcd_info = {
     .class_init    = dpcd_class_init,
     .instance_init = dpcd_init,
 };
+TYPE_INFO(dpcd_info)
 
-static void dpcd_register_types(void)
-{
-    type_register_static(&dpcd_info);
-}
 
-type_init(dpcd_register_types)
hw/display/exynos4210_fimd.c +1 -5
index 4b7286b7c9..bfd7f4fc6f 100644
@@ -1961,10 +1961,6 @@ static const TypeInfo exynos4210_fimd_info = {
     .instance_init = exynos4210_fimd_init,
     .class_init = exynos4210_fimd_class_init,
 };
+TYPE_INFO(exynos4210_fimd_info)
 
-static void exynos4210_fimd_register_types(void)
-{
-    type_register_static(&exynos4210_fimd_info);
-}
 
-type_init(exynos4210_fimd_register_types)
hw/display/g364fb.c +1 -5
index adcba96e34..33f2822445 100644
@@ -536,10 +536,6 @@ static const TypeInfo g364fb_sysbus_info = {
     .instance_size = sizeof(G364SysBusState),
     .class_init    = g364fb_sysbus_class_init,
 };
+TYPE_INFO(g364fb_sysbus_info)
 
-static void g364fb_register_types(void)
-{
-    type_register_static(&g364fb_sysbus_info);
-}
 
-type_init(g364fb_register_types)
hw/display/i2c-ddc.c +1 -5
index 13eb529fc1..5c5c255eb1 100644
@@ -120,10 +120,6 @@ static TypeInfo i2c_ddc_info = {
     .instance_init = i2c_ddc_init,
     .class_init = i2c_ddc_class_init
 };
+TYPE_INFO(i2c_ddc_info)
 
-static void ddc_register_devices(void)
-{
-    type_register_static(&i2c_ddc_info);
-}
 
-type_init(ddc_register_devices);
hw/display/jazz_led.c +1 -5
index 1d845597f9..1b1002e14a 100644
@@ -310,10 +310,6 @@ static const TypeInfo jazz_led_info = {
     .instance_init = jazz_led_init,
     .class_init    = jazz_led_class_init,
 };
+TYPE_INFO(jazz_led_info)
 
-static void jazz_led_register(void)
-{
-    type_register_static(&jazz_led_info);
-}
 
-type_init(jazz_led_register);
hw/display/macfb.c +2 -6
index b68faff4bb..1cac29e549 100644
@@ -459,6 +459,7 @@ static TypeInfo macfb_sysbus_info = {
     .instance_size = sizeof(MacfbSysBusState),
     .class_init    = macfb_sysbus_class_init,
 };
+TYPE_INFO(macfb_sysbus_info)
 
 static TypeInfo macfb_nubus_info = {
     .name          = TYPE_NUBUS_MACFB,
@@ -467,11 +468,6 @@ static TypeInfo macfb_nubus_info = {
     .class_init    = macfb_nubus_class_init,
     .class_size    = sizeof(MacfbNubusDeviceClass),
 };
+TYPE_INFO(macfb_nubus_info)
 
-static void macfb_register_types(void)
-{
-    type_register_static(&macfb_sysbus_info);
-    type_register_static(&macfb_nubus_info);
-}
 
-type_init(macfb_register_types)
hw/display/milkymist-tmu2.c +1 -5
index c34ef1a1bf..495b6c960f 100644
@@ -495,13 +495,9 @@ static const TypeInfo milkymist_tmu2_info = {
     .instance_init = milkymist_tmu2_init,
     .class_init    = milkymist_tmu2_class_init,
 };
+TYPE_INFO(milkymist_tmu2_info)
 
-static void milkymist_tmu2_register_types(void)
-{
[… more lines in the raw message]

Lines of this file are not shown. View the raw message.

hw/display/milkymist-vgafb.c +1 -5
index 6a6441e6ea..634bf4571a 100644

Lines of this file are not shown. View the raw message.

hw/display/next-fb.c +1 -5
index b0513a8fba..7839643757 100644

Lines of this file are not shown. View the raw message.

hw/display/pl110.c +3 -7
index 4664fde3f2..41ae247666 100644

Lines of this file are not shown. View the raw message.

hw/display/qxl.c +3 -7
index 11871340e7..4b9f97f5aa 100644

Lines of this file are not shown. View the raw message.

hw/display/ramfb-standalone.c +1 -5
index b18db97eeb..28e25acc96 100644

Lines of this file are not shown. View the raw message.

hw/display/sii9022.c +1 -5
index 3b82a8567f..7d0a97da6c 100644

Lines of this file are not shown. View the raw message.

hw/display/sm501.c +2 -6
index 9cccc68c35..626f7393a0 100644

Lines of this file are not shown. View the raw message.

hw/display/ssd0303.c +1 -5
index 718378f6de..24e7fc1598 100644

Lines of this file are not shown. View the raw message.

hw/display/ssd0323.c +1 -5
index 32d27f008a..056cc0b094 100644

Lines of this file are not shown. View the raw message.

hw/display/tcx.c +1 -5
index 1fb45b1aab..0d05421868 100644

Lines of this file are not shown. View the raw message.

hw/display/vga-isa.c +1 -5
index 3aaeeeca1e..1561f702b9 100644

Lines of this file are not shown. View the raw message.

hw/display/vga-pci.c +3 -7
index a640fd866d..5e8ddc9ac5 100644

Lines of this file are not shown. View the raw message.

hw/display/vhost-user-gpu.c +1 -5
index 4cdaee1bde..91f50165ba 100644

Lines of this file are not shown. View the raw message.

hw/display/virtio-gpu-base.c +1 -6
index 7961308606..6cc4858daa 100644

Lines of this file are not shown. View the raw message.

hw/display/virtio-gpu-pci.c +1 -1
index 34d8e93f28..8a71ee4f7e 100644

Lines of this file are not shown. View the raw message.

hw/display/virtio-gpu.c +1 -5
index 5f0dd7c150..790ea40637 100644

Lines of this file are not shown. View the raw message.

hw/display/virtio-vga.c +1 -1
index f533d7d1b4..e1342c2ea1 100644

Lines of this file are not shown. View the raw message.

hw/display/vmware_vga.c +1 -5
index 2579f6b218..487d29f5c0 100644

Lines of this file are not shown. View the raw message.

hw/display/xlnx_dp.c +1 -5
index c56e6ec593..95accb9442 100644

Lines of this file are not shown. View the raw message.

hw/dma/bcm2835_dma.c +1 -5
index eb0002a2b9..f7478c3954 100644

Lines of this file are not shown. View the raw message.

hw/dma/i82374.c +1 -5
index 6977d85ef8..6c433137a0 100644

Lines of this file are not shown. View the raw message.

hw/dma/i8257.c +1 -5
index db808029b0..bd3b225a77 100644

Lines of this file are not shown. View the raw message.

hw/dma/pl080.c +2 -6
index f1a586b1d7..823646a29a 100644

Lines of this file are not shown. View the raw message.

hw/dma/pl330.c +1 -5
index 0bd63a43f5..3288f31678 100644

Lines of this file are not shown. View the raw message.

hw/dma/puv3_dma.c +1 -5
index 7fa979180f..225aa5146f 100644

Lines of this file are not shown. View the raw message.

hw/dma/pxa2xx_dma.c +1 -5
index 78b2849bcb..b2f1f1b236 100644

Lines of this file are not shown. View the raw message.

hw/dma/rc4030.c +2 -6
index 7eddc9a776..ccbda2ce82 100644

Lines of this file are not shown. View the raw message.

hw/dma/sparc32_dma.c +4 -8
index bcd1626fbd..774669345b 100644

Lines of this file are not shown. View the raw message.

hw/dma/xilinx_axidma.c +3 -7
index a4812e480a..4c5c0c994b 100644

Lines of this file are not shown. View the raw message.

hw/dma/xlnx-zdma.c +1 -5
index fa38a55634..6d7df3a589 100644

Lines of this file are not shown. View the raw message.

hw/dma/xlnx-zynq-devcfg.c +1 -5
index e33112b6f0..4ee247d855 100644

Lines of this file are not shown. View the raw message.

hw/dma/xlnx_dpdma.c +1 -5
index b40c897de2..c5b0864a08 100644

Lines of this file are not shown. View the raw message.

hw/gpio/aspeed_gpio.c +5 -9
index 985a259e05..f00630e2ea 100644

Lines of this file are not shown. View the raw message.

hw/gpio/bcm2835_gpio.c +1 -5
index abdddbc67c..2ea64a77e8 100644

Lines of this file are not shown. View the raw message.

hw/gpio/gpio_key.c +1 -5
index 46bbd42772..571b74a5e5 100644

Lines of this file are not shown. View the raw message.

hw/gpio/imx_gpio.c +1 -5
index 7a591804a9..df533846f7 100644

Lines of this file are not shown. View the raw message.

hw/gpio/max7310.c +1 -5
index bebb4030d2..3a8e4ab1d5 100644

Lines of this file are not shown. View the raw message.

hw/gpio/mpc8xxx.c +1 -5
index 1d99667094..b1bdcc2851 100644

Lines of this file are not shown. View the raw message.

hw/gpio/nrf51_gpio.c +1 -5
index b47fddf4ed..e59d975a0c 100644

Lines of this file are not shown. View the raw message.

hw/gpio/omap_gpio.c +2 -6
index f662c4cb95..f8ab9a49df 100644

Lines of this file are not shown. View the raw message.

hw/gpio/pl061.c +2 -6
index 6d3c36bc16..b6ef1c7340 100644

Lines of this file are not shown. View the raw message.

hw/gpio/puv3_gpio.c +1 -5
index 7362b6715f..4c2edda889 100644

Lines of this file are not shown. View the raw message.

hw/gpio/zaurus.c +1 -5
index 258e926493..1100850a6c 100644

Lines of this file are not shown. View the raw message.

hw/hppa/dino.c +1 -5
index 7f0c6223a8..27faa97644 100644

Lines of this file are not shown. View the raw message.

hw/hppa/lasi.c +1 -5
index 19974034f3..8a54923c26 100644

Lines of this file are not shown. View the raw message.

hw/hyperv/hyperv.c +1 -5
index 844d00776d..07c9214bf1 100644

Lines of this file are not shown. View the raw message.

hw/hyperv/hyperv_testdev.c +1 -5
index 88a5a63782..c83d0a9325 100644

Lines of this file are not shown. View the raw message.

hw/hyperv/vmbus.c +3 -7
index 34392e892a..2014971dbc 100644

Lines of this file are not shown. View the raw message.

hw/i2c/aspeed_i2c.c +4 -8
index 518a3f5c6f..ecbbc22524 100644

Lines of this file are not shown. View the raw message.

hw/i2c/bitbang_i2c.c +1 -5
index b000952b98..566ccf0d74 100644

Lines of this file are not shown. View the raw message.

hw/i2c/core.c +2 -6
index 21ec52ac5a..81bfce2797 100644

Lines of this file are not shown. View the raw message.

hw/i2c/exynos4210_i2c.c +1 -5
index a600f65560..3a803ebc8b 100644

Lines of this file are not shown. View the raw message.

hw/i2c/imx_i2c.c +1 -5
index 2e02e1c4fa..a38eb18e33 100644

Lines of this file are not shown. View the raw message.

hw/i2c/microbit_i2c.c +1 -5
index 8024739820..51eb28bf21 100644

Lines of this file are not shown. View the raw message.

hw/i2c/mpc_i2c.c +1 -5
index 9a724f3a3e..c65fb2775b 100644

Lines of this file are not shown. View the raw message.

hw/i2c/omap_i2c.c +1 -5
index e5d205dda5..ba7b7ee734 100644

Lines of this file are not shown. View the raw message.

hw/i2c/ppc4xx_i2c.c +1 -5
index c0a8e04567..49ca51516e 100644

Lines of this file are not shown. View the raw message.

hw/i2c/smbus_eeprom.c +1 -5
index b7def9eeb8..cc506b6d4a 100644

Lines of this file are not shown. View the raw message.

hw/i2c/smbus_ich9.c +1 -5
index 48f1ff4191..37a41b5b77 100644

Lines of this file are not shown. View the raw message.

hw/i2c/smbus_slave.c +1 -5
index 5d10e27664..6a8b0846c7 100644

Lines of this file are not shown. View the raw message.

hw/i2c/versatile_i2c.c +1 -5
index da8cda2ec1..13ddddef90 100644

Lines of this file are not shown. View the raw message.

hw/i386/amd_iommu.c +3 -7
index 087f601666..54bc1acbac 100644

Lines of this file are not shown. View the raw message.

hw/i386/intel_iommu.c +2 -6
index 5284bb68b6..5e9101cd52 100644

Lines of this file are not shown. View the raw message.

hw/i386/kvm/apic.c +1 -5
index 4eb2d77b87..06dd7f8c9a 100644

Lines of this file are not shown. View the raw message.

hw/i386/kvm/clock.c +1 -5
index 64283358f9..e9f57d0e2b 100644

Lines of this file are not shown. View the raw message.

hw/i386/kvm/i8254.c +1 -5
index 876f5aa6fa..0f3d10d123 100644

Lines of this file are not shown. View the raw message.

hw/i386/kvm/i8259.c +1 -5
index e404fdcdac..f7844260d5 100644

Lines of this file are not shown. View the raw message.

hw/i386/kvm/ioapic.c +1 -5
index 4ba8e47251..751cc5b6e0 100644

Lines of this file are not shown. View the raw message.

hw/i386/kvmvapic.c +1 -5
index 51639202c2..a08519ee70 100644

Lines of this file are not shown. View the raw message.

hw/i386/microvm.c +1 -5
index 81d0888930..a332e9b9e1 100644

Lines of this file are not shown. View the raw message.

hw/i386/pc.c +1 -5
index 47c5ca3e34..e67ed86091 100644

Lines of this file are not shown. View the raw message.

hw/i386/pc_piix.c +1 -5
index b789e83f9a..a79ab9aa38 100644

Lines of this file are not shown. View the raw message.

hw/i386/port92.c +1 -5
index 19866c44ef..cc41fb034f 100644

Lines of this file are not shown. View the raw message.

hw/i386/vmmouse.c +1 -5
index ba5c987bd2..cea1924e69 100644

Lines of this file are not shown. View the raw message.

hw/i386/vmport.c +1 -5
index 89bda9108e..6379e14401 100644

Lines of this file are not shown. View the raw message.

hw/i386/x86-iommu.c +1 -5
index 4104060e68..ab1d4fb9e4 100644

Lines of this file are not shown. View the raw message.

hw/i386/x86.c +1 -5
index 67bee1bcb8..cf77c1e4bb 100644

Lines of this file are not shown. View the raw message.

hw/i386/xen/xen_apic.c +1 -5
index 7c7a60b166..9578463a48 100644

Lines of this file are not shown. View the raw message.

hw/i386/xen/xen_platform.c +1 -5
index a1492fdecd..93de73323b 100644

Lines of this file are not shown. View the raw message.

hw/i386/xen/xen_pvdevice.c +1 -5
index ee2610c7a0..d62d26e0b6 100644

Lines of this file are not shown. View the raw message.

hw/ide/ahci-allwinner.c +1 -5
index 8536b9eb5a..b0aafa2b99 100644

Lines of this file are not shown. View the raw message.

hw/ide/ahci.c +1 -5
index 009120f88b..299a9bba56 100644

Lines of this file are not shown. View the raw message.

hw/ide/cmd646.c +1 -5
index c254631485..390a3dc679 100644

Lines of this file are not shown. View the raw message.

hw/ide/ich.c +1 -5
index eff3188fff..f7fb430a3c 100644

Lines of this file are not shown. View the raw message.

hw/ide/isa.c +1 -5
index f28c8fba6c..f63166f31d 100644

Lines of this file are not shown. View the raw message.

hw/ide/macio.c +1 -5
index 62a599a075..4e74dafa03 100644

Lines of this file are not shown. View the raw message.

hw/ide/microdrive.c +2 -6
index c4cc0a84eb..97483e5836 100644

Lines of this file are not shown. View the raw message.

hw/ide/mmio.c +1 -5
index d233bd8c01..83f0d4a583 100644

Lines of this file are not shown. View the raw message.

hw/ide/pci.c +1 -5
index 5e85c4ad17..7b20224754 100644

Lines of this file are not shown. View the raw message.

hw/ide/piix.c +3 -7
index b402a93636..804c241c1f 100644

Lines of this file are not shown. View the raw message.

hw/ide/qdev.c +5 -9
index 27ff1f7f66..4e03200438 100644

Lines of this file are not shown. View the raw message.

hw/ide/sii3112.c +1 -5
index 94d2b57f95..68279530fd 100644

Lines of this file are not shown. View the raw message.

hw/ide/via.c +1 -5
index be09912b33..00a995acd7 100644

Lines of this file are not shown. View the raw message.

hw/input/adb-kbd.c +1 -5
index 3cfb6a7a20..4f0f546581 100644

Lines of this file are not shown. View the raw message.

hw/input/adb-mouse.c +1 -5
index 577a38ff2e..c0c8dead39 100644

Lines of this file are not shown. View the raw message.

hw/input/adb.c +2 -6
index 013fcc9c54..3afbe59217 100644

Lines of this file are not shown. View the raw message.

hw/input/lm832x.c +1 -5
index aa629ddbf1..ffe68b081a 100644

Lines of this file are not shown. View the raw message.

hw/input/milkymist-softusb.c +1 -5
index 3e0a7eb0bd..73ee7edbd0 100644

Lines of this file are not shown. View the raw message.

hw/input/pckbd.c +1 -5
index 29d633ca94..5b186cc3d0 100644

Lines of this file are not shown. View the raw message.

hw/input/pl050.c +3 -7
index 1123037b38..b018e708a6 100644

Lines of this file are not shown. View the raw message.

hw/input/vhost-user-input.c +1 -5
index 63984a8ba7..32318bf1ca 100644

Lines of this file are not shown. View the raw message.

hw/input/virtio-input-hid.c +4 -8
index a7a244a95d..70e27e2c64 100644

Lines of this file are not shown. View the raw message.

hw/input/virtio-input-host.c +1 -5
index 85daf73f1a..aa4d17a903 100644

Lines of this file are not shown. View the raw message.

hw/input/virtio-input.c +1 -5
index 54bcb46c74..044d1599e4 100644

Lines of this file are not shown. View the raw message.

hw/intc/allwinner-a10-pic.c +1 -5
index 8cca124807..63ad2de08f 100644

Lines of this file are not shown. View the raw message.

hw/intc/apic.c +1 -5
index 38aabd60cd..770e14fc3e 100644

Lines of this file are not shown. View the raw message.

hw/intc/apic_common.c +1 -5
index 81addd6390..a4851ba64a 100644

Lines of this file are not shown. View the raw message.

hw/intc/arm_gic.c +1 -5
index c60dc6b5e6..cf16727da2 100644

Lines of this file are not shown. View the raw message.

hw/intc/arm_gic_common.c +1 -5
index 7b44d5625b..fef492f476 100644

Lines of this file are not shown. View the raw message.

hw/intc/arm_gic_kvm.c +1 -5
index 07b95143c9..b0379ea4c5 100644

Lines of this file are not shown. View the raw message.

hw/intc/arm_gicv2m.c +1 -5
index 0b7e2b4f84..d129a8c9f1 100644

Lines of this file are not shown. View the raw message.

hw/intc/arm_gicv3.c +1 -5
index 66eaa97198..17f169087d 100644

Lines of this file are not shown. View the raw message.

hw/intc/arm_gicv3_common.c +1 -5
index 58ef65f589..3cb906125a 100644

Lines of this file are not shown. View the raw message.

hw/intc/arm_gicv3_its_common.c +1 -5
index 66c4c6a188..05e385222d 100644

Lines of this file are not shown. View the raw message.

hw/intc/arm_gicv3_its_kvm.c +1 -5
index 46835ed085..ddd3a5a665 100644

Lines of this file are not shown. View the raw message.

hw/intc/arm_gicv3_kvm.c +1 -5
index eddd07c743..30d09d307e 100644

Lines of this file are not shown. View the raw message.

hw/intc/armv7m_nvic.c +1 -5
index 277a98b87b..819a77ceb4 100644

Lines of this file are not shown. View the raw message.

hw/intc/aspeed_vic.c +1 -5
index 5ba06c5262..e60d23bc34 100644

Lines of this file are not shown. View the raw message.

hw/intc/bcm2835_ic.c +1 -5
index 53ab8f5881..4a0b62a356 100644

Lines of this file are not shown. View the raw message.

hw/intc/bcm2836_control.c +1 -5
index 53dba0080c..7c9568f5ff 100644

Lines of this file are not shown. View the raw message.

hw/intc/etraxfs_pic.c +1 -5
index 12988c7aa9..d77d65ed38 100644

Lines of this file are not shown. View the raw message.

hw/intc/exynos4210_combiner.c +1 -5
index b8561e4180..d0365915af 100644

Lines of this file are not shown. View the raw message.

hw/intc/exynos4210_gic.c +2 -10
index 0aa3b843a9..a01ab137eb 100644

Lines of this file are not shown. View the raw message.

hw/intc/grlib_irqmp.c +1 -5
index 794c643af2..1a3c846cee 100644

Lines of this file are not shown. View the raw message.

hw/intc/heathrow_pic.c +1 -5
index cb97c315da..8faa8a5582 100644

Lines of this file are not shown. View the raw message.

hw/intc/i8259.c +1 -5
index 51b27f6a34..a213683f44 100644

Lines of this file are not shown. View the raw message.

hw/intc/i8259_common.c +1 -5
index d90b40fe4c..a859ec4783 100644

Lines of this file are not shown. View the raw message.

hw/intc/ibex_plic.c +1 -5
index 41079518c6..381658d827 100644

Lines of this file are not shown. View the raw message.

hw/intc/imx_avic.c +1 -5
index 63fc602a1a..805da5e2f2 100644

Lines of this file are not shown. View the raw message.

hw/intc/imx_gpcv2.c +1 -5
index 17007a4078..b04fa35211 100644

Lines of this file are not shown. View the raw message.

hw/intc/intc.c +1 -5
index 2e1e29e753..c526f90672 100644

Lines of this file are not shown. View the raw message.

hw/intc/ioapic.c +1 -5
index bca71b5934..4e865aac74 100644

Lines of this file are not shown. View the raw message.

hw/intc/ioapic_common.c +1 -5
index 5538b5b86e..98a20fddf7 100644

Lines of this file are not shown. View the raw message.

hw/intc/lm32_pic.c +1 -5
index 36de670c9e..2f609dc93f 100644

Lines of this file are not shown. View the raw message.

hw/intc/loongson_liointc.c +1 -5
index 23ca51cc2e..10e4c7278b 100644

Lines of this file are not shown. View the raw message.

hw/intc/mips_gic.c +1 -5
index bda4549925..1d2efed60a 100644

Lines of this file are not shown. View the raw message.

hw/intc/nios2_iic.c +1 -5
index 1a5df8c89a..43abcd95aa 100644

Lines of this file are not shown. View the raw message.

hw/intc/omap_intc.c +3 -7
index b8a1d1fd7d..6f6a490db9 100644

Lines of this file are not shown. View the raw message.

hw/intc/ompic.c +1 -5
index c354427a61..d01b593cc4 100644

Lines of this file are not shown. View the raw message.

hw/intc/openpic.c +1 -5
index 65970e1b37..1d86d5b6b1 100644

Lines of this file are not shown. View the raw message.

hw/intc/openpic_kvm.c +1 -5
index e4bf47d885..f0add3e3ee 100644

Lines of this file are not shown. View the raw message.

hw/intc/pl190.c +1 -5
index e3bd3dd121..5b237c0920 100644

Lines of this file are not shown. View the raw message.

hw/intc/pnv_xive.c +1 -5
index 5f69626b3a..e333c85162 100644

Lines of this file are not shown. View the raw message.

hw/intc/puv3_intc.c +1 -5
index 090d4839d1..3f43aea812 100644

Lines of this file are not shown. View the raw message.

hw/intc/realview_gic.c +1 -5
index 9b12116b2a..e85422f40d 100644

Lines of this file are not shown. View the raw message.

hw/intc/rx_icu.c +1 -5
index df4b6a8d22..2e47e6e099 100644

Lines of this file are not shown. View the raw message.

hw/intc/s390_flic.c +2 -6
index aacdb1bbc2..d9a51ddb2a 100644

Lines of this file are not shown. View the raw message.

hw/intc/s390_flic_kvm.c +1 -5
index dbd4e682ce..a48adef68d 100644

Lines of this file are not shown. View the raw message.

hw/intc/slavio_intctl.c +1 -5
index c4cf9096eb..65aea84cf3 100644

Lines of this file are not shown. View the raw message.

hw/intc/spapr_xive.c +1 -5
index 89c8cd9667..202783388c 100644

Lines of this file are not shown. View the raw message.

hw/intc/xics.c +3 -7
index 68f9d44feb..12cae926cc 100644

Lines of this file are not shown. View the raw message.

hw/intc/xics_pnv.c +1 -5
index 35f3811264..dd7cb00a16 100644

Lines of this file are not shown. View the raw message.

hw/intc/xics_spapr.c +1 -5
index 8ae4f41459..01a9481b9a 100644

Lines of this file are not shown. View the raw message.

hw/intc/xilinx_intc.c +1 -5
index 3e65e68619..4efd6297ca 100644

Lines of this file are not shown. View the raw message.

hw/intc/xive.c +7 -11
index 9a162431e0..c61a7b5b28 100644

Lines of this file are not shown. View the raw message.

hw/intc/xlnx-pmu-iomod-intc.c +1 -5
index acaa1c3e6f..bc1f431407 100644

Lines of this file are not shown. View the raw message.

hw/intc/xlnx-zynqmp-ipi.c +1 -5
index adc1179014..3895061f87 100644

Lines of this file are not shown. View the raw message.

hw/ipack/ipack.c +2 -6
index f19ecaeb1c..9cb74e3d32 100644

Lines of this file are not shown. View the raw message.

hw/ipack/tpci200.c +1 -5
index f931d4df62..292836b379 100644

Lines of this file are not shown. View the raw message.

hw/ipmi/ipmi.c +2 -6
index 8d35c9fdd6..aa5428e7e9 100644

Lines of this file are not shown. View the raw message.

hw/ipmi/ipmi_bmc_sim.c +1 -5
index f78e92d3d5..caa4d75915 100644

Lines of this file are not shown. View the raw message.

hw/ipmi/isa_ipmi_bt.c +1 -5
index c8dc0a09dc..389b4ece7f 100644

Lines of this file are not shown. View the raw message.

hw/ipmi/isa_ipmi_kcs.c +1 -5
index 4b421c33f4..465aba5ac8 100644

Lines of this file are not shown. View the raw message.

hw/ipmi/pci_ipmi_bt.c +1 -5
index ba9cf016b5..4d20d36ed1 100644

Lines of this file are not shown. View the raw message.

hw/ipmi/pci_ipmi_kcs.c +1 -5
index 99f46152f4..f3f4cee8f5 100644

Lines of this file are not shown. View the raw message.

hw/ipmi/smbus_ipmi.c +1 -5
index f1a0148755..dbfe949890 100644

Lines of this file are not shown. View the raw message.

hw/isa/i82378.c +1 -5
index 75a2da2881..2341e13bc3 100644

Lines of this file are not shown. View the raw message.

hw/isa/isa-bus.c +4 -8
index 58fde178f9..6a52f350a5 100644

Lines of this file are not shown. View the raw message.

hw/isa/isa-superio.c +2 -6
index e2e47d8fd9..803cf27f6b 100644

Lines of this file are not shown. View the raw message.

hw/isa/lpc_ich9.c +1 -5
index cd6e169d47..6011ae073f 100644

Lines of this file are not shown. View the raw message.

hw/isa/pc87312.c +1 -5
index 0cacbbc91b..db22a75e28 100644

Lines of this file are not shown. View the raw message.

hw/isa/piix3.c +3 -7
index 1a5267e19f..568d73c488 100644

Lines of this file are not shown. View the raw message.

hw/isa/piix4.c +1 -5
index ac044afa95..705c5c5567 100644

Lines of this file are not shown. View the raw message.

hw/isa/smc37c669-superio.c +1 -5
index 18287741cb..f26769ba6d 100644

Lines of this file are not shown. View the raw message.

hw/isa/vt82c686.c +5 -9
index 18160ca445..2b68111629 100644

Lines of this file are not shown. View the raw message.

hw/lm32/lm32_boards.c +2 -6
index b842f74344..1541d53b5e 100644

Lines of this file are not shown. View the raw message.

hw/m68k/mcf_intc.c +1 -5
index e01e2e111b..e6e9d7c03e 100644

Lines of this file are not shown. View the raw message.

hw/m68k/next-cube.c +1 -5
index d3f25cd6d7..e839765cb7 100644

Lines of this file are not shown. View the raw message.

hw/m68k/next-kbd.c +1 -5
index 2dff87be15..fc000ae694 100644

Lines of this file are not shown. View the raw message.

hw/m68k/q800.c +1 -5
index 1ca482ad81..35dfb8d858 100644

Lines of this file are not shown. View the raw message.

hw/mem/memory-device.c +1 -5
index 4bc9cf0917..cc5b67da8b 100644

Lines of this file are not shown. View the raw message.

hw/mem/nvdimm.c +1 -5
index e1574bc07c..dff6e553de 100644

Lines of this file are not shown. View the raw message.

hw/mem/pc-dimm.c +1 -5
index c30351070b..58657be673 100644

Lines of this file are not shown. View the raw message.

hw/microblaze/xlnx-zynqmp-pmu.c +1 -5
index 5f994547f7..e025070a9b 100644

Lines of this file are not shown. View the raw message.

hw/mips/boston.c +1 -5
index 766458c015..55deb9c74a 100644

Lines of this file are not shown. View the raw message.

hw/mips/cps.c +1 -5
index 615e1a1ad2..d1a3b59638 100644

Lines of this file are not shown. View the raw message.

hw/mips/gt64xxx_pci.c +2 -6
index 756ac9ae12..1a69c18e38 100644

Lines of this file are not shown. View the raw message.

hw/mips/jazz.c +2 -6
index 82a6e3220e..acac5ab567 100644

Lines of this file are not shown. View the raw message.

hw/mips/malta.c +1 -5
index a59e20c81c..1c16bc6c0c 100644

Lines of this file are not shown. View the raw message.

hw/misc/a9scu.c +1 -5
index 324371a1c0..3d68782cd5 100644

Lines of this file are not shown. View the raw message.

hw/misc/allwinner-cpucfg.c +1 -5
index bbd33a7dac..36327860bf 100644

Lines of this file are not shown. View the raw message.

hw/misc/allwinner-h3-ccu.c +1 -5
index 18d1074545..0ac0efcd18 100644

Lines of this file are not shown. View the raw message.

hw/misc/allwinner-h3-dramc.c +1 -5
index 1d37cf422c..015f5c71dd 100644

Lines of this file are not shown. View the raw message.

hw/misc/allwinner-h3-sysctrl.c +1 -5
index 1d07efa880..3f404ab0e7 100644

Lines of this file are not shown. View the raw message.

hw/misc/allwinner-sid.c +1 -5
index 196380c33a..a0c870552a 100644

Lines of this file are not shown. View the raw message.

hw/misc/applesmc.c +1 -5
index 1c4addb201..8eebd48f81 100644

Lines of this file are not shown. View the raw message.

hw/misc/arm11scu.c +1 -5
index 17c36a0545..a6d171b708 100644

Lines of this file are not shown. View the raw message.

hw/misc/arm_integrator_debug.c +1 -5
index 3e23201ae6..71b1c3c117 100644

Lines of this file are not shown. View the raw message.

hw/misc/arm_l2x0.c +1 -5
index 2066c97f5f..d395a9f354 100644

Lines of this file are not shown. View the raw message.

hw/misc/arm_sysctl.c +1 -5
index a474bbdd19..3f3d61ebb1 100644

Lines of this file are not shown. View the raw message.

hw/misc/armsse-cpuid.c +1 -5
index d58138dc28..d191ab1bda 100644

Lines of this file are not shown. View the raw message.

hw/misc/armsse-mhu.c +1 -5
index a45d97fada..4083d7e1d2 100644

Lines of this file are not shown. View the raw message.

hw/misc/aspeed_scu.c +4 -8
index ec4fef900e..4dfc480e46 100644

Lines of this file are not shown. View the raw message.

hw/misc/aspeed_sdmc.c +4 -8
index 855848b7d2..77365b46e3 100644

Lines of this file are not shown. View the raw message.

hw/misc/aspeed_xdma.c +1 -5
index dca5585a75..82d864fe68 100644

Lines of this file are not shown. View the raw message.

hw/misc/auxbus.c +3 -7
index da361baa32..a4ed045ce9 100644

Lines of this file are not shown. View the raw message.

hw/misc/avr_power.c +1 -5
index a5412f2cfe..ca413fd5a5 100644

Lines of this file are not shown. View the raw message.

hw/misc/bcm2835_mbox.c +1 -5
index 9f73cbd5e4..eabe45eb96 100644

Lines of this file are not shown. View the raw message.

hw/misc/bcm2835_mphi.c +1 -5
index 0428e10ba5..7bf8156e69 100644

Lines of this file are not shown. View the raw message.

hw/misc/bcm2835_property.c +1 -5
index 73941bdae9..7b5375f264 100644

Lines of this file are not shown. View the raw message.

hw/misc/bcm2835_rng.c +1 -5
index d0c4e64e88..ff99501644 100644

Lines of this file are not shown. View the raw message.

hw/misc/bcm2835_thermal.c +1 -5
index c6f3b1ad60..210a943581 100644

Lines of this file are not shown. View the raw message.

hw/misc/debugexit.c +1 -5
index 99a814f10c..e0f00d2a96 100644

Lines of this file are not shown. View the raw message.

hw/misc/eccmemctl.c +1 -5
index aec447368e..daf75f1335 100644

Lines of this file are not shown. View the raw message.

hw/misc/empty_slot.c +1 -5
index 9a011b1c11..d1736d784d 100644

Lines of this file are not shown. View the raw message.

hw/misc/exynos4210_clk.c +1 -1
index bc1463ff89..da18bc974c 100644

Lines of this file are not shown. View the raw message.

hw/misc/exynos4210_pmu.c +1 -5
index 500f28343f..12ce99969c 100644

Lines of this file are not shown. View the raw message.

hw/misc/exynos4210_rng.c +1 -5
index 38cd61c7ea..b4938fe848 100644

Lines of this file are not shown. View the raw message.

hw/misc/grlib_ahb_apb_pnp.c +2 -6
index 43e001c3c7..1c0178deb3 100644

Lines of this file are not shown. View the raw message.

hw/misc/imx25_ccm.c +1 -5
index d3107e5ca2..7b9d9dc5b5 100644

Lines of this file are not shown. View the raw message.

hw/misc/imx31_ccm.c +1 -5
index 6e246827ab..c12610e69b 100644

Lines of this file are not shown. View the raw message.

hw/misc/imx6_ccm.c +1 -5
index 7fec8f0a47..582e070287 100644

Lines of this file are not shown. View the raw message.

hw/misc/imx6_src.c +1 -5
index dd99cc7acf..00af88e31b 100644

Lines of this file are not shown. View the raw message.

hw/misc/imx6ul_ccm.c +1 -5
index 5e0661dacf..48e10f644d 100644

Lines of this file are not shown. View the raw message.

hw/misc/imx7_ccm.c +2 -6
index 02fc1ae8d0..08642e103b 100644

Lines of this file are not shown. View the raw message.

hw/misc/imx7_gpr.c +1 -5
index b03341a2eb..d1ae539f59 100644

Lines of this file are not shown. View the raw message.

hw/misc/imx7_snvs.c +1 -5
index 45972a5920..e92b3bd9a5 100644

Lines of this file are not shown. View the raw message.

hw/misc/imx_ccm.c +1 -5
index 2f81b0ad73..d2bba941e5 100644

Lines of this file are not shown. View the raw message.

hw/misc/imx_rngc.c +1 -5
index 4c270df2db..8e67d3ef2a 100644

Lines of this file are not shown. View the raw message.

hw/misc/iotkit-secctl.c +1 -5
index 9fdb82056a..0c93ed02d8 100644

Lines of this file are not shown. View the raw message.

hw/misc/iotkit-sysctl.c +1 -5
index 269783366d..b145a76680 100644

Lines of this file are not shown. View the raw message.

hw/misc/iotkit-sysinfo.c +1 -5
index b2dcfc4376..559f640cd1 100644

Lines of this file are not shown. View the raw message.

hw/misc/ivshmem.c +3 -7
index 2b6882face..e61062a2ed 100644

Lines of this file are not shown. View the raw message.

hw/misc/mac_via.c +3 -7
index d76d7b28d3..79c660eb2d 100644

Lines of this file are not shown. View the raw message.

hw/misc/macio/cuda.c +2 -6
index 286e7a55f4..751aa7c240 100644

Lines of this file are not shown. View the raw message.

hw/misc/macio/gpio.c +1 -5
index 0fef8fb335..f77db07c67 100644

Lines of this file are not shown. View the raw message.

hw/misc/macio/mac_dbdma.c +1 -5
index e220f1a927..13c201c74f 100644

Lines of this file are not shown. View the raw message.

hw/misc/macio/macio.c +4 -8
index 679722628e..b9aba19d18 100644

Lines of this file are not shown. View the raw message.

hw/misc/macio/pmu.c +2 -6
index 09022995ad..0f1d73e267 100644

Lines of this file are not shown. View the raw message.

hw/misc/max111x.c +3 -7
index 7e6723f343..3db545c99a 100644

Lines of this file are not shown. View the raw message.

hw/misc/milkymist-hpdmc.c +1 -5
index 61e86e6b34..bb21fd7a4b 100644

Lines of this file are not shown. View the raw message.

hw/misc/milkymist-pfpu.c +1 -5
index 516825e83d..f78de71df4 100644

Lines of this file are not shown. View the raw message.

hw/misc/mips_cmgcr.c +1 -5
index 3c8b37f700..ddb46df9fa 100644

Lines of this file are not shown. View the raw message.

hw/misc/mips_cpc.c +1 -5
index 2f7b2c9592..9b155b1326 100644

Lines of this file are not shown. View the raw message.

hw/misc/mips_itu.c +1 -5
index 3540985258..7afc7c053d 100644

Lines of this file are not shown. View the raw message.

hw/misc/mos6522.c +1 -5
index 19e154b870..240839e994 100644

Lines of this file are not shown. View the raw message.

hw/misc/mps2-fpgaio.c +1 -5
index 2f3fbeef34..83c060f0ca 100644

Lines of this file are not shown. View the raw message.

hw/misc/mps2-scc.c +1 -5
index 9d0909e7b3..c3de3813e8 100644

Lines of this file are not shown. View the raw message.

hw/misc/msf2-sysreg.c +1 -5
index 2dce55c364..6ea5b97456 100644

Lines of this file are not shown. View the raw message.

hw/misc/mst_fpga.c +1 -5
index 81abdf8ede..fc4100e1b5 100644

Lines of this file are not shown. View the raw message.

hw/misc/nrf51_rng.c +1 -5
index fc86e1b697..1f71b295f5 100644

Lines of this file are not shown. View the raw message.

hw/misc/pc-testdev.c +1 -5
index 8aa8e6549f..9d5a17f747 100644

Lines of this file are not shown. View the raw message.

hw/misc/pca9552.c +2 -6
index e4ccdeaf78..60f73dd257 100644

Lines of this file are not shown. View the raw message.

hw/misc/pci-testdev.c +1 -5
index 188de4d9cc..1b0aba0429 100644

Lines of this file are not shown. View the raw message.

hw/misc/puv3_pm.c +1 -5
index 8989d363cd..8cc3d44efa 100644

Lines of this file are not shown. View the raw message.

hw/misc/pvpanic.c +1 -5
index abb10bbcaf..98ce4e3289 100644

Lines of this file are not shown. View the raw message.

hw/misc/sga.c +1 -5
index 6866bf72cb..c1a5625d6a 100644

Lines of this file are not shown. View the raw message.

hw/misc/slavio_misc.c +2 -6
index 279b38dfc7..41be8d7598 100644

Lines of this file are not shown. View the raw message.

hw/misc/stm32f2xx_syscfg.c +1 -5
index aa59b43549..c106f28257 100644

Lines of this file are not shown. View the raw message.

hw/misc/stm32f4xx_exti.c +1 -5
index 02e7810046..d00a0240ef 100644

Lines of this file are not shown. View the raw message.

hw/misc/stm32f4xx_syscfg.c +1 -5
index f960e4ea1e..fe70ba4c7b 100644

Lines of this file are not shown. View the raw message.

hw/misc/tmp105.c +1 -5
index b47120492a..59cea18752 100644

Lines of this file are not shown. View the raw message.

hw/misc/tmp421.c +1 -1
index 49abe2d246..7ae88322b7 100644

Lines of this file are not shown. View the raw message.

hw/misc/tz-mpc.c +2 -6
index 98f151237f..415e067676 100644

Lines of this file are not shown. View the raw message.

hw/misc/tz-msc.c +1 -5
index acbe94400b..6ece4c15a5 100644

Lines of this file are not shown. View the raw message.

hw/misc/tz-ppc.c +1 -5
index 6431257b52..58c39757d4 100644

Lines of this file are not shown. View the raw message.

hw/misc/unimp.c +1 -5
index bc4084d344..cb5ba7b363 100644

Lines of this file are not shown. View the raw message.

hw/misc/vmcoreinfo.c +1 -5
index a9d718fc23..7b88db0413 100644

Lines of this file are not shown. View the raw message.

hw/misc/zynq-xadc.c +1 -5
index 7b1972ce06..f95ccd4c85 100644

Lines of this file are not shown. View the raw message.

hw/misc/zynq_slcr.c +1 -5
index f7472d1f3c..51d14a29a1 100644

Lines of this file are not shown. View the raw message.

hw/net/allwinner-sun8i-emac.c +1 -5
index 28637ff4c1..d2f1df3a84 100644

Lines of this file are not shown. View the raw message.

hw/net/allwinner_emac.c +1 -5
index ddddf35c45..bdd4c97162 100644

Lines of this file are not shown. View the raw message.

hw/net/cadence_gem.c +1 -5
index a93b5c07ce..b39b289104 100644

Lines of this file are not shown. View the raw message.

hw/net/can/can_kvaser_pci.c +1 -5
index 4b941370d0..ae35e51434 100644

Lines of this file are not shown. View the raw message.

hw/net/can/can_mioe3680_pci.c +1 -5
index 695e762a8d..271f44d5af 100644

Lines of this file are not shown. View the raw message.

hw/net/can/can_pcm3680_pci.c +1 -5
index 4218e63eb2..e3173a6f1c 100644

Lines of this file are not shown. View the raw message.

hw/net/dp8393x.c +1 -5
index c54db0d62d..86bb2b6529 100644

Lines of this file are not shown. View the raw message.

hw/net/e1000.c +1 -1
index c4d896a9e6..ce0540face 100644

Lines of this file are not shown. View the raw message.

hw/net/e1000e.c +1 -5
index fda34518c9..b955f76869 100644

Lines of this file are not shown. View the raw message.

hw/net/etraxfs_eth.c +1 -5
index 3408ceacb5..d7712e2924 100644

Lines of this file are not shown. View the raw message.

hw/net/fsl_etsec/etsec.c +1 -5
index 7035cf4eb9..410ae10553 100644

Lines of this file are not shown. View the raw message.

hw/net/ftgmac100.c +2 -6
index 5f4b26fc5f..70620d864b 100644

Lines of this file are not shown. View the raw message.

hw/net/imx_fec.c +2 -6
index 2c14804041..372fdd839b 100644

Lines of this file are not shown. View the raw message.

hw/net/lan9118.c +1 -5
index 8e2a432179..32cee7b116 100644

Lines of this file are not shown. View the raw message.

hw/net/lance.c +1 -5
index 4c5f01baad..9190a4f178 100644

Lines of this file are not shown. View the raw message.

hw/net/lasi_i82596.c +1 -5
index 820b63f350..e17ab6d394 100644

Lines of this file are not shown. View the raw message.

hw/net/mcf_fec.c +1 -5
index 25e3e453ab..1da49cf688 100644

Lines of this file are not shown. View the raw message.

hw/net/milkymist-minimac2.c +1 -5
index 1ba01754ee..c1531a8637 100644

Lines of this file are not shown. View the raw message.

hw/net/mipsnet.c +1 -5
index 0c578c430c..137a964795 100644

Lines of this file are not shown. View the raw message.

hw/net/msf2-emac.c +1 -5
index 32ba9e8412..8bc6bcf46d 100644

Lines of this file are not shown. View the raw message.

hw/net/ne2000-isa.c +1 -5
index a878056426..8d1fa0fc32 100644

Lines of this file are not shown. View the raw message.

hw/net/ne2000-pci.c +1 -5
index 9e5d10859a..7508125610 100644

Lines of this file are not shown. View the raw message.

hw/net/opencores_eth.c +1 -5
index 2ba0dc8c2f..8ef1197157 100644

Lines of this file are not shown. View the raw message.

hw/net/pcnet-pci.c +1 -5
index 49d3e42e83..aba8f19048 100644

Lines of this file are not shown. View the raw message.

hw/net/rocker/rocker.c +1 -5
index 15d66f6cbc..9b5d972d1c 100644

Lines of this file are not shown. View the raw message.

hw/net/rtl8139.c +1 -5
index ab93d78ab3..c6e9207f74 100644

Lines of this file are not shown. View the raw message.

hw/net/smc91c111.c +1 -5
index a347b6a4d5..bf7e3e6830 100644

Lines of this file are not shown. View the raw message.

hw/net/spapr_llan.c +1 -1
index 4cd02dda01..a6139568bb 100644

Lines of this file are not shown. View the raw message.

hw/net/stellaris_enet.c +1 -5
index cb6e2509ea..87399c89b6 100644

Lines of this file are not shown. View the raw message.

hw/net/sungem.c +1 -5
index e4b7b57704..4c9e2bbda5 100644

Lines of this file are not shown. View the raw message.

hw/net/sunhme.c +1 -5
index bc48d46b9f..6c38d3d5c6 100644

Lines of this file are not shown. View the raw message.

hw/net/tulip.c +1 -5
index ca69f7ea5e..21f9a18655 100644

Lines of this file are not shown. View the raw message.

hw/net/virtio-net.c +1 -5
index a1fe9e9285..1c0c9184ef 100644

Lines of this file are not shown. View the raw message.

hw/net/vmxnet3.c +1 -1
index 7a6ca4ec35..b484a2faf2 100644

Lines of this file are not shown. View the raw message.

hw/net/xgmac.c +1 -5
index 5bf1b61012..00f71dc951 100644

Lines of this file are not shown. View the raw message.

hw/net/xilinx_axienet.c +3 -7
index 1e48eb70c9..9711a1dd8e 100644

Lines of this file are not shown. View the raw message.

hw/net/xilinx_ethlite.c +1 -5
index 71d16fef3d..735236cb0d 100644

Lines of this file are not shown. View the raw message.

hw/nubus/mac-nubus-bridge.c +1 -5
index 7c329300b8..42e32ff107 100644

Lines of this file are not shown. View the raw message.

hw/nubus/nubus-bridge.c +1 -5
index cd8c6a91eb..678da60ddd 100644

Lines of this file are not shown. View the raw message.

hw/nubus/nubus-bus.c +1 -5
index 942a6d5342..0b44ce3c34 100644

Lines of this file are not shown. View the raw message.

hw/nubus/nubus-device.c +1 -5
index ffe78a8823..5a2f5a55d5 100644

Lines of this file are not shown. View the raw message.

hw/nvram/ds1225y.c +1 -5
index d5cb922287..6daef757aa 100644

Lines of this file are not shown. View the raw message.

hw/nvram/eeprom_at24c.c +1 -5
index d46a2bec3f..95582d67a7 100644

Lines of this file are not shown. View the raw message.

hw/nvram/fw_cfg.c +4 -8
index f3a4728288..0615197196 100644

Lines of this file are not shown. View the raw message.

hw/nvram/mac_nvram.c +1 -5
index beec1c4e4d..4ab7b31761 100644

Lines of this file are not shown. View the raw message.

hw/nvram/nrf51_nvm.c +1 -5
index f2283c1a8d..c410a4c483 100644

Lines of this file are not shown. View the raw message.

hw/nvram/spapr_nvram.c +1 -5
index 15d08281d4..f2b095480b 100644

Lines of this file are not shown. View the raw message.

hw/pci-bridge/dec.c +3 -7
index 677a310b96..b36e7f90a3 100644

Lines of this file are not shown. View the raw message.

hw/pci-bridge/i82801b11.c +1 -5
index 2b3907655b..1ff0c82142 100644

Lines of this file are not shown. View the raw message.

hw/pci-bridge/ioh3420.c +1 -5
index f1e16135a3..c16bb0aafc 100644

Lines of this file are not shown. View the raw message.

hw/pci-bridge/pci_bridge_dev.c +2 -6
index 4a080b7c7b..d080a0ca18 100644

Lines of this file are not shown. View the raw message.

hw/pci-bridge/pci_expander_bridge.c +5 -9
index 22f9fc223b..4c19a5051b 100644

Lines of this file are not shown. View the raw message.

hw/pci-bridge/pcie_pci_bridge.c +1 -5
index eade133968..00b30b2a4b 100644

Lines of this file are not shown. View the raw message.

hw/pci-bridge/pcie_root_port.c +1 -5
index f1cfe9d14a..b48d4b0ef1 100644

Lines of this file are not shown. View the raw message.

hw/pci-bridge/simba.c +1 -5
index ba55ab1939..c2783b3c0e 100644

Lines of this file are not shown. View the raw message.

hw/pci-bridge/xio3130_downstream.c +1 -5
index 04aae72cd6..1ff57a0358 100644

Lines of this file are not shown. View the raw message.

hw/pci-bridge/xio3130_upstream.c +1 -5
index 5cd3af4fbc..4fe1695278 100644

Lines of this file are not shown. View the raw message.

hw/pci-host/bonito.c +2 -6
index 1405b3fc70..ea7e30155c 100644

Lines of this file are not shown. View the raw message.

hw/pci-host/designware.c +2 -6
index 8492c18991..d96f3a3a3a 100644

Lines of this file are not shown. View the raw message.

hw/pci-host/gpex.c +2 -6
index 2bdbe7b456..fa1d12744e 100644

Lines of this file are not shown. View the raw message.

hw/pci-host/grackle.c +2 -6
index 4b3af0c704..066dc773e2 100644

Lines of this file are not shown. View the raw message.

hw/pci-host/i440fx.c +2 -6
index 8ed2417f0c..56ac1089b6 100644

Lines of this file are not shown. View the raw message.

hw/pci-host/pnv_phb3.c +4 -8
index 82132c12ca..171e4e1c71 100644

Lines of this file are not shown. View the raw message.

hw/pci-host/pnv_phb3_msi.c +1 -5
index 099d2092a2..a57a34c405 100644

Lines of this file are not shown. View the raw message.

hw/pci-host/pnv_phb3_pbcq.c +1 -5
index a0526aa1ec..edb7eb1f70 100644

Lines of this file are not shown. View the raw message.

hw/pci-host/pnv_phb4.c +4 -8
index 75ad766fe0..6e8c45e200 100644

Lines of this file are not shown. View the raw message.

hw/pci-host/pnv_phb4_pec.c +2 -6
index 741ddc90ed..dcbbce0d20 100644

Lines of this file are not shown. View the raw message.

hw/pci-host/ppce500.c +2 -6
index d71072731d..c2a8527521 100644

Lines of this file are not shown. View the raw message.

hw/pci-host/prep.c +2 -6
index 4b93fd2b01..5de4ab83f9 100644

Lines of this file are not shown. View the raw message.

hw/pci-host/q35.c +2 -6
index b67cb9c29f..df0e50d1b9 100644

Lines of this file are not shown. View the raw message.

hw/pci-host/sabre.c +2 -6
index 0cc68585f8..5a67f55a11 100644

Lines of this file are not shown. View the raw message.

hw/pci-host/uninorth.c +9 -9
index 1ed1072eeb..b1aa37101b 100644

Lines of this file are not shown. View the raw message.

hw/pci-host/versatile.c +3 -7
index 7e4aa467a2..fd71ae8d19 100644

Lines of this file are not shown. View the raw message.

hw/pci-host/xen_igd_pt.c +1 -5
index d094b675d6..27e2e475c6 100644

Lines of this file are not shown. View the raw message.

hw/pci-host/xilinx-pcie.c +2 -6
index 3b321421b6..896a0d7b22 100644

Lines of this file are not shown. View the raw message.

hw/pci/pci.c +5 -9
index de0fae10ab..938a307b86 100644

Lines of this file are not shown. View the raw message.

hw/pci/pci_bridge.c +1 -5
index 3789c17edc..622779a55c 100644

Lines of this file are not shown. View the raw message.

hw/pci/pci_host.c +1 -5
index 8ca5fadcbd..9348314164 100644

Lines of this file are not shown. View the raw message.

hw/pci/pcie_host.c +1 -5
index 3534006f99..5f0136694b 100644

Lines of this file are not shown. View the raw message.

hw/pci/pcie_port.c +2 -6
index eb563ad435..dee5065217 100644

Lines of this file are not shown. View the raw message.

hw/pcmcia/pcmcia.c +1 -5
index 03d13e7d67..c53a1ab47e 100644

Lines of this file are not shown. View the raw message.

hw/pcmcia/pxa2xx.c +1 -5
index 5f4bf22a90..73b1ae6d70 100644

Lines of this file are not shown. View the raw message.

hw/ppc/e500.c +2 -6
index ab9884e315..2ddc55e5c5 100644

Lines of this file are not shown. View the raw message.

hw/ppc/e500plat.c +1 -5
index bddd5e7c48..711c2f04eb 100644

Lines of this file are not shown. View the raw message.

hw/ppc/mac_newworld.c +1 -5
index e42bd7a626..0ce36a743f 100644

Lines of this file are not shown. View the raw message.

hw/ppc/mac_oldworld.c +1 -5
index 7aba040f1b..55e17988ca 100644

Lines of this file are not shown. View the raw message.

hw/ppc/mpc8544_guts.c +1 -5
index b96ea36f98..3a2a6f5f5d 100644

Lines of this file are not shown. View the raw message.

hw/ppc/mpc8544ds.c +1 -5
index 81177505f0..c9a0d0069d 100644

Lines of this file are not shown. View the raw message.

hw/ppc/pnv_core.c +1 -5
index 4724ddf96c..06fbe76c5c 100644

Lines of this file are not shown. View the raw message.

hw/ppc/pnv_homer.c +3 -7
index 9a262629b7..08d2d36722 100644

Lines of this file are not shown. View the raw message.

hw/ppc/pnv_lpc.c +4 -8
index b5ffa48dac..d6fe6d1d25 100644

Lines of this file are not shown. View the raw message.

hw/ppc/pnv_occ.c +3 -7
index 5a716c256e..9fde6cde7d 100644

Lines of this file are not shown. View the raw message.

hw/ppc/pnv_pnor.c +1 -5
index c365ee58b8..ab549a50ad 100644

Lines of this file are not shown. View the raw message.

hw/ppc/pnv_psi.c +4 -8
index 6a479cac53..80e5d5b7b1 100644

Lines of this file are not shown. View the raw message.

hw/ppc/pnv_xscom.c +1 -5
index b681c72575..74f1e042c6 100644

Lines of this file are not shown. View the raw message.

hw/ppc/ppc405_boards.c +2 -6
index 6198ec1035..d86f8c5f11 100644

Lines of this file are not shown. View the raw message.

hw/ppc/ppc440_pcix.c +1 -5
index 2ee2d4f4fc..37feaa2f06 100644

Lines of this file are not shown. View the raw message.

hw/ppc/ppc440_uc.c +1 -5
index 38fc392438..c1167aa6da 100644

Lines of this file are not shown. View the raw message.

hw/ppc/ppc4xx_pci.c +2 -6
index 3ea47df71f..b22df26c70 100644

Lines of this file are not shown. View the raw message.

hw/ppc/ppce500_spin.c +1 -5
index 66c1065db2..a5d13ec583 100644

Lines of this file are not shown. View the raw message.

hw/ppc/prep_systemio.c +1 -5
index bbc51b6e9a..c326518509 100644

Lines of this file are not shown. View the raw message.

hw/ppc/rs6000_mc.c +1 -5
index ce97365f5e..a5c32c8ed5 100644

Lines of this file are not shown. View the raw message.

hw/ppc/spapr.c +1 -5
index 0ae293ec94..0b5439902f 100644

Lines of this file are not shown. View the raw message.

hw/ppc/spapr_drc.c +8 -8
index fe998d8108..2c058a1eb2 100644

Lines of this file are not shown. View the raw message.

hw/ppc/spapr_iommu.c +2 -6
index 0fecabc135..eb21773d69 100644

Lines of this file are not shown. View the raw message.

hw/ppc/spapr_irq.c +1 -5
index 2f8f7d62f8..e6066b39c0 100644

Lines of this file are not shown. View the raw message.

hw/ppc/spapr_pci.c +1 -5
index 363cdb3f7b..7ae68dbf10 100644

Lines of this file are not shown. View the raw message.

hw/ppc/spapr_rng.c +1 -5
index 85bf64d68e..f25a10d26a 100644

Lines of this file are not shown. View the raw message.

hw/ppc/spapr_rtc.c +1 -5
index 68cfc578a3..4761bc4c76 100644

Lines of this file are not shown. View the raw message.

hw/ppc/spapr_tpm_proxy.c +1 -1
index a01f81f9e0..a6e4d61cfb 100644

Lines of this file are not shown. View the raw message.

hw/ppc/spapr_vio.c +3 -7
index 731080d989..387f7f196c 100644

Lines of this file are not shown. View the raw message.

hw/rdma/rdma.c +1 -5
index 7bec0d0d2c..969d21fa4d 100644

Lines of this file are not shown. View the raw message.

hw/rdma/vmw/pvrdma_main.c +1 -5
index 3254aadb6e..0f62d73f82 100644

Lines of this file are not shown. View the raw message.

hw/riscv/opentitan.c +1 -5
index 23ba3b4bfc..818764aa03 100644

Lines of this file are not shown. View the raw message.

hw/riscv/riscv_hart.c +1 -5
index f59fe52f0f..d2ce03c4e6 100644

Lines of this file are not shown. View the raw message.

hw/riscv/sifive_clint.c +1 -5
index 669c21adc2..456a722de5 100644

Lines of this file are not shown. View the raw message.

hw/riscv/sifive_e.c +2 -10
index 88b4524117..5750936ed1 100644

Lines of this file are not shown. View the raw message.

hw/riscv/sifive_e_prci.c +1 -5
index 17dfa74715..c32f469876 100644

Lines of this file are not shown. View the raw message.

hw/riscv/sifive_gpio.c +1 -5
index aac6b44cac..25a47c7531 100644

Lines of this file are not shown. View the raw message.

hw/riscv/sifive_plic.c +1 -5
index c20c192034..7235e13ebd 100644

Lines of this file are not shown. View the raw message.

hw/riscv/sifive_test.c +1 -5
index 0c78fb2c93..d3c646cb69 100644

Lines of this file are not shown. View the raw message.

hw/riscv/sifive_u.c +2 -10
index 0dfbcb5160..201950933a 100644

Lines of this file are not shown. View the raw message.

hw/riscv/sifive_u_otp.c +1 -5
index f6ecbaa2ca..145f98c25d 100644

Lines of this file are not shown. View the raw message.

hw/riscv/sifive_u_prci.c +1 -5
index 4fa590c064..ebddf9c568 100644

Lines of this file are not shown. View the raw message.

hw/riscv/virt.c +1 -5
index 55a907bb35..9c72ae7e25 100644

Lines of this file are not shown. View the raw message.

hw/rtc/allwinner-rtc.c +4 -8
index 5606a51d5c..0b07c24043 100644

Lines of this file are not shown. View the raw message.

hw/rtc/aspeed_rtc.c +1 -5
index 3ca1183558..e9d217d66b 100644

Lines of this file are not shown. View the raw message.

hw/rtc/ds1338.c +1 -5
index 588a9ba9be..985d07f8f1 100644

Lines of this file are not shown. View the raw message.

hw/rtc/exynos4210_rtc.c +1 -5
index f85483a07f..375f682f5d 100644

Lines of this file are not shown. View the raw message.

hw/rtc/goldfish_rtc.c +1 -5
index 6ddd45cce0..1473761de1 100644

Lines of this file are not shown. View the raw message.

hw/rtc/m41t80.c +1 -5
index 914ecac8f4..8b44b70eba 100644

Lines of this file are not shown. View the raw message.

hw/rtc/m48t59-isa.c +1 -1
index 50430b7a85..6e72e132e4 100644

Lines of this file are not shown. View the raw message.

hw/rtc/m48t59.c +2 -2
index b428a06045..1057e225d0 100644

Lines of this file are not shown. View the raw message.

hw/rtc/mc146818rtc.c +1 -5
index 7a38540cb9..336ebe03ff 100644

Lines of this file are not shown. View the raw message.

hw/rtc/pl031.c +1 -5
index ae47f09635..9c702916ee 100644

Lines of this file are not shown. View the raw message.

hw/rtc/sun4v-rtc.c +1 -5
index 52caea8654..8e242e8416 100644

Lines of this file are not shown. View the raw message.

hw/rtc/twl92230.c +1 -5
index d0011be89e..782d77d6fc 100644

Lines of this file are not shown. View the raw message.

hw/rtc/xlnx-zynqmp-rtc.c +1 -5
index 2bcd14d779..5d130d4d6c 100644

Lines of this file are not shown. View the raw message.

hw/s390x/3270-ccw.c +1 -5
index 821319eee6..9acbf36920 100644

Lines of this file are not shown. View the raw message.

hw/s390x/ap-bridge.c +2 -6
index 8bcf8ece9d..e6e1ff3310 100644

Lines of this file are not shown. View the raw message.

hw/s390x/ap-device.c +1 -5
index fc0b41e937..0e82d9918c 100644

Lines of this file are not shown. View the raw message.

hw/s390x/ccw-device.c +1 -5
index c9707110e9..7484c2a5ca 100644

Lines of this file are not shown. View the raw message.

hw/s390x/css-bridge.c +2 -6
index 9d793d671e..2ebb07a181 100644

Lines of this file are not shown. View the raw message.

hw/s390x/event-facility.c +3 -7
index 645b4080c5..60b28fa720 100644

Lines of this file are not shown. View the raw message.

hw/s390x/ipl.c +1 -5
index 3d2652d75a..89e89acd79 100644

Lines of this file are not shown. View the raw message.

hw/s390x/s390-ccw.c +1 -5
index b497571863..24edbfcd2f 100644

Lines of this file are not shown. View the raw message.

hw/s390x/s390-pci-bus.c +5 -9
index 92146a2119..d4ca1c3c20 100644

Lines of this file are not shown. View the raw message.

hw/s390x/s390-skeys-kvm.c +1 -5
index 1c4d805ad8..eed05d265e 100644

Lines of this file are not shown. View the raw message.

hw/s390x/s390-skeys.c +2 -6
index db2f49cb27..0ac3b29520 100644

Lines of this file are not shown. View the raw message.

hw/s390x/s390-stattrib-kvm.c +1 -5
index f89d8d9d16..d9eadfd8f7 100644

Lines of this file are not shown. View the raw message.

hw/s390x/s390-stattrib.c +2 -6
index 4441e1d331..394072e898 100644

Lines of this file are not shown. View the raw message.

hw/s390x/s390-virtio-ccw.c +1 -5
index e72c61d2ea..820d8cb279 100644

Lines of this file are not shown. View the raw message.

hw/s390x/sclp.c +1 -5
index a0ce444b4b..35bc750d31 100644

Lines of this file are not shown. View the raw message.

hw/s390x/sclpcpu.c +1 -5
index 62806d3273..dd38d7ea4f 100644

Lines of this file are not shown. View the raw message.

hw/s390x/sclpquiesce.c +1 -5
index ce07b16884..5ec767f5bc 100644

Lines of this file are not shown. View the raw message.

hw/s390x/tod-kvm.c +1 -5
index 6e21d83181..ce17950f2f 100644

Lines of this file are not shown. View the raw message.

hw/s390x/tod-qemu.c +1 -5
index e91b9590f5..bdc900be3c 100644

Lines of this file are not shown. View the raw message.

hw/s390x/tod.c +1 -5
index 3c2979175e..7b3b0b3205 100644

Lines of this file are not shown. View the raw message.

hw/s390x/vhost-vsock-ccw.c +1 -5
index 0822ecca89..f30409bc19 100644

Lines of this file are not shown. View the raw message.

hw/s390x/virtio-ccw-9p.c +1 -5
index 88c8884fc5..dd8c451cc5 100644

Lines of this file are not shown. View the raw message.

hw/s390x/virtio-ccw-balloon.c +1 -5
index 4c7631a433..5e3acd91b2 100644

Lines of this file are not shown. View the raw message.

hw/s390x/virtio-ccw-blk.c +1 -5
index 2294ce1ce4..25cc528f34 100644

Lines of this file are not shown. View the raw message.

hw/s390x/virtio-ccw-crypto.c +1 -5
index 358c74fb4b..65e6ac1cf5 100644

Lines of this file are not shown. View the raw message.

hw/s390x/virtio-ccw-gpu.c +1 -5
index c301e2586b..de63cb04e9 100644

Lines of this file are not shown. View the raw message.

hw/s390x/virtio-ccw-input.c +5 -9
index 5601e25dee..42528ebd8a 100644

Lines of this file are not shown. View the raw message.

hw/s390x/virtio-ccw-net.c +1 -5
index 3860d4e6ea..00bd695a9c 100644

Lines of this file are not shown. View the raw message.

hw/s390x/virtio-ccw-rng.c +1 -5
index 2e3a9da5e8..98cdba0d26 100644

Lines of this file are not shown. View the raw message.

hw/s390x/virtio-ccw-scsi.c +2 -2
index 6e4beef700..3ec7a35e53 100644

Lines of this file are not shown. View the raw message.

hw/s390x/virtio-ccw-serial.c +1 -5
index 61958228d1..c821eb57b3 100644

Lines of this file are not shown. View the raw message.

hw/s390x/virtio-ccw.c +2 -6
index 0e60270297..666e9768ed 100644

Lines of this file are not shown. View the raw message.

hw/scsi/esp-pci.c +2 -6
index 497a8d5901..0fa2e1cc45 100644

Lines of this file are not shown. View the raw message.

hw/scsi/esp.c +1 -5
index 405f8b7cbc..735529089d 100644

Lines of this file are not shown. View the raw message.

hw/scsi/lsi53c895a.c +2 -6
index 63ff4181de..4c02f32182 100644

Lines of this file are not shown. View the raw message.

hw/scsi/megasas.c +1 -1
index 390c2f2edb..eda0c22f03 100644

Lines of this file are not shown. View the raw message.

hw/scsi/scsi-bus.c +2 -6
index df65cc2223..06eccf3239 100644

Lines of this file are not shown. View the raw message.

hw/scsi/scsi-disk.c +5 -5
index 8ce68a9dd6..f0777dd4ee 100644

Lines of this file are not shown. View the raw message.

hw/scsi/scsi-generic.c +1 -5
index 86ed0a3822..dc7ca649de 100644

Lines of this file are not shown. View the raw message.

hw/scsi/spapr_vscsi.c +1 -5
index d17dc03c73..10c64396d6 100644

Lines of this file are not shown. View the raw message.

hw/scsi/vhost-scsi-common.c +1 -5
index 8ec49d7fef..cd025155e8 100644

Lines of this file are not shown. View the raw message.

hw/scsi/vhost-scsi.c +1 -5
index 13b05af29b..2341e62744 100644

Lines of this file are not shown. View the raw message.

hw/scsi/vhost-user-scsi.c +1 -5
index f2e524438a..ef8f8f05d9 100644

Lines of this file are not shown. View the raw message.

hw/scsi/virtio-scsi.c +2 -6
index b49775269e..f8af093d88 100644

Lines of this file are not shown. View the raw message.

hw/scsi/vmw_pvscsi.c +1 -6
index c071e0c7aa..796dbc14d6 100644

Lines of this file are not shown. View the raw message.

hw/sd/allwinner-sdhost.c +4 -8
index f404e1fdb4..980015cf94 100644

Lines of this file are not shown. View the raw message.

hw/sd/aspeed_sdhci.c +1 -5
index 22cafce0fb..fe080b9465 100644

Lines of this file are not shown. View the raw message.

hw/sd/bcm2835_sdhost.c +2 -6
index 4a80fbcc86..ab912fc45b 100644

Lines of this file are not shown. View the raw message.

hw/sd/core.c +1 -5
index abec48bccb..5992760093 100644

Lines of this file are not shown. View the raw message.

hw/sd/milkymist-memcard.c +1 -5
index 11f61294fc..64a369a04b 100644

Lines of this file are not shown. View the raw message.

hw/sd/pl181.c +1 -5
index 2b3776a6a0..f937bb1add 100644

Lines of this file are not shown. View the raw message.

hw/sd/pxa2xx_mmci.c +2 -6
index 68bed24480..7ff7e9b311 100644

Lines of this file are not shown. View the raw message.

hw/sd/sd.c +1 -5
index fad9cf1ee7..0b17afa46d 100644

Lines of this file are not shown. View the raw message.

hw/sd/sdhci-pci.c +1 -5
index c737c8b930..5d6f7ce25f 100644

Lines of this file are not shown. View the raw message.

hw/sd/sdhci.c +4 -8
index deac181865..7902b8c12d 100644

Lines of this file are not shown. View the raw message.

hw/sd/ssi-sd.c +1 -5
index 9210ef567f..70b864366b 100644

Lines of this file are not shown. View the raw message.

hw/sh4/sh_pci.c +2 -6
index 0a3e86f949..b6f5a54781 100644

Lines of this file are not shown. View the raw message.

hw/sparc/sun4m.c +14 -14
index 9be930415f..d53a0faf82 100644

Lines of this file are not shown. View the raw message.

hw/sparc/sun4m_iommu.c +2 -6
index 71f5465249..ce19fe0488 100644

Lines of this file are not shown. View the raw message.

hw/sparc64/niagara.c +1 -5
index a87d55f6bb..706bbafc38 100644

Lines of this file are not shown. View the raw message.

hw/sparc64/sun4u.c +6 -6
index 9e30203dcc..73e6b0eed6 100644

Lines of this file are not shown. View the raw message.

hw/sparc64/sun4u_iommu.c +2 -6
index 9178277f82..25ed3d51c6 100644

Lines of this file are not shown. View the raw message.

hw/ssi/aspeed_smc.c +1 -1
index 4fab1f5f85..a1f08cb7ee 100644

Lines of this file are not shown. View the raw message.

hw/ssi/imx_spi.c +1 -5
index 7f703d8328..0d888b0ae5 100644

Lines of this file are not shown. View the raw message.

hw/ssi/mss-spi.c +1 -5
index b2432c5a13..d49e79ac79 100644

Lines of this file are not shown. View the raw message.

hw/ssi/pl022.c +1 -5
index cade2e92a8..e8705c470c 100644

Lines of this file are not shown. View the raw message.

hw/ssi/ssi.c +2 -6
index a35d7ebb26..9461e57b8b 100644

Lines of this file are not shown. View the raw message.

hw/ssi/stm32f2xx_spi.c +1 -5
index cd6e8443db..7080454ce4 100644

Lines of this file are not shown. View the raw message.

hw/ssi/xilinx_spi.c +1 -5
index 80d1488dc7..4f6f50e313 100644

Lines of this file are not shown. View the raw message.

hw/ssi/xilinx_spips.c +3 -7
index b9371dbf8d..fbae9bc013 100644

Lines of this file are not shown. View the raw message.

hw/timer/a9gtimer.c +1 -5
index 7233068a37..27d99c74b4 100644

Lines of this file are not shown. View the raw message.

hw/timer/allwinner-a10-pit.c +1 -5
index f84fc0ea25..fcd3176656 100644

Lines of this file are not shown. View the raw message.

hw/timer/altera_timer.c +1 -5
index be81b7a518..922b14c335 100644

Lines of this file are not shown. View the raw message.

hw/timer/arm_mptimer.c +1 -5
index cdfca3000b..9d37535bc2 100644

Lines of this file are not shown. View the raw message.

hw/timer/arm_timer.c +2 -6
index 9607366d78..664c2d9bfc 100644

Lines of this file are not shown. View the raw message.

hw/timer/armv7m_systick.c +1 -5
index 74c58bcf24..9fc69a0e90 100644

Lines of this file are not shown. View the raw message.

hw/timer/aspeed_timer.c +4 -8
index 42c47d2ce6..ca7a10dc33 100644

Lines of this file are not shown. View the raw message.

hw/timer/avr_timer16.c +1 -5
index c48555da52..dfd940a0c5 100644

Lines of this file are not shown. View the raw message.

hw/timer/bcm2835_systmr.c +1 -5
index 3387a6214a..28a0c16637 100644

Lines of this file are not shown. View the raw message.

hw/timer/cadence_ttc.c +1 -5
index b0ba6b2bba..9ab120cf9c 100644

Lines of this file are not shown. View the raw message.

hw/timer/cmsdk-apb-dualtimer.c +1 -5
index f6534241b9..57f959a040 100644

Lines of this file are not shown. View the raw message.

hw/timer/cmsdk-apb-timer.c +1 -5
index f85f1309f3..570e9beb29 100644

Lines of this file are not shown. View the raw message.

hw/timer/digic-timer.c +1 -5
index 32612228da..6300add9d4 100644

Lines of this file are not shown. View the raw message.

hw/timer/etraxfs_timer.c +1 -5
index afe3d30a8e..77767a1beb 100644

Lines of this file are not shown. View the raw message.

hw/timer/exynos4210_mct.c +1 -5
index 29a4b10676..077c820f3b 100644

Lines of this file are not shown. View the raw message.

hw/timer/exynos4210_pwm.c +1 -5
index 59a8c08db0..c71063f6b0 100644

Lines of this file are not shown. View the raw message.

hw/timer/grlib_gptimer.c +1 -5
index eff0ee3491..d5bf6cb1f7 100644

Lines of this file are not shown. View the raw message.

hw/timer/hpet.c +1 -5
index 380acfa7c8..37f02c3c34 100644

Lines of this file are not shown. View the raw message.

hw/timer/i8254.c +1 -5
index 29f62e5356..f20d3d53e2 100644

Lines of this file are not shown. View the raw message.

hw/timer/i8254_common.c +1 -5
index 050875b497..dc8536f392 100644

Lines of this file are not shown. View the raw message.

hw/timer/imx_epit.c +1 -5
index ebd58254d1..a13cca7c4e 100644

Lines of this file are not shown. View the raw message.

hw/timer/imx_gpt.c +4 -8
index 5c0d9a269c..8d6805b464 100644

Lines of this file are not shown. View the raw message.

hw/timer/lm32_timer.c +1 -5
index f703f407f5..929e8fee10 100644

Lines of this file are not shown. View the raw message.

hw/timer/milkymist-sysctl.c +1 -5
index 94389820b2..0e3787546a 100644

Lines of this file are not shown. View the raw message.

hw/timer/mss-timer.c +1 -5
index 29943fd744..38976a4bca 100644

Lines of this file are not shown. View the raw message.

hw/timer/nrf51_timer.c +1 -5
index 42be79c736..4cabc7e7d2 100644

Lines of this file are not shown. View the raw message.

hw/timer/puv3_ost.c +1 -5
index f76b0bb1ca..a9fff5b89f 100644

Lines of this file are not shown. View the raw message.

hw/timer/pxa2xx_timer.c +3 -7
index 944c165889..46a315e6db 100644

Lines of this file are not shown. View the raw message.

hw/timer/renesas_cmt.c +1 -5
index 2e0fd21a36..92934f5cc5 100644

Lines of this file are not shown. View the raw message.

hw/timer/renesas_tmr.c +1 -5
index 446f2eacdd..5be0c71497 100644

Lines of this file are not shown. View the raw message.

hw/timer/slavio_timer.c +1 -5
index 4c5d65e391..36734c07e6 100644

Lines of this file are not shown. View the raw message.

hw/timer/stm32f2xx_timer.c +1 -5
index ba8694dcd3..6cc466f2f3 100644

Lines of this file are not shown. View the raw message.

hw/timer/xilinx_timer.c +1 -5
index 0190aa47d0..f14d4c14bb 100644

Lines of this file are not shown. View the raw message.

hw/tpm/tpm_crb.c +1 -5
index 60247295d4..788d05adc5 100644

Lines of this file are not shown. View the raw message.

hw/tpm/tpm_spapr.c +1 -5
index 8288ab0a15..7f83a8b3b2 100644

Lines of this file are not shown. View the raw message.

hw/tpm/tpm_tis_isa.c +1 -5
index 5faf6231c0..3bb4ec10fa 100644

Lines of this file are not shown. View the raw message.

hw/tpm/tpm_tis_sysbus.c +1 -5
index 4a3bc70625..2a63c68f22 100644

Lines of this file are not shown. View the raw message.

hw/usb/bus.c +2 -6
index b17bda3b29..75c5dd5d27 100644

Lines of this file are not shown. View the raw message.

hw/usb/ccid-card-emulated.c +1 -5
index 7d6105ef34..e4647413c6 100644

Lines of this file are not shown. View the raw message.

hw/usb/ccid-card-passthru.c +1 -5
index bb325dbc4a..4a53ab2742 100644

Lines of this file are not shown. View the raw message.

hw/usb/chipidea.c +1 -5
index 3dcd22ccba..ebf45f9a9c 100644

Lines of this file are not shown. View the raw message.

hw/usb/dev-audio.c +1 -1
index 1371c44f48..eaef43d2b9 100644

Lines of this file are not shown. View the raw message.

hw/usb/dev-hid.c +4 -4
index 89f63b698b..30aff4499f 100644

Lines of this file are not shown. View the raw message.

hw/usb/dev-hub.c +1 -5
index 5f19dd9fb5..f4193dfe85 100644

Lines of this file are not shown. View the raw message.

hw/usb/dev-mtp.c +1 -5
index 15a2243101..2e42a799eb 100644

Lines of this file are not shown. View the raw message.

hw/usb/dev-network.c +1 -5
index c69756709b..e5eb181d9e 100644

Lines of this file are not shown. View the raw message.

hw/usb/dev-serial.c +3 -3
index 7e50e3ba47..a6d85abd12 100644

Lines of this file are not shown. View the raw message.

hw/usb/dev-smartcard-reader.c +3 -3
index fcfe216594..a34aba700f 100644

Lines of this file are not shown. View the raw message.

hw/usb/dev-storage.c +3 -7
index 405a4ccfe7..1b1b42016b 100644

Lines of this file are not shown. View the raw message.

hw/usb/dev-uas.c +1 -5
index a3a4d41c07..57f38da477 100644

Lines of this file are not shown. View the raw message.

hw/usb/dev-wacom.c +1 -1
index 8aba44b8bc..cb8f156f8f 100644

Lines of this file are not shown. View the raw message.

hw/usb/hcd-dwc2.c +1 -5
index 97688d21bf..8a6b906e5f 100644

Lines of this file are not shown. View the raw message.

hw/usb/hcd-ehci-pci.c +1 -1
index 4c37c8e227..6c97b8ceea 100644

Lines of this file are not shown. View the raw message.

hw/usb/hcd-ehci-sysbus.c +7 -11
index 3730736540..7419494528 100644

Lines of this file are not shown. View the raw message.

hw/usb/hcd-ohci-pci.c +1 -5
index a7fb1666af..aa461de292 100644

Lines of this file are not shown. View the raw message.

hw/usb/hcd-ohci.c +1 -5
index 1e6e85e86a..d69956e998 100644

Lines of this file are not shown. View the raw message.

hw/usb/hcd-uhci.c +1 -1
index 37f7beb3fa..a30964ac2c 100644

Lines of this file are not shown. View the raw message.

hw/usb/hcd-xhci-nec.c +1 -5
index e6a5a22b6d..91e27b64e1 100644

Lines of this file are not shown. View the raw message.

hw/usb/hcd-xhci.c +2 -6
index 67a18fe2b6..7d2d8f854e 100644

Lines of this file are not shown. View the raw message.

hw/usb/host-libusb.c +1 -5
index c474551d84..89d313e7e1 100644

Lines of this file are not shown. View the raw message.

hw/usb/imx-usb-phy.c +1 -5
index e705a03a1f..59ed520aae 100644

Lines of this file are not shown. View the raw message.

hw/usb/redirect.c +1 -5
index 417a60a2e6..b5c1e656bd 100644

Lines of this file are not shown. View the raw message.

hw/usb/tusb6010.c +1 -5
index 27eb28d3e4..fc1263fcd0 100644

Lines of this file are not shown. View the raw message.

hw/vfio/amd-xgbe.c +1 -5
index 96bd608b8d..324fb4808e 100644

Lines of this file are not shown. View the raw message.

hw/vfio/ap.c +1 -5
index b9330a8e6f..a45da2aa82 100644

Lines of this file are not shown. View the raw message.

hw/vfio/calxeda-xgmac.c +1 -5
index 87c382e736..da37db3837 100644

Lines of this file are not shown. View the raw message.

hw/vfio/ccw.c +1 -5
index ff7f369779..96488335ed 100644

Lines of this file are not shown. View the raw message.

hw/vfio/igd.c +1 -5
index 64e332746b..5a2aa3c06d 100644

Lines of this file are not shown. View the raw message.

hw/vfio/pci.c +2 -6
index 2e561c06d6..8b7148daae 100644

Lines of this file are not shown. View the raw message.

hw/vfio/platform.c +1 -5
index ac2cefc9b1..16688f040f 100644

Lines of this file are not shown. View the raw message.

hw/virtio/vhost-user-fs.c +1 -5
index 1bc5d03a00..bc9165c2ad 100644

Lines of this file are not shown. View the raw message.

hw/virtio/vhost-user-vsock.c +1 -5
index 3534a39d62..0e8f403bd5 100644

Lines of this file are not shown. View the raw message.

hw/virtio/vhost-vsock-common.c +1 -5
index 5b2ebf3496..33c356e67a 100644

Lines of this file are not shown. View the raw message.

hw/virtio/vhost-vsock.c +1 -5
index c8f0699b4f..dde39257e4 100644

Lines of this file are not shown. View the raw message.

hw/virtio/virtio-balloon.c +1 -5
index 22cb5df717..070f3e8364 100644

Lines of this file are not shown. View the raw message.

hw/virtio/virtio-bus.c +1 -5
index d6332d45c3..29d49173bd 100644

Lines of this file are not shown. View the raw message.

hw/virtio/virtio-crypto.c +1 -5
index 6da12e315f..86c4076860 100644

Lines of this file are not shown. View the raw message.

hw/virtio/virtio-input-pci.c +2 -2
index 74651a42ea..29c633b3d8 100644

Lines of this file are not shown. View the raw message.

hw/virtio/virtio-iommu.c +2 -6
index 5d56865e56..ad7665dad3 100644

Lines of this file are not shown. View the raw message.

hw/virtio/virtio-mem.c +1 -5
index 7740fc613f..2d0fee731f 100644

Lines of this file are not shown. View the raw message.

hw/virtio/virtio-mmio.c +2 -6
index f12d1595aa..fddb3d8d15 100644

Lines of this file are not shown. View the raw message.

hw/virtio/virtio-pci.c +2 -2
index ccdf54e81c..a619acc264 100644

Lines of this file are not shown. View the raw message.

hw/virtio/virtio-pmem.c +1 -5
index 1e0c137497..f085a8687a 100644

Lines of this file are not shown. View the raw message.

hw/virtio/virtio-rng.c +1 -5
index 2886c0ce2a..0606aea8dc 100644

Lines of this file are not shown. View the raw message.

hw/virtio/virtio.c +1 -5
index e983025217..e3788a037b 100644

Lines of this file are not shown. View the raw message.

hw/watchdog/cmsdk-apb-watchdog.c +2 -6
index 5bbadadfa6..24cc0aa703 100644

Lines of this file are not shown. View the raw message.

hw/watchdog/wdt_aspeed.c +4 -4
index 6352ba1b0e..b8a5cb8a55 100644

Lines of this file are not shown. View the raw message.

hw/watchdog/wdt_diag288.c +1 -1
index 71a945f0bd..fb32d70be6 100644

Lines of this file are not shown. View the raw message.

hw/watchdog/wdt_i6300esb.c +1 -1
index 370cf92e85..989713fa4b 100644

Lines of this file are not shown. View the raw message.

hw/watchdog/wdt_ib700.c +1 -1
index 985944a84a..ead7d0dbbd 100644

Lines of this file are not shown. View the raw message.

hw/watchdog/wdt_imx2.c +1 -1
index a5fb76308f..0e71e54c02 100644

Lines of this file are not shown. View the raw message.

hw/xen/xen-bus.c +3 -7
index 9ce1c9540b..ff65360545 100644

Lines of this file are not shown. View the raw message.

hw/xen/xen-legacy-backend.c +3 -7
index b61a4855b7..2fdac398e1 100644

Lines of this file are not shown. View the raw message.

hw/xen/xen_pt.c +1 -5
index 6d359ee486..e6a860c76b 100644

Lines of this file are not shown. View the raw message.

hw/xtensa/xtfpga.c +8 -12
index 10de15855a..1a611e883b 100644

Lines of this file are not shown. View the raw message.

io/channel-buffer.c +1 -5
index 5402e0cced..efc86f94a6 100644

Lines of this file are not shown. View the raw message.

io/channel-command.c +1 -5
index 368dd62b7e..32382e2b91 100644

Lines of this file are not shown. View the raw message.

io/channel-file.c +1 -5
index dac21f6012..335773edf0 100644

Lines of this file are not shown. View the raw message.

io/channel-socket.c +1 -5
index e1b4667087..e91b6b9756 100644

Lines of this file are not shown. View the raw message.

io/channel-tls.c +1 -5
index 7ec8ceff2f..4c330ae540 100644

Lines of this file are not shown. View the raw message.

io/channel-websock.c +1 -5
index 47a0e941d9..4b6ee3ddb8 100644

Lines of this file are not shown. View the raw message.

io/channel.c +1 -5
index e4376eb0bc..236fa1e343 100644

Lines of this file are not shown. View the raw message.

io/dns-resolver.c +1 -5
index 6ebe2a5650..2c79ea8949 100644

Lines of this file are not shown. View the raw message.

io/net-listener.c +1 -5
index 5d8a226872..7b06b60ff0 100644

Lines of this file are not shown. View the raw message.

iothread.c +1 -5
index 263ec6e5bc..c94d139e16 100644

Lines of this file are not shown. View the raw message.

migration/migration.c +1 -5
index 8fe36339db..1847320bb9 100644

Lines of this file are not shown. View the raw message.

migration/rdma.c +1 -5
index bea6532813..15ad985d26 100644

Lines of this file are not shown. View the raw message.

net/can/can_core.c +1 -5
index 90f4d8576a..9e7228cb9d 100644

Lines of this file are not shown. View the raw message.

net/can/can_host.c +1 -5
index be4547d913..8b57a40de6 100644

Lines of this file are not shown. View the raw message.

net/can/can_socketcan.c +1 -5
index b7ef63ec0e..c083e92735 100644

Lines of this file are not shown. View the raw message.

net/colo-compare.c +1 -5
index 2c20de1537..b6f56fc915 100644

Lines of this file are not shown. View the raw message.

net/dump.c +1 -5
index 11a737a4bc..ec9f20bea5 100644

Lines of this file are not shown. View the raw message.

net/filter-buffer.c +1 -5
index dfa211794b..9a6b8132ea 100644

Lines of this file are not shown. View the raw message.

net/filter-mirror.c +2 -6
index e9379ce248..09cb97332d 100644

Lines of this file are not shown. View the raw message.

net/filter-replay.c +1 -5
index 9dda193928..9f95ee305b 100644

Lines of this file are not shown. View the raw message.

net/filter-rewriter.c +1 -5
index 1aaad101b6..891fa95264 100644

Lines of this file are not shown. View the raw message.

net/filter.c +1 -5
index eac8ba1e9c..8dd47bead0 100644

Lines of this file are not shown. View the raw message.

qom/container.c +1 -5
index 455e8410c6..4c0f5fcce3 100644

Lines of this file are not shown. View the raw message.

scsi/pr-manager-helper.c +1 -5
index 5acccfb4e3..466f11f4c8 100644

Lines of this file are not shown. View the raw message.

scsi/pr-manager.c +1 -6
index 32b9287e68..f95f658b1c 100644

Lines of this file are not shown. View the raw message.

softmmu/memory.c +2 -6
index af25987518..e572a5ede2 100644

Lines of this file are not shown. View the raw message.

target/arm/cpu.c +2 -2
index 111579554f..9b5f3ffcb1 100644

Lines of this file are not shown. View the raw message.

target/arm/cpu64.c +1 -1
index dd696183df..33a2fa6125 100644

Lines of this file are not shown. View the raw message.

target/hppa/cpu.c +1 -5
index 71b6aca45d..c04b9c814d 100644

Lines of this file are not shown. View the raw message.

target/i386/cpu.c +4 -4
index 588f32e136..ce20b0dff0 100644

Lines of this file are not shown. View the raw message.

target/i386/hax-all.c +1 -5
index c93bb23a44..377dfbf523 100644

Lines of this file are not shown. View the raw message.

target/i386/hvf/hvf.c +1 -5
index d81f569aed..b82253e1d3 100644

Lines of this file are not shown. View the raw message.

target/i386/sev.c +1 -6
index c3ecf86704..404762b68f 100644

Lines of this file are not shown. View the raw message.

target/i386/whpx-all.c +1 -5
index c78baac6df..64d8903e99 100644

Lines of this file are not shown. View the raw message.

target/microblaze/cpu.c +1 -5
index 51e5c85b10..4e62a7cbcd 100644

Lines of this file are not shown. View the raw message.

target/mips/cpu.c +1 -1
index e86cd06548..b4482a8594 100644

Lines of this file are not shown. View the raw message.

target/nios2/cpu.c +1 -5
index 8f7011fcb9..2b9385ee84 100644

Lines of this file are not shown. View the raw message.

target/ppc/translate_init.inc.c +2 -2
index 7e66822b5d..1cd3a7b6f8 100644

Lines of this file are not shown. View the raw message.

target/rx/cpu.c +2 -6
index 219e05397b..35672a9670 100644

Lines of this file are not shown. View the raw message.

target/s390x/cpu.c +1 -5
index 08eb674d22..bb48c652fa 100644

Lines of this file are not shown. View the raw message.

target/s390x/cpu_models.c +3 -3
index c2af226174..46aaad1f7e 100644

Lines of this file are not shown. View the raw message.

target/sparc/cpu.c +1 -1
index cf21efd85f..aed0cafb13 100644

Lines of this file are not shown. View the raw message.

target/tilegx/cpu.c +1 -5
index 1fee87c094..93070229de 100644

Lines of this file are not shown. View the raw message.

target/xtensa/cpu.c +1 -5
index 82c2ee0679..666b8050f7 100644

Lines of this file are not shown. View the raw message.

ui/console.c +1 -5
index 0579be792f..ae54bf6c1a 100644

Lines of this file are not shown. View the raw message.

ui/input-barrier.c +1 -5
index 1cdf0c5f82..2082f5dd1e 100644

Lines of this file are not shown. View the raw message.

ui/input-linux.c +1 -5
index 4925ce1af1..3709800898 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.26.2

Part of the diff is not shown here. View the raw message.