[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: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>
- From: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
- Date: Mon, 2 Aug 2021 09:06:34 -0400
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=I5W7Rt23VbQ7Mj8HWXmATUJEbSZASSn2vfTtnLqvcMA=; b=luW0cSXxHZrzCcfpPmNxgqfJhmU3/ftf+08o3zEpkdqayBQUDBpZwy6yLd3OBzdx/Oo8tZUp2tB4bSckkSRHrnUXIn2GBi08T5R8Rf8M+yt1UD3x+CrEx7xefhqsGODk0Np+SqkrJkjQIyqZ4FZCl0b8akNUKr+DZ7MO8b6Xn02m2FBIDhS/3ssYYUn+dKWUwxvngPzoIK7iGvqTse4n7iPKiCpyO03AfR35vzAZswtFzbObGYiuzxov0T4EPkDMUDlyNc4ugaLIkj3h1bXYBhCtqLkRRAoIPII4VWbdb/BrFO9awRzI4LbNdVZUjBc7jVkSX6fbDrrJKlX0taF82Q==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ipqQqAdtkrHrw53rJup/e1rMdPpPbskowkaKasngA0dVFdWvvnDHmuQingns8us1alWzTIk6VJkEYcsTfi04zbk5RZw4DSTuG2RL2RpKRMQC3K+80wpsfAZPGvnXj0nTO0ROaeuwy+Iz8ypMPTzEG3qKv0fcHFTIZciso1p3zvrhog/409CWdsXFwV2bYXtVe6YLXuMLKEfSW0wzRCTVxIsKlrbWDO4x/1odnU8C0WjE5MOv8DkePneaFelHKxjJj6f4Ddx2NB4wwtYEhQJfu+/EJsBw7HaWnT78oZKTlcoYBMj/GyFPUcsIbQdQFGUa6HvsoIr1uKC2i0M9odOQBw==
- Authentication-results: davemloft.net; dkim=none (message not signed) header.d=none;davemloft.net; dmarc=none action=none header.from=oracle.com;
- 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: Mon, 02 Aug 2021 13:08:03 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
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
>
|