All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC 0/7] pci: Type-safety and phb->bus initialization cleanup
@ 2017-04-17 21:59 Eduardo Habkost
  2017-04-17 21:59 ` [Qemu-devel] [RFC 1/7] pci: Change pci_host_bus_register() parameter to PCIHostState Eduardo Habkost
                   ` (6 more replies)
  0 siblings, 7 replies; 29+ messages in thread
From: Eduardo Habkost @ 2017-04-17 21:59 UTC (permalink / raw)
  To: qemu-devel
  Cc: aik, David Gibson, Michael S. Tsirkin, Laszlo Ersek, Marcel Apfelbaum

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(-)

-- 
2.11.0.259.g40922b1

^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2017-04-26 17:49 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-17 21:59 [Qemu-devel] [RFC 0/7] pci: Type-safety and phb->bus initialization cleanup Eduardo Habkost
2017-04-17 21:59 ` [Qemu-devel] [RFC 1/7] pci: Change pci_host_bus_register() parameter to PCIHostState Eduardo Habkost
2017-04-18  3:46   ` David Gibson
2017-04-18 13:01   ` Marcel Apfelbaum
2017-04-17 21:59 ` [Qemu-devel] [RFC 2/7] pci: Change pci_bus_init() 'parent' " Eduardo Habkost
2017-04-18  3:51   ` David Gibson
2017-04-18 11:48     ` Eduardo Habkost
2017-04-18 13:22       ` Marcel Apfelbaum
2017-04-17 21:59 ` [Qemu-devel] [RFC 3/7] pci: Change pci_bus_new*() " Eduardo Habkost
2017-04-18  3:52   ` David Gibson
2017-04-18 13:27   ` Marcel Apfelbaum
2017-04-18 13:30     ` Eduardo Habkost
2017-04-18 13:36       ` Marcel Apfelbaum
2017-04-26 16:16   ` Michael S. Tsirkin
2017-04-26 17:49     ` Eduardo Habkost
2017-04-17 21:59 ` [Qemu-devel] [RFC 4/7] pci: Change pci_register_bus() 'parent' " Eduardo Habkost
2017-04-18  3:53   ` David Gibson
2017-04-18 10:41   ` Cornelia Huck
2017-04-18 13:37   ` Marcel Apfelbaum
2017-04-26 16:17   ` Michael S. Tsirkin
2017-04-17 21:59 ` [Qemu-devel] [RFC 5/7] pci: Set phb->bus inside pci_register_bus() Eduardo Habkost
2017-04-18  3:55   ` David Gibson
2017-04-18 10:42   ` Cornelia Huck
2017-04-18 13:43   ` Marcel Apfelbaum
2017-04-18 13:53     ` Eduardo Habkost
2017-04-17 21:59 ` [Qemu-devel] [RFC 6/7] pci: Set phb->bus inside pci_bus_new() Eduardo Habkost
2017-04-18  3:56   ` David Gibson
2017-04-17 21:59 ` [Qemu-devel] [RFC 7/7] pci: Set phb->bus inside pci_bus_new_inplace() Eduardo Habkost
2017-04-18  3:56   ` David Gibson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.