[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v1 4/5] PCI: Adapt all code locations to not use struct pci_dev::driver directly
 
- To: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
 
- From: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>
 
- Date: Sat, 31 Jul 2021 14:08:36 +0200
 
- Cc: Bjorn Helgaas <bhelgaas@xxxxxxxxxx>,	Mark Rutland <mark.rutland@xxxxxxx>,	Giovanni Cabiddu <giovanni.cabiddu@xxxxxxxxx>,	Rafał Miłecki <zajec5@xxxxxxxxx>,	Peter Zijlstra <peterz@xxxxxxxxxxxxx>, linux-pci@xxxxxxxxxxxxxxx,	Alexander Duyck <alexanderduyck@xxxxxx>,	Russell Currey <ruscur@xxxxxxxxxx>,	Sathya Prakash <sathya.prakash@xxxxxxxxxxxx>,	oss-drivers@xxxxxxxxxxxx, Oliver O'Halloran <oohall@xxxxxxxxx>,	"H. Peter Anvin" <hpa@xxxxxxxxx>, Jiri Olsa <jolsa@xxxxxxxxxx>,	linux-perf-users@xxxxxxxxxxxxxxx,	Stefano Stabellini <sstabellini@xxxxxxxxxx>,	Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>,	linux-scsi@xxxxxxxxxxxxxxx, Michael Ellerman <mpe@xxxxxxxxxxxxxx>,	Ido Schimmel <idosch@xxxxxxxxxx>, x86@xxxxxxxxxx,	qat-linux@xxxxxxxxx,	Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>,	Ingo Molnar <mingo@xxxxxxxxxx>,	Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>,	Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>,	linux-wireless@xxxxxxxxxxxxxxx, Jakub Kicinski <kuba@xxxxxxxxxx>,	Mathias Nyman <mathias.nyman@xxxxxxxxx>,	Yisen Zhuang <yisen.zhuang@xxxxxxxxxx>,	Fiona Trahe <fiona.trahe@xxxxxxxxx>,	Andrew Donnellan <ajd@xxxxxxxxxxxxx>, Arnd Bergmann <arnd@xxxxxxxx>,	Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>,	Suganath Prabu Subramani <suganath-prabu.subramani@xxxxxxxxxxxx>,	Simon Horman <simon.horman@xxxxxxxxxxxx>,	Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>,	Borislav Petkov <bp@xxxxxxxxx>, Michael Buesch <m@xxxxxxx>,	Jiri Pirko <jiri@xxxxxxxxxx>, Namhyung Kim <namhyung@xxxxxxxxxx>,	Thomas Gleixner <tglx@xxxxxxxxxxxxx>,	Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>,	Juergen Gross <jgross@xxxxxxxx>,	Salil Mehta <salil.mehta@xxxxxxxxxx>,	Sreekanth Reddy <sreekanth.reddy@xxxxxxxxxxxx>,	xen-devel@xxxxxxxxxxxxxxxxxxxx, Vadym Kochan <vkochan@xxxxxxxxxxx>,	MPT-FusionLinux.pdl@xxxxxxxxxxxx,	Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>,	linux-usb@xxxxxxxxxxxxxxx,	Wojciech Ziemba <wojciech.ziemba@xxxxxxxxx>,	linux-kernel@xxxxxxxxxxxxxxx, Taras Chornyi <tchornyi@xxxxxxxxxxx>,	Zhou Wang <wangzhou1@xxxxxxxxxxxxx>, linux-crypto@xxxxxxxxxxxxxxx,	kernel@xxxxxxxxxxxxxx, netdev@xxxxxxxxxxxxxxx,	Frederic Barrat <fbarrat@xxxxxxxxxxxxx>,	Paul Mackerras <paulus@xxxxxxxxx>, linuxppc-dev@xxxxxxxxxxxxxxxx,	"David S. Miller" <davem@xxxxxxxxxxxxx>
 
- Delivery-date: Sat, 31 Jul 2021 12:10:09 +0000
 
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
 
 
 
Hello Boris,
On Fri, Jul 30, 2021 at 04:37:31PM -0400, Boris Ostrovsky wrote:
> On 7/29/21 4:37 PM, Uwe Kleine-König wrote:
> > --- a/drivers/pci/xen-pcifront.c
> > +++ b/drivers/pci/xen-pcifront.c
> > @@ -599,12 +599,12 @@ static pci_ers_result_t pcifront_common_process(int 
> > cmd,
> >     result = PCI_ERS_RESULT_NONE;
> >  
> >     pcidev = pci_get_domain_bus_and_slot(domain, bus, devfn);
> > -   if (!pcidev || !pcidev->driver) {
> > +   pdrv = pci_driver_of_dev(pcidev);
> > +   if (!pcidev || !pdrv) {
> 
> If pcidev is NULL we are dead by the time we reach 'if' statement.
Oh, you're right. So this needs something like:
        if (!pcidev || !(pdrv = pci_driver_of_dev(pcidev)))
or repeating the call to pci_driver_of_dev for each previous usage of
pdev->driver.
If there are no other preferences I'd got with the first approach for
v2.
Best regards and thanks for catching,
Uwe
-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |
Attachment:
signature.asc 
Description: PGP signature 
 
    
     |