On Tue, 2 Apr 2019 16:40:26 +1100 David Gibson <da...@gibson.dropbear.id.au> wrote:
> 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 <da...@gibson.dropbear.id.au> > --- > 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); > } > It looks good but what about pcie_mmcfg_data_write(), which follows the same pattern ?