[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZL7B85GfKxVWK6ct@nvidia.com>
Date: Mon, 24 Jul 2023 15:24:51 -0300
From: Jason Gunthorpe <jgg@...dia.com>
To: Brett Creeley <bcreeley@....com>
Cc: "Tian, Kevin" <kevin.tian@...el.com>,
Brett Creeley <brett.creeley@....com>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"alex.williamson@...hat.com" <alex.williamson@...hat.com>,
"yishaih@...dia.com" <yishaih@...dia.com>,
"shameerali.kolothum.thodi@...wei.com" <shameerali.kolothum.thodi@...wei.com>,
"shannon.nelson@....com" <shannon.nelson@....com>
Subject: Re: [PATCH v12 vfio 3/7] vfio/pds: register with the pds_core PF
On Mon, Jul 24, 2023 at 11:20:42AM -0700, Brett Creeley wrote:
> On 7/24/2023 6:00 AM, Jason Gunthorpe wrote:
> > Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
> >
> >
> > On Sat, Jul 22, 2023 at 12:09:58AM -0700, Brett Creeley wrote:
> > > On 7/21/2023 2:01 AM, Tian, Kevin wrote:
> > > > Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
> > > >
> > > >
> > > > > From: Brett Creeley <brett.creeley@....com>
> > > > > Sent: Thursday, July 20, 2023 6:35 AM
> > > > >
> > > > > +void pds_vfio_unregister_client_cmd(struct pds_vfio_pci_device *pds_vfio)
> > > > > +{
> > > > > + struct pci_dev *pdev = pds_vfio_to_pci_dev(pds_vfio);
> > > > > + int err;
> > > > > +
> > > > > + err = pds_client_unregister(pci_physfn(pdev), pds_vfio->client_id);
> > > > > + if (err)
> > > > > + dev_err(&pdev->dev, "unregister from DSC failed: %pe\n",
> > > > > + ERR_PTR(err));
> > > >
> > > > Why using ERR_PTR() here? it looks a common pattern used cross
> > > > this series.
> > >
> > > Yes, this is intentional. This is more readable than just printing out the
> > > error value.
> >
> > That seems like a hack, it would be nicer if printk could format
> > errnos natively
>
> This is already being used all over the driver hierarchy.
That seems like an overstatement. The 100 places it is already used
would all be better as some '%de' instead.
Jason
Powered by blists - more mailing lists