qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/2] pci: drop redundant PCIDeviceClass::is_bridge field


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH 2/2] pci: drop redundant PCIDeviceClass::is_bridge field
Date: Wed, 16 Nov 2022 16:35:10 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

On 16/11/22 16:27, Igor Mammedov wrote:
and use cast to TYPE_PCI_BRIDGE instead.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
  include/hw/pci/pci.h               | 11 +----------
  include/hw/pci/pci_bridge.h        |  1 +
  hw/acpi/pcihp.c                    |  3 +--
  hw/i386/acpi-build.c               |  5 ++---
  hw/pci-bridge/cxl_downstream.c     |  1 -
  hw/pci-bridge/cxl_upstream.c       |  1 -
  hw/pci-bridge/i82801b11.c          |  1 -
  hw/pci-bridge/pci_bridge_dev.c     |  1 -
  hw/pci-bridge/pcie_pci_bridge.c    |  1 -
  hw/pci-bridge/pcie_root_port.c     |  1 -
  hw/pci-bridge/simba.c              |  1 -
  hw/pci-bridge/xio3130_downstream.c |  1 -
  hw/pci-bridge/xio3130_upstream.c   |  1 -
  hw/pci-host/designware.c           |  1 -
  hw/pci-host/xilinx-pcie.c          |  1 -
  hw/pci/pci.c                       | 20 +++++++++-----------
  hw/ppc/spapr_pci.c                 | 15 +++++----------
  17 files changed, 19 insertions(+), 47 deletions(-)

@@ -1090,9 +1088,10 @@ static PCIDevice *do_pci_register_device(PCIDevice 
*pci_dev,
      Error *local_err = NULL;
      DeviceState *dev = DEVICE(pci_dev);
      PCIBus *bus = pci_get_bus(pci_dev);
+    bool is_bridge = IS_PCI_BRIDGE(pci_dev);
/* Only pci bridges can be attached to extra PCI root buses */
-    if (pci_bus_is_root(bus) && bus->parent_dev && !pc->is_bridge) {
+    if (pci_bus_is_root(bus) && bus->parent_dev && !IS_PCI_BRIDGE(pci_dev)) {

Can we use the recently assigned 'is_bridge' variable?

Otherwise:

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]