[PATCH v2 0/7] hw/sysbus: Add sysbus_init_irqs and reduce SYSBUS_DEVICE_GPIO_IRQ scope

Philippe Mathieu-Daudé posted 7 patches 10 months, 4 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20230601094625.39569-1-philmd@linaro.org
Maintainers: Eric Auger <eric.auger@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, Alistair Francis <alistair@alistair23.me>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Yoshinori Sato <ysato@users.sourceforge.jp>, Magnus Damm <magnus.damm@gmail.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Eduardo Habkost <eduardo@habkost.net>, Bin Meng <bin.meng@windriver.com>, Palmer Dabbelt <palmer@dabbelt.com>, David Woodhouse <dwmw2@infradead.org>, Paul Durrant <paul@xen.org>, "Michael S. Tsirkin" <mst@redhat.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Richard Henderson <richard.henderson@linaro.org>, Igor Mitsyanko <i.mitsyanko@gmail.com>, Xiaojuan Yang <yangxiaojuan@loongson.cn>, Song Gao <gaosong@loongson.cn>, Huacai Chen <chenhuacai@kernel.org>, Jiaxun Yang <jiaxun.yang@flygoat.com>, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, Michael Rolnik <mrolnik@gmail.com>, Jason Wang <jasowang@redhat.com>, Thomas Huth <huth@tuxfamily.org>, Andrey Smirnov <andrew.smirnov@gmail.com>, "Hervé Poussineau" <hpoussin@reactos.org>, Jean-Christophe Dubois <jcd@tribudubois.net>, Francisco Iglesias <francisco.iglesias@xilinx.com>, Beniamino Galvani <b.galvani@gmail.com>, Strahinja Jankovic <strahinja.p.jankovic@gmail.com>, Gerd Hoffmann <kraxel@redhat.com>
include/hw/sysbus.h           |  3 +--
hw/arm/smmuv3.c               |  6 +-----
hw/arm/stellaris.c            |  5 +----
hw/arm/strongarm.c            |  5 +----
hw/arm/versatilepb.c          |  5 +----
hw/arm/xlnx-versal.c          |  4 +---
hw/char/pl011.c               |  5 +----
hw/char/renesas_sci.c         |  5 +----
hw/core/platform-bus.c        |  5 +----
hw/core/sysbus.c              |  9 ++++++++-
hw/dma/pl330.c                |  4 +---
hw/dma/sifive_pdma.c          |  5 +----
hw/gpio/sifive_gpio.c         |  5 +----
hw/i386/kvm/xen_evtchn.c      |  5 +----
hw/intc/arm_gic_common.c      | 20 +++++---------------
hw/intc/arm_gicv2m.c          |  5 +----
hw/intc/exynos4210_combiner.c |  5 +----
hw/intc/loongarch_extioi.c    |  7 ++-----
hw/intc/loongson_liointc.c    |  5 +----
hw/intc/omap_intc.c           |  3 +--
hw/intc/openpic.c             |  6 ++----
hw/intc/slavio_intctl.c       |  6 ++----
hw/misc/avr_power.c           |  4 +---
hw/misc/macio/gpio.c          |  5 +----
hw/misc/stm32f4xx_exti.c      |  5 +----
hw/net/cadence_gem.c          |  5 +----
hw/net/mcf_fec.c              |  5 +----
hw/pci-host/designware.c      |  5 +----
hw/pci-host/gpex.c            |  2 +-
hw/pci-host/ppce500.c         |  4 +---
hw/pci-host/raven.c           |  4 +---
hw/pci-host/sh_pci.c          |  5 +----
hw/pci-host/versatile.c       |  4 +---
hw/ppc/ppc405_uc.c            | 10 ++--------
hw/ppc/ppc440_uc.c            |  6 ++----
hw/ppc/ppc4xx_devs.c          |  4 +---
hw/ppc/ppc4xx_pci.c           |  5 +----
hw/ssi/ibex_spi_host.c        |  5 +----
hw/ssi/imx_spi.c              |  5 +----
hw/ssi/sifive_spi.c           |  5 +----
hw/ssi/xilinx_spi.c           |  5 +----
hw/ssi/xilinx_spips.c         |  4 +---
hw/ssi/xlnx-versal-ospi.c     |  4 +---
hw/timer/allwinner-a10-pit.c  |  4 +---
hw/timer/exynos4210_mct.c     |  4 +---
hw/timer/hpet.c               |  4 +---
hw/timer/renesas_cmt.c        |  5 +----
hw/timer/renesas_tmr.c        |  9 +++------
hw/timer/sifive_pwm.c         |  5 +----
hw/usb/hcd-xhci-sysbus.c      |  5 ++---
hw/usb/xlnx-usb-subsystem.c   |  2 +-
51 files changed, 70 insertions(+), 197 deletions(-)
[PATCH v2 0/7] hw/sysbus: Add sysbus_init_irqs and reduce SYSBUS_DEVICE_GPIO_IRQ scope
Posted by Philippe Mathieu-Daudé 10 months, 4 weeks ago
Since v1:
- Removed pointless QOM casts on a preliminary series [*] (Markus)
- Added Richard R-b tags

This series:

- Remove uses (out of sysbus.c) to the SYSBUS_DEVICE_GPIO_IRQ
  definition, using proper SysBus API methods,
- Reduce SYSBUS_DEVICE_GPIO_IRQ scope, making it SysBus API
  internal,
- Convert various for() loops iterating over sysbus_init_irq()
  by calling a single sysbus_init_irqs() instead. Mostly an
  automatic convertion except 4 files.

The resulting code looks nicer IMHO, and is possibly less
bug prone.

Based-on: <20230601093452.38972-1-philmd@linaro.org>
          "bulk: Remove pointless QOM casts"
[*] https://lore.kernel.org/qemu-devel/20230601093452.38972-1-philmd@linaro.org/

Philippe Mathieu-Daudé (7):
  hw/arm/xlnx-versal: Do not open-code sysbus_connect_irq()
  hw/usb/xlnx: Do not open-code sysbus_pass_irq()
  hw/sysbus: Introduce sysbus_init_irqs()
  hw/usb/hcd-xhci: Use sysbus_init_irqs()
  hw/sysbus: Make SYSBUS_DEVICE_GPIO_IRQ API internal
  hw: Simplify using sysbus_init_irqs() [automatic]
  hw: Simplify using sysbus_init_irqs() [manual]

 include/hw/sysbus.h           |  3 +--
 hw/arm/smmuv3.c               |  6 +-----
 hw/arm/stellaris.c            |  5 +----
 hw/arm/strongarm.c            |  5 +----
 hw/arm/versatilepb.c          |  5 +----
 hw/arm/xlnx-versal.c          |  4 +---
 hw/char/pl011.c               |  5 +----
 hw/char/renesas_sci.c         |  5 +----
 hw/core/platform-bus.c        |  5 +----
 hw/core/sysbus.c              |  9 ++++++++-
 hw/dma/pl330.c                |  4 +---
 hw/dma/sifive_pdma.c          |  5 +----
 hw/gpio/sifive_gpio.c         |  5 +----
 hw/i386/kvm/xen_evtchn.c      |  5 +----
 hw/intc/arm_gic_common.c      | 20 +++++---------------
 hw/intc/arm_gicv2m.c          |  5 +----
 hw/intc/exynos4210_combiner.c |  5 +----
 hw/intc/loongarch_extioi.c    |  7 ++-----
 hw/intc/loongson_liointc.c    |  5 +----
 hw/intc/omap_intc.c           |  3 +--
 hw/intc/openpic.c             |  6 ++----
 hw/intc/slavio_intctl.c       |  6 ++----
 hw/misc/avr_power.c           |  4 +---
 hw/misc/macio/gpio.c          |  5 +----
 hw/misc/stm32f4xx_exti.c      |  5 +----
 hw/net/cadence_gem.c          |  5 +----
 hw/net/mcf_fec.c              |  5 +----
 hw/pci-host/designware.c      |  5 +----
 hw/pci-host/gpex.c            |  2 +-
 hw/pci-host/ppce500.c         |  4 +---
 hw/pci-host/raven.c           |  4 +---
 hw/pci-host/sh_pci.c          |  5 +----
 hw/pci-host/versatile.c       |  4 +---
 hw/ppc/ppc405_uc.c            | 10 ++--------
 hw/ppc/ppc440_uc.c            |  6 ++----
 hw/ppc/ppc4xx_devs.c          |  4 +---
 hw/ppc/ppc4xx_pci.c           |  5 +----
 hw/ssi/ibex_spi_host.c        |  5 +----
 hw/ssi/imx_spi.c              |  5 +----
 hw/ssi/sifive_spi.c           |  5 +----
 hw/ssi/xilinx_spi.c           |  5 +----
 hw/ssi/xilinx_spips.c         |  4 +---
 hw/ssi/xlnx-versal-ospi.c     |  4 +---
 hw/timer/allwinner-a10-pit.c  |  4 +---
 hw/timer/exynos4210_mct.c     |  4 +---
 hw/timer/hpet.c               |  4 +---
 hw/timer/renesas_cmt.c        |  5 +----
 hw/timer/renesas_tmr.c        |  9 +++------
 hw/timer/sifive_pwm.c         |  5 +----
 hw/usb/hcd-xhci-sysbus.c      |  5 ++---
 hw/usb/xlnx-usb-subsystem.c   |  2 +-
 51 files changed, 70 insertions(+), 197 deletions(-)

-- 
2.38.1