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

Re: [Xen-devel] [PATCH 4/6] make passthrough/pci.c:deassign_device() static


  • To: 'Jan Beulich' <jbeulich@xxxxxxxx>
  • From: Paul Durrant <Paul.Durrant@xxxxxxxxxx>
  • Date: Wed, 14 Aug 2019 09:42:52 +0000
  • Accept-language: en-GB, en-US
  • Authentication-results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=Paul.Durrant@xxxxxxxxxx; spf=Pass smtp.mailfrom=Paul.Durrant@xxxxxxxxxx; spf=None smtp.helo=postmaster@xxxxxxxxxxxxxxx
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 14 Aug 2019 09:43:01 +0000
  • Ironport-sdr: JCPYrR322L3MpUY1/d2Cc2Qn2KjUmlTnBeBoYvpjKzpoxI39SvIRqzvFp1tYy5yKImYq5SVfak VboXE2EkU5O/iPaX8EmovpGn2+3IJF8ec8kVWoDW0szC7T76WB34Qg/EL+xigk7rPzk7DmCU7X +70OJhbQipIqylkHFlZnOYW5q1wNk+8+ZrAeiLCbqPN6K2RP3lgg2GPYL4+qH57NbT2SFPj8jr 8XecHldmO6753O5VNnHgVs7yqhvT69hmNpbFDnnxVxdMaVMtoa2K31l4p7UW0YT2XXwRhZRZsa NqU=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVRuOcIxDU2ySq8EKMuwIzCGE8CqbuLxAAgAxMTAA=
  • Thread-topic: [PATCH 4/6] make passthrough/pci.c:deassign_device() static

> -----Original Message-----
> From: Jan Beulich <jbeulich@xxxxxxxx>
> Sent: 06 August 2019 16:54
> To: Paul Durrant <Paul.Durrant@xxxxxxxxxx>
> Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx
> Subject: Re: [PATCH 4/6] make passthrough/pci.c:deassign_device() static
> 
> On 30.07.2019 15:44, Paul Durrant wrote:
> > This function is only ever called from within the same source module and
> > really has no business being declared xen/iommu.h. This patch relocates
> > the function ahead of the first called and makes it static.
> >
> > Signed-off-by: Paul Durrant <paul.durrant@xxxxxxxxxx>
> 
> Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
> 

Thanks

> But of course it would have been nice if some minimal and obvious
> style corrections were done at the same time:

Ok, I'll fold these into v2.

  Paul

> 
> > --- a/xen/drivers/passthrough/pci.c
> > +++ b/xen/drivers/passthrough/pci.c
> > @@ -889,6 +889,52 @@ static int pci_clean_dpci_irqs(struct domain *d)
> >       return 0;
> >   }
> >
> > +/* caller should hold the pcidevs_lock */
> > +static int deassign_device(struct domain *d, u16 seg, u8 bus, u8 devfn)
> 
> uint<N>_t
> 
> > +{
> > +    const struct domain_iommu *hd = dom_iommu(d);
> > +    struct pci_dev *pdev = NULL;
> 
> stray initializer
> 
> > +    int ret = 0;
> > +
> > +    if ( !is_iommu_enabled(d) )
> > +        return -EINVAL;
> > +
> > +    ASSERT(pcidevs_locked());
> > +    pdev = pci_get_pdev_by_domain(d, seg, bus, devfn);
> > +    if ( !pdev )
> > +        return -ENODEV;
> > +
> > +    while ( pdev->phantom_stride )
> > +    {
> > +        devfn += pdev->phantom_stride;
> > +        if ( PCI_SLOT(devfn) != PCI_SLOT(pdev->devfn) )
> > +            break;
> > +        ret = hd->platform_ops->reassign_device(d, hardware_domain, devfn,
> > +                                                pci_to_dev(pdev));
> > +        if ( !ret )
> > +            continue;
> > +
> > +        printk(XENLOG_G_ERR "d%d: deassign %04x:%02x:%02x.%u failed 
> > (%d)\n",
> > +               d->domain_id, seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn), 
> > ret);
> 
> (less "minimal") use %pd (also once more below)
> 
> Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.