[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH v4 1/5] pcie: Remove redundant test in pcie_mmcfg_data
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PATCH v4 1/5] pcie: Remove redundant test in pcie_mmcfg_data_{read, write}() |
Date: |
Mon, 13 May 2019 16:19:35 +1000 |
These functions have an explicit test for accesses above the device's
config size. But pci_host_config_{read,write}_common() which they're
about to call already have checks against the config space limit and
do the right thing. So, remove the redundant tests.
Signed-off-by: David Gibson <address@hidden>
Reviewed-by: Greg Kurz <address@hidden>
---
hw/pci/pcie_host.c | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/hw/pci/pcie_host.c b/hw/pci/pcie_host.c
index 553db56778..1ee4945a6d 100644
--- a/hw/pci/pcie_host.c
+++ b/hw/pci/pcie_host.c
@@ -47,11 +47,6 @@ static void pcie_mmcfg_data_write(void *opaque, hwaddr
mmcfg_addr,
}
addr = PCIE_MMCFG_CONFOFFSET(mmcfg_addr);
limit = pci_config_size(pci_dev);
- if (limit <= addr) {
- /* conventional pci device can be behind pcie-to-pci bridge.
- 256 <= addr < 4K has no effects. */
- return;
- }
pci_host_config_write_common(pci_dev, addr, limit, val, len);
}
@@ -70,11 +65,6 @@ static uint64_t pcie_mmcfg_data_read(void *opaque,
}
addr = PCIE_MMCFG_CONFOFFSET(mmcfg_addr);
limit = pci_config_size(pci_dev);
- if (limit <= addr) {
- /* conventional pci device can be behind pcie-to-pci bridge.
- 256 <= addr < 4K has no effects. */
- return ~0x0;
- }
return pci_host_config_read_common(pci_dev, addr, limit, len);
}
--
2.21.0
- [Qemu-ppc] [PATCH v4 0/5] Simplify some not-really-necessary PCI bus callbacks, David Gibson, 2019/05/13
- [Qemu-ppc] [PATCH v4 1/5] pcie: Remove redundant test in pcie_mmcfg_data_{read, write}(),
David Gibson <=
- [Qemu-ppc] [PATCH v4 2/5] pci: Simplify pci_bus_is_root(), David Gibson, 2019/05/13
- [Qemu-ppc] [PATCH v4 4/5] pci: Make is_bridge a bool, David Gibson, 2019/05/13
- [Qemu-ppc] [PATCH v4 3/5] pcie: Simplify pci_adjust_config_limit(), David Gibson, 2019/05/13
- [Qemu-ppc] [PATCH v4 5/5] pci: Fold pci_get_bus_devfn() into its sole caller, David Gibson, 2019/05/13