qemu-ppc
[Top][All Lists]
Advanced

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

Re: [Qemu-ppc] [RFC for-4.1 3/5] pcie: Remove redundant test in pcie_mmc


From: David Gibson
Subject: Re: [Qemu-ppc] [RFC for-4.1 3/5] pcie: Remove redundant test in pcie_mmcfg_data_read()
Date: Tue, 2 Apr 2019 21:34:07 +1100
User-agent: Mutt/1.11.3 (2019-02-01)

On Tue, Apr 02, 2019 at 09:10:55AM +0200, Greg Kurz wrote:
> 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 ?

Oops, didn't spot that.  Adjusted for the next spin.

-- 
David Gibson                    | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
                                | _way_ _around_!
http://www.ozlabs.org/~dgibson

Attachment: signature.asc
Description: PGP signature


reply via email to

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