Re: [PATCH v3] PCI: Add PCI_DEVICE_DATA() macro to fully describe device ID entry

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2018-07-27 at 16:10 -0500, Bjorn Helgaas wrote:
> On Fri, Jul 27, 2018 at 11:49:44PM +0300, Andy Shevchenko wrote:
> > There are a lot of examples in the kernel where PCI_VDEVICE() is
> > used and still
> > looks not so convenient due to additional driver_data field
> > attached.
> > 
> > Introduce PCI_DEVICE_DATA() macro to fully describe device ID entry
> > in shortest
> > possible form. For example,
> > 
> >   before:
> > 
> >     { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_MRFLD),
> >       (kernel_ulong_t) &dwc3_pci_mrfld_properties, },
> > 
> >   after:
> > 
> >     { PCI_DEVICE_DATA(INTEL, INTEL_MRFLD,
> > &dwc3_pci_mrfld_properties) },
> 
> Most device IDs include the vendor ID; did you consider pasting the
> vendor ID string into the device ID, so you would end up with this?
> 
>     { PCI_DEVICE_DATA(INTEL, MRFLD, &dwc3_pci_mrfld_properties) },

While it makes it slightly shorter, it breaks consistency among such
macros. I don't see any of them is using something like
PCI_DEVICE_ID_##vend##dev.

Though I see few users outside of PCI subsystem that reinvent above
line.

Do you think variant with ##vend##dev is better? I will update it for v4
if needed.

> I don't absolutely love either PCI_VDEVICE or PCI_DEVICE_DATA because
> grep doesn't work as well to find uses of the symbol, but the existing
> 2300 uses of PCI_VDEVICE are telling me pretty loudly to just get over
> it :)


-- 
Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Intel Finland Oy



[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux