All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: "Bjorn Helgaas" <bhelgaas@google.com>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Giovanni Cabiddu" <giovanni.cabiddu@intel.com>,
	"Rafał Miłecki" <zajec5@gmail.com>,
	"Peter Zijlstra" <peterz@infradead.org>,
	linux-pci@vger.kernel.org,
	"Alexander Duyck" <alexanderduyck@fb.com>,
	"Russell Currey" <ruscur@russell.cc>,
	"Sathya Prakash" <sathya.prakash@broadcom.com>,
	oss-drivers@corigine.com, "Oliver O'Halloran" <oohall@gmail.com>,
	"H. Peter Anvin" <hpa@zytor.com>, "Jiri Olsa" <jolsa@redhat.com>,
	linux-perf-users@vger.kernel.org,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	"Herbert Xu" <herbert@gondor.apana.org.au>,
	linux-scsi@vger.kernel.org,
	"Michael Ellerman" <mpe@ellerman.id.au>,
	"Ido Schimmel" <idosch@nvidia.com>,
	x86@kernel.org, qat-linux@intel.com,
	"Alexander Shishkin" <alexander.shishkin@linux.intel.com>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Geert Uytterhoeven" <geert@linux-m68k.org>,
	"Benjamin Herrenschmidt" <benh@kernel.crashing.org>,
	linux-wireless@vger.kernel.org,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Mathias Nyman" <mathias.nyman@intel.com>,
	"Yisen Zhuang" <yisen.zhuang@huawei.com>,
	"Fiona Trahe" <fiona.trahe@intel.com>,
	"Andrew Donnellan" <ajd@linux.ibm.com>,
	"Arnd Bergmann" <arnd@arndb.de>,
	"Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>,
	"Suganath Prabu Subramani"
	<suganath-prabu.subramani@broadcom.com>,
	"Simon Horman" <simon.horman@corigine.com>,
	"Arnaldo Carvalho de Melo" <acme@kernel.org>,
	"Borislav Petkov" <bp@alien8.de>, "Michael Buesch" <m@bues.ch>,
	"Jiri Pirko" <jiri@nvidia.com>,
	"Namhyung Kim" <namhyung@kernel.org>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Andy Shevchenko" <andriy.shevchenko@intel.com>,
	"Juergen Gross" <jgross@suse.com>,
	"Salil Mehta" <salil.mehta@huawei.com>,
	"Sreekanth Reddy" <sreekanth.reddy@broadcom.com>,
	xen-devel@lists.xenproject.org,
	"Vadym Kochan" <vkochan@marvell.com>,
	MPT-FusionLinux.pdl@broadcom.com,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org,
	"Wojciech Ziemba" <wojciech.ziemba@intel.com>,
	linux-kernel@vger.kernel.org,
	"Taras Chornyi" <tchornyi@marvell.com>,
	"Zhou Wang" <wangzhou1@hisilicon.com>,
	linux-crypto@vger.kernel.org, kernel@pengutronix.de,
	netdev@vger.kernel.org, "Frederic Barrat" <fbarrat@linux.ibm.com>,
	"Paul Mackerras" <paulus@samba.org>,
	linuxppc-dev@lists.ozlabs.org,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH v1 4/5] PCI: Adapt all code locations to not use struct pci_dev::driver directly
Date: Mon, 2 Aug 2021 09:06:34 -0400	[thread overview]
Message-ID: <d9dfe855-a2a5-c48b-b4c4-8109d7289809@oracle.com> (raw)
In-Reply-To: <20210731120836.vegno6voijvlflws@pengutronix.de>


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
>

WARNING: multiple messages have this Message-ID (diff)
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: "Mark Rutland" <mark.rutland@arm.com>,
	"Giovanni Cabiddu" <giovanni.cabiddu@intel.com>,
	"Rafał Miłecki" <zajec5@gmail.com>,
	"Peter Zijlstra" <peterz@infradead.org>,
	linux-pci@vger.kernel.org,
	"Alexander Duyck" <alexanderduyck@fb.com>,
	x86@kernel.org, oss-drivers@corigine.com, netdev@vger.kernel.org,
	"Oliver O'Halloran" <oohall@gmail.com>,
	"H. Peter Anvin" <hpa@zytor.com>, "Jiri Olsa" <jolsa@redhat.com>,
	"Paul Mackerras" <paulus@samba.org>,
	"Taras Chornyi" <tchornyi@marvell.com>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	"Herbert Xu" <herbert@gondor.apana.org.au>,
	linux-scsi@vger.kernel.org,
	"Sathya Prakash" <sathya.prakash@broadcom.com>,
	qat-linux@intel.com,
	"Alexander Shishkin" <alexander.shishkin@linux.intel.com>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Geert Uytterhoeven" <geert@linux-m68k.org>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Yisen Zhuang" <yisen.zhuang@huawei.com>,
	"Suganath Prabu Subramani"
	<suganath-prabu.subramani@broadcom.com>,
	"Fiona Trahe" <fiona.trahe@intel.com>,
	"Andrew Donnellan" <ajd@linux.ibm.com>,
	"Mathias Nyman" <mathias.nyman@intel.com>,
	"Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>,
	"Ido Schimmel" <idosch@nvidia.com>,
	"Arnaldo Carvalho de Melo" <acme@kernel.org>,
	"Frederic Barrat" <fbarrat@linux.ibm.com>,
	"Borislav Petkov" <bp@alien8.de>, "Michael Buesch" <m@bues.ch>,
	"Jiri Pirko" <jiri@nvidia.com>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Namhyung Kim" <namhyung@kernel.org>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Andy Shevchenko" <andriy.shevchenko@intel.com>,
	"Juergen Gross" <jgross@suse.com>,
	"Salil Mehta" <salil.mehta@huawei.com>,
	"Sreekanth Reddy" <sreekanth.reddy@broadcom.com>,
	xen-devel@lists.xenproject.org,
	"Vadym Kochan" <vkochan@marvell.com>,
	MPT-FusionLinux.pdl@broadcom.com, linux-usb@vger.kernel.org,
	linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-perf-users@vger.kernel.org,
	"Zhou Wang" <wangzhou1@hisilicon.com>,
	"Arnd Bergmann" <arnd@arndb.de>,
	linux-crypto@vger.kernel.org, kernel@pengutronix.de,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Simon Horman" <simon.horman@corigine.com>,
	"Wojciech Ziemba" <wojciech.ziemba@intel.com>,
	linuxppc-dev@lists.ozlabs.org,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH v1 4/5] PCI: Adapt all code locations to not use struct pci_dev::driver directly
Date: Mon, 2 Aug 2021 09:06:34 -0400	[thread overview]
Message-ID: <d9dfe855-a2a5-c48b-b4c4-8109d7289809@oracle.com> (raw)
In-Reply-To: <20210731120836.vegno6voijvlflws@pengutronix.de>


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
>

  reply	other threads:[~2021-08-02 13:08 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-29 20:37 [PATCH v1 0/5] PCI: Drop duplicated tracking of a pci_dev's bound driver Uwe Kleine-König
2021-07-29 20:37 ` Uwe Kleine-König
2021-07-29 20:37 ` [PATCH v1 1/5] PCI: Simplify pci_device_remove() Uwe Kleine-König
2021-07-29 20:37 ` [PATCH v1 2/5] PCI: Drop useless check from pci_device_probe() Uwe Kleine-König
2021-07-29 20:37 ` [PATCH v1 3/5] PCI: Provide wrapper to access a pci_dev's bound driver Uwe Kleine-König
2021-07-29 20:37 ` [PATCH v1 4/5] PCI: Adapt all code locations to not use struct pci_dev::driver directly Uwe Kleine-König
2021-07-29 20:37   ` Uwe Kleine-König
2021-07-30 20:37   ` Boris Ostrovsky
2021-07-30 20:37     ` Boris Ostrovsky
2021-07-31 12:08     ` Uwe Kleine-König
2021-07-31 12:08       ` Uwe Kleine-König
2021-08-02 13:06       ` Boris Ostrovsky [this message]
2021-08-02 13:06         ` Boris Ostrovsky
2021-07-29 20:37 ` [PATCH v1 5/5] PCI: Drop duplicated tracking of a pci_dev's bound driver Uwe Kleine-König
2021-07-30  5:14   ` Greg Kroah-Hartman
2021-07-30  5:24     ` Uwe Kleine-König
2021-07-30  5:14 ` [PATCH v1 0/5] " Greg Kroah-Hartman
2021-07-30  5:14   ` Greg Kroah-Hartman
2021-07-30  8:06 ` Andy Shevchenko
2021-07-30  8:06   ` Andy Shevchenko
2021-07-30 17:48   ` Uwe Kleine-König
2021-07-30 17:48     ` Uwe Kleine-König

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d9dfe855-a2a5-c48b-b4c4-8109d7289809@oracle.com \
    --to=boris.ostrovsky@oracle.com \
    --cc=MPT-FusionLinux.pdl@broadcom.com \
    --cc=acme@kernel.org \
    --cc=ajd@linux.ibm.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=alexanderduyck@fb.com \
    --cc=andriy.shevchenko@intel.com \
    --cc=arnd@arndb.de \
    --cc=benh@kernel.crashing.org \
    --cc=bhelgaas@google.com \
    --cc=bp@alien8.de \
    --cc=davem@davemloft.net \
    --cc=fbarrat@linux.ibm.com \
    --cc=fiona.trahe@intel.com \
    --cc=geert@linux-m68k.org \
    --cc=giovanni.cabiddu@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=hpa@zytor.com \
    --cc=idosch@nvidia.com \
    --cc=jgross@suse.com \
    --cc=jiri@nvidia.com \
    --cc=jolsa@redhat.com \
    --cc=kernel@pengutronix.de \
    --cc=konrad.wilk@oracle.com \
    --cc=kuba@kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=m@bues.ch \
    --cc=mark.rutland@arm.com \
    --cc=mathias.nyman@intel.com \
    --cc=mingo@redhat.com \
    --cc=mpe@ellerman.id.au \
    --cc=namhyung@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=oohall@gmail.com \
    --cc=oss-drivers@corigine.com \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    --cc=qat-linux@intel.com \
    --cc=ruscur@russell.cc \
    --cc=salil.mehta@huawei.com \
    --cc=sathya.prakash@broadcom.com \
    --cc=simon.horman@corigine.com \
    --cc=sreekanth.reddy@broadcom.com \
    --cc=sstabellini@kernel.org \
    --cc=suganath-prabu.subramani@broadcom.com \
    --cc=tchornyi@marvell.com \
    --cc=tglx@linutronix.de \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=vkochan@marvell.com \
    --cc=wangzhou1@hisilicon.com \
    --cc=wojciech.ziemba@intel.com \
    --cc=x86@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    --cc=yisen.zhuang@huawei.com \
    --cc=zajec5@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.