Re: [PATCH for-6.2 00/12] qom: Get rid of all manual usage of OBJECT_CHECK & friends

2021-08-09 Thread Eduardo Habkost
On Sat, Aug 07, 2021 at 10:15:52AM +0200, Philippe Mathieu-Daudé wrote:
> On 8/6/21 11:11 PM, Eduardo Habkost wrote:
> > This series gets rid of all manual usage of OBJECT_CHECK,
> > OBJECT_CLASS_CHECK, and OBJECT_GET_CLASS.
> > 
> > All type check macros defined manually are replaced with
> > DEFINE_*CHECKER* or OBJECT_DECLARE* macros.
> > 
> > All manual usage of OBJECT_CHECK/OBJECT_CLASS_CHECK/OBJECT_GET_CLASS
> > is manually replaced with the corresponding type-specific wrappers.
> 
> Is INTERFACE_CHECK already converted / in good shape?

Not yet.  I need to refresh my memory by looking at mailing list
archives, but I have a work in progress branch that I haven't
touched in a while (except for rebasing it) at:

https://gitlab.com/ehabkost/qemu/-/commits/work/qom-declare-interface-type/

Basically it introduces a DECLARE_INTERFACE_CHECKER macro instead
of reusing OBJECT_CHECK/DECLARE_INSTANCE_CHECKER.

-- 
Eduardo




Re: [PATCH for-6.2 00/12] qom: Get rid of all manual usage of OBJECT_CHECK & friends

2021-08-07 Thread Philippe Mathieu-Daudé
On 8/6/21 11:11 PM, Eduardo Habkost wrote:
> This series gets rid of all manual usage of OBJECT_CHECK,
> OBJECT_CLASS_CHECK, and OBJECT_GET_CLASS.
> 
> All type check macros defined manually are replaced with
> DEFINE_*CHECKER* or OBJECT_DECLARE* macros.
> 
> All manual usage of OBJECT_CHECK/OBJECT_CLASS_CHECK/OBJECT_GET_CLASS
> is manually replaced with the corresponding type-specific wrappers.

Is INTERFACE_CHECK already converted / in good shape?




[PATCH for-6.2 00/12] qom: Get rid of all manual usage of OBJECT_CHECK & friends

2021-08-06 Thread Eduardo Habkost
This series gets rid of all manual usage of OBJECT_CHECK,
OBJECT_CLASS_CHECK, and OBJECT_GET_CLASS.

All type check macros defined manually are replaced with
DEFINE_*CHECKER* or OBJECT_DECLARE* macros.

All manual usage of OBJECT_CHECK/OBJECT_CLASS_CHECK/OBJECT_GET_CLASS
is manually replaced with the corresponding type-specific wrappers.

For a git tree containing all dependencies, see:
  https://gitlab.com/ehabkost/qemu.git work/qom-automated-declare-type-pass2

This series is based on multiple other series I have submitted
recently, including:

  Date: Thu,  5 Aug 2021 15:34:25 -0400
  Subject: [PATCH for-6.2 0/6] qom: Fix broken OBJECT_CHECK usage
  Message-Id: <20210805193431.307761-1-ehabk...@redhat.com>
  https://lore.kernel.org/qemu-devel/20210805193431.307761-1-ehabk...@redhat.com

  Date: Thu,  5 Aug 2021 17:47:39 -0400
  Subject: [PATCH] bcm2836: Remove redundant typedef and macros
  Message-Id: <20210805214739.390613-1-ehabk...@redhat.com>
  https://lore.kernel.org/qemu-devel/20210805214739.390613-1-ehabk...@redhat.com

  Date: Thu,  5 Aug 2021 22:31:19 -0400
  Subject: [PATCH for-6.2] sbsa-ref: Rename SBSA_GWDT enum value
  Message-Id: <20210806023119.431680-1-ehabk...@redhat.com>
  https://lore.kernel.org/qemu-devel/20210806023119.431680-1-ehabk...@redhat.com

Based-on: <20210805193431.307761-1-ehabk...@redhat.com>
Based-on: <20210805214739.390613-1-ehabk...@redhat.com>
Based-on: <20210806023119.431680-1-ehabk...@redhat.com>

Eduardo Habkost (12):
  accel: Rename TYPE_ACCEL to TYPE_ACCEL_BASE
  qom: Use DEVICE_*CLASS instead of OBJECT_*CLASS
  scripts/codeconverter: Update to latest version
  [automated] Add struct names to typedefs used by QOM types
  [automated] Move QOM typedefs and add missing includes
  [automated] Split QOM "typedef struct T { ... } T" declarations
  [automated] Use DECLARE_*CHECKER* macros when possible
  npcm7xx_clk: Use DECLARE_INSTANCE_CHECKER
  npcm7xx_otp: Use DECLARE_CLASS_CHECKERS
  [automated] Use DECLARE_OBJ_CHECKERS when possible
  [automated] Use OBJECT_DECLARE_TYPE when possible
  [automated] Use OBJECT_DECLARE_SIMPLE_TYPE when possible

 hw/core/machine.c |   2 +-
 hw/nvme/nvme.h|  24 +-
 hw/usb/hcd-uhci.h |   6 +-
 hw/usb/hcd-xhci-pci.h |   8 +-
 hw/usb/hcd-xhci-sysbus.h  |   8 +-
 hw/usb/u2f.h  |  17 +-
 include/crypto/tlscreds.h |   5 +-
 include/hw/acpi/acpi_dev_interface.h  |   2 +-
 include/hw/adc/npcm7xx_adc.h  |   8 +-
 include/hw/arm/linux-boot-if.h|   2 +-
 include/hw/arm/npcm7xx.h  |  36 ++-
 include/hw/char/shakti_uart.h |   8 +-
 include/hw/core/accel-cpu.h   |   6 +-
 include/hw/dma/sifive_pdma.h  |   8 +-
 include/hw/dma/xlnx_csu_dma.h |   8 +-
 include/hw/fw-path-provider.h |   2 +-
 include/hw/gpio/npcm7xx_gpio.h|  10 +-
 include/hw/gpio/sifive_gpio.h |   4 +-
 include/hw/hotplug.h  |   2 +-
 include/hw/i2c/npcm7xx_smbus.h|  10 +-
 include/hw/intc/intc.h|   2 +-
 include/hw/intc/m68k_irqc.h   |   8 +-
 include/hw/intc/sifive_clint.h|   8 +-
 include/hw/intc/sifive_plic.h |   4 +-
 include/hw/ipmi/ipmi.h|   2 +-
 include/hw/mem/memory-device.h|   2 +-
 include/hw/mem/npcm7xx_mc.h   |   9 +-
 include/hw/misc/aspeed_lpc.h  |   7 +-
 include/hw/misc/bcm2835_cprman.h  |  21 +-
 include/hw/misc/bcm2835_cprman_internals.h|  13 +-
 include/hw/misc/led.h |   3 +-
 include/hw/misc/mchp_pfsoc_dmc.h  |  17 +-
 include/hw/misc/mchp_pfsoc_ioscb.h|   8 +-
 include/hw/misc/mchp_pfsoc_sysreg.h   |   9 +-
 include/hw/misc/npcm7xx_clk.h |  18 +-
 include/hw/misc/npcm7xx_gcr.h |   7 +-
 include/hw/misc/npcm7xx_mft.h |   7 +-
 include/hw/misc/npcm7xx_pwm.h |   4 +-
 include/hw/misc/npcm7xx_rng.h |   9 +-
 include/hw/misc/sifive_e_prci.h   |   4 +-
 include/hw/misc/sifive_test.h |   4 +-
 include/hw/misc/sifive_u_otp.h|   4 +-
 include/hw/misc/sifive_u_prci.h   |   4 +-
 include/hw/misc/xlnx-versal-xramc.h   |   8 +-
 include/hw/net/npcm7xx_emc.h  |   5 +-
 include/hw/net/xlnx-zynqmp-can.h  |   8 +-
 include/hw/nmi.h  |   2 +-
 include/hw/nvram/npcm7xx_otp.h|  12 +-
 include/hw/ppc/spapr_drc.h|  23 +-
 include/hw/ppc/spapr_xive.h   |  15 +-
 include/hw/ppc/vof.h  |   1 +