[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC for-4.1 3/5] pcie: Remove redundant test in pcie_m
From: |
Greg Kurz |
Subject: |
Re: [Qemu-devel] [RFC for-4.1 3/5] pcie: Remove redundant test in pcie_mmcfg_data_read() |
Date: |
Tue, 2 Apr 2019 09:10:55 +0200 |
On Tue, 2 Apr 2019 16:40:26 +1100
David Gibson <address@hidden> 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 <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);
> }
>
It looks good but what about pcie_mmcfg_data_write(), which follows
the same pattern ?
- [Qemu-devel] [RFC for-4.1 0/5] Simplify some not-really-necessary PCI bus callbacks, David Gibson, 2019/04/02
- [Qemu-devel] [RFC for-4.1 3/5] pcie: Remove redundant test in pcie_mmcfg_data_read(), David Gibson, 2019/04/02
- Re: [Qemu-devel] [RFC for-4.1 3/5] pcie: Remove redundant test in pcie_mmcfg_data_read(),
Greg Kurz <=
- [Qemu-devel] [RFC for-4.1 4/5] pci: Simplify pci_bus_is_root(), David Gibson, 2019/04/02
- [Qemu-devel] [RFC for-4.1 2/5] spapr_pci: Fix extended config space accesses, David Gibson, 2019/04/02
- [Qemu-devel] [RFC for-4.1 1/5] pci: Allow PCI bus subtypes to support extended config space accesses, David Gibson, 2019/04/02
- [Qemu-devel] [RFC for-4.1 5/5] pcie: Simplify pci_adjust_config_limit(), David Gibson, 2019/04/02