qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [RFC for-4.1 3/5] pcie: Remove redundant test in pcie_mmcfg


From: David Gibson
Subject: [Qemu-devel] [RFC for-4.1 3/5] pcie: Remove redundant test in pcie_mmcfg_data_read()
Date: Tue, 2 Apr 2019 16:40:26 +1100

This function has an explicit test for accesses above the device's config
size, in which case it returns ~0x0.  But pci_host_config_read_common()
which it is about to call already has checks against the config space
limit and likewise returns ~0x0 in that case.  So, remove the redundant
test.

Signed-off-by: David Gibson <address@hidden>
---
 hw/pci/pcie_host.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/hw/pci/pcie_host.c b/hw/pci/pcie_host.c
index 553db56778..8f4435838e 100644
--- a/hw/pci/pcie_host.c
+++ b/hw/pci/pcie_host.c
@@ -70,11 +70,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.20.1




reply via email to

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