[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d9dfe855-a2a5-c48b-b4c4-8109d7289809@oracle.com>
Date: Mon, 2 Aug 2021 09:06:34 -0400
From: Boris Ostrovsky <boris.ostrovsky@...cle.com>
To: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
Cc: Bjorn Helgaas <bhelgaas@...gle.com>,
Mark Rutland <mark.rutland@....com>,
Giovanni Cabiddu <giovanni.cabiddu@...el.com>,
Rafał Miłecki <zajec5@...il.com>,
Peter Zijlstra <peterz@...radead.org>,
linux-pci@...r.kernel.org, Alexander Duyck <alexanderduyck@...com>,
Russell Currey <ruscur@...sell.cc>,
Sathya Prakash <sathya.prakash@...adcom.com>,
oss-drivers@...igine.com, Oliver O'Halloran <oohall@...il.com>,
"H. Peter Anvin" <hpa@...or.com>, Jiri Olsa <jolsa@...hat.com>,
linux-perf-users@...r.kernel.org,
Stefano Stabellini <sstabellini@...nel.org>,
Herbert Xu <herbert@...dor.apana.org.au>,
linux-scsi@...r.kernel.org, Michael Ellerman <mpe@...erman.id.au>,
Ido Schimmel <idosch@...dia.com>, x86@...nel.org,
qat-linux@...el.com,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Ingo Molnar <mingo@...hat.com>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
linux-wireless@...r.kernel.org, Jakub Kicinski <kuba@...nel.org>,
Mathias Nyman <mathias.nyman@...el.com>,
Yisen Zhuang <yisen.zhuang@...wei.com>,
Fiona Trahe <fiona.trahe@...el.com>,
Andrew Donnellan <ajd@...ux.ibm.com>,
Arnd Bergmann <arnd@...db.de>,
Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
Suganath Prabu Subramani
<suganath-prabu.subramani@...adcom.com>,
Simon Horman <simon.horman@...igine.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Borislav Petkov <bp@...en8.de>, Michael Buesch <m@...s.ch>,
Jiri Pirko <jiri@...dia.com>,
Namhyung Kim <namhyung@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Andy Shevchenko <andriy.shevchenko@...el.com>,
Juergen Gross <jgross@...e.com>,
Salil Mehta <salil.mehta@...wei.com>,
Sreekanth Reddy <sreekanth.reddy@...adcom.com>,
xen-devel@...ts.xenproject.org, Vadym Kochan <vkochan@...vell.com>,
MPT-FusionLinux.pdl@...adcom.com,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-usb@...r.kernel.org,
Wojciech Ziemba <wojciech.ziemba@...el.com>,
linux-kernel@...r.kernel.org, Taras Chornyi <tchornyi@...vell.com>,
Zhou Wang <wangzhou1@...ilicon.com>,
linux-crypto@...r.kernel.org, kernel@...gutronix.de,
netdev@...r.kernel.org, Frederic Barrat <fbarrat@...ux.ibm.com>,
Paul Mackerras <paulus@...ba.org>,
linuxppc-dev@...ts.ozlabs.org,
"David S. Miller" <davem@...emloft.net>
Subject: Re: [PATCH v1 4/5] PCI: Adapt all code locations to not use struct
pci_dev::driver directly
On 7/31/21 8:08 AM, Uwe Kleine-König wrote:
> 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)))
Sure, that's fine. And while at it please also drop 'if (pdrv)' check below (it's not directly related to your change but is more noticeable now so since you are in that function anyway I'd appreciate if you could do that).
Thanks.
-boris
>
> 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
>
Powered by blists - more mailing lists