[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 4/6] PCI: Provide wrapper to access a pci_dev's bound driver
- To: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>
- From: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
- Date: Tue, 3 Aug 2021 17:37:20 +0300
- Cc: Bjorn Helgaas <bhelgaas@xxxxxxxxxx>, kernel@xxxxxxxxxxxxxx, Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>, linux-pci@xxxxxxxxxxxxxxx, Michael Ellerman <mpe@xxxxxxxxxxxxxx>, Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>, Paul Mackerras <paulus@xxxxxxxxx>, Russell Currey <ruscur@xxxxxxxxxx>, Oliver O'Halloran <oohall@xxxxxxxxx>, Peter Zijlstra <peterz@xxxxxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>, Mark Rutland <mark.rutland@xxxxxxx>, Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>, Jiri Olsa <jolsa@xxxxxxxxxx>, Namhyung Kim <namhyung@xxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Borislav Petkov <bp@xxxxxxxxx>, x86@xxxxxxxxxx, "H. Peter Anvin" <hpa@xxxxxxxxx>, Rafał Miłecki <zajec5@xxxxxxxxx>, Zhou Wang <wangzhou1@xxxxxxxxxxxxx>, Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>, "David S. Miller" <davem@xxxxxxxxxxxxx>, Giovanni Cabiddu <giovanni.cabiddu@xxxxxxxxx>, Sathya Prakash <sathya.prakash@xxxxxxxxxxxx>, Sreekanth Reddy <sreekanth.reddy@xxxxxxxxxxxx>, Suganath Prabu Subramani <suganath-prabu.subramani@xxxxxxxxxxxx>, Frederic Barrat <fbarrat@xxxxxxxxxxxxx>, Andrew Donnellan <ajd@xxxxxxxxxxxxx>, Arnd Bergmann <arnd@xxxxxxxx>, Yisen Zhuang <yisen.zhuang@xxxxxxxxxx>, Salil Mehta <salil.mehta@xxxxxxxxxx>, Jakub Kicinski <kuba@xxxxxxxxxx>, Vadym Kochan <vkochan@xxxxxxxxxxx>, Taras Chornyi <tchornyi@xxxxxxxxxxx>, Jiri Pirko <jiri@xxxxxxxxxx>, Ido Schimmel <idosch@xxxxxxxxxx>, Simon Horman <simon.horman@xxxxxxxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>, Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Michael Buesch <m@xxxxxxx>, Mathias Nyman <mathias.nyman@xxxxxxxxx>, Fiona Trahe <fiona.trahe@xxxxxxxxx>, Wojciech Ziemba <wojciech.ziemba@xxxxxxxxx>, Alexander Duyck <alexanderduyck@xxxxxx>, linuxppc-dev@xxxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-perf-users@xxxxxxxxxxxxxxx, linux-wireless@xxxxxxxxxxxxxxx, linux-crypto@xxxxxxxxxxxxxxx, qat-linux@xxxxxxxxx, MPT-FusionLinux.pdl@xxxxxxxxxxxx, linux-scsi@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxxxxxx, oss-drivers@xxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, linux-usb@xxxxxxxxxxxxxxx
- Delivery-date: Tue, 03 Aug 2021 14:37:53 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Tue, Aug 03, 2021 at 12:01:48PM +0200, Uwe Kleine-König wrote:
> Which driver a device is bound to is available twice: In struct
> pci_dev::dev->driver and in struct pci_dev::driver. To get rid of the
> duplication introduce a wrapper to access struct pci_dev's driver
> member. Once all users are converted the wrapper can be changed to
> calculate the driver using pci_dev::dev->driver.
...
> #define to_pci_driver(drv) container_of(drv, struct pci_driver, driver)
> +#define pci_driver_of_dev(pdev) ((pdev)->driver)
Seems like above is (mis)using TAB instead of space after #define. Not sure if
it's good to have them different.
--
With Best Regards,
Andy Shevchenko
|