Skip to content

RFC pci: Type-safety and phb->bus initialization cleanup

Eduardo Habkost qemu-arm qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest7 patches 21 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7pci: Change pci_host_bus_register() parameter to PCIHostStatehw/pci/pci.c+3 -52 replies
2/7pci: Change pci_bus_init() 'parent' parameter to PCIHostStatehw/pci/pci.c+6 -43 replies
3/7pci: Change pci_bus_new*() parameter to PCIHostStatehw/pci-bridge/pci_expander_bridge.c hw/pci-host/piix.c hw/pci-host/prep.c +4 more+21 -206 replies
4/7pci: Change pci_register_bus() 'parent' parameter to PCIHostStatehw/alpha/typhoon.c hw/mips/gt64xxx_pci.c hw/pci-host/apb.c +12 more+17 -174 replies
5/7pci: Set phb->bus inside pci_register_bus()hw/alpha/typhoon.c hw/mips/gt64xxx_pci.c hw/pci-host/apb.c +12 more+60 -824 replies
6/7pci: Set phb->bus inside pci_bus_new()hw/pci-bridge/pci_expander_bridge.c hw/pci-host/piix.c hw/pci-host/q35.c +1 more+4 -71 reply
7/7pci: Set phb->bus inside pci_bus_new_inplace()hw/pci-host/prep.c hw/pci-host/versatile.c hw/pci/pci.c+1 -31 reply

Reviews trailers per patch

All 7 patches have a Reviewed-by or Acked-by.

PatchDavid GibsonCornelia HuckMarcel Apfelbaum
1/7R-b R-b
2/7R-b R-b
3/7R-b
4/7R-b A-b R-b
5/7R-b A-b
6/7R-b
7/7R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v1 thread

Cover letter [Qemu-devel] [RFC 0/7] pci: Type-safety and phb->bus initialization cleanup

I've noticed that pci_bus_new*() and pci_register_bus() require 'parent' to be a PCI_HOST_BRIDGE object, but this is not clear from the function signatures.

This series implements two changes in the PCI code:

1) Replace DeviceState with PCIHostState on functions that already require a PCI_HOST_BRIDGE argument. Makes the functions harder to misuse.
2) Move PCIHostState::bus initialization inside pci_bus_new*(), to avoid code duplication and make sure the field will be always initialized consistently.

Eduardo Habkost (7):
pci: Change pci_host_bus_register() parameter to PCIHostState
pci: Change pci_bus_init() 'parent' parameter to PCIHostState
pci: Change pci_bus_new*() parameter to PCIHostState
pci: Change pci_register_bus() 'parent' parameter to PCIHostState
pci: Set phb->bus inside pci_register_bus()
pci: Set phb->bus inside pci_bus_new()
pci: Set phb->bus inside pci_bus_new_inplace()

 include/hw/pci/pci.h                | 17 ++++++++--------
 hw/alpha/typhoon.c                  | 10 +++++-----
 hw/mips/gt64xxx_pci.c               |  9 +++------
 hw/pci-bridge/pci_expander_bridge.c | 15 +++++++-------
 hw/pci-host/apb.c                   |  7 ++-----
 hw/pci-host/bonito.c                |  7 +++----
 hw/pci-host/gpex.c                  |  5 ++---
 hw/pci-host/grackle.c               |  9 ++-------
 hw/pci-host/piix.c                  |  3 +--
 hw/pci-host/ppce500.c               |  8 ++++----
 hw/pci-host/prep.c                  |  4 +---
 hw/pci-host/q35.c                   |  6 +++---
 hw/pci-host/uninorth.c              | 18 ++++++-----------
 hw/pci-host/versatile.c             |  3 +--
 hw/pci-host/xilinx-pcie.c           |  6 +++---
 hw/pci/pci.c                        | 40 ++++++++++++++++++-------------------
 hw/ppc/ppc4xx_pci.c                 |  8 ++++----
 hw/ppc/spapr_pci.c                  | 10 +++++-----
 hw/s390x/s390-pci-bus.c             | 10 +++++-----
 hw/sh4/sh_pci.c                     |  9 +++------
 20 files changed, 89 insertions(+), 115 deletions(-)
Signature · 1 line
2.11.0.259.g40922b1