Re: [PATCH] MISC: Convert to DEFINE_PCI_DEVICE_TABLE

From: Greg KH
Date: Fri Dec 02 2011 - 11:05:15 EST


On Fri, Dec 02, 2011 at 11:02:57AM +0800, Axel Lin wrote:
> Convert static struct pci_device_id *[] to static DEFINE_PCI_DEVICE_TABLE
> tables. Also convert to the PCI_DEVICE/PCI_VDEVICE macros for better
> readablity.
>
> Cc: Arnd Bergmann <arnd@xxxxxxxx>
> Cc: Greg Kroah-Hartman <greg@xxxxxxxxx>
> Cc: David Altobelli <david.altobelli@xxxxxx>
> Cc: Brent Casavant <bcasavan@xxxxxxx>
> Cc: Jiri Slaby <jirislaby@xxxxxxxxx>
> Cc: J Freyensee <james_p_freyensee@xxxxxxxxxxxxxxx>
> Cc: Alex Dubov <oakad@xxxxxxxxx>
> Signed-off-by: Axel Lin <axel.lin@xxxxxxxxx>
> ---
> drivers/misc/hpilo.c | 2 +-
> drivers/misc/ioc4.c | 6 +++---
> drivers/misc/pch_phub.c | 2 +-
> drivers/misc/phantom.c | 2 +-
> drivers/misc/pti.c | 2 +-
> drivers/misc/tifm_7xx1.c | 11 ++++-------
> 6 files changed, 11 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/misc/hpilo.c b/drivers/misc/hpilo.c
> index fffc227..f705cbb 100644
> --- a/drivers/misc/hpilo.c
> +++ b/drivers/misc/hpilo.c
> @@ -828,7 +828,7 @@ out:
> return error;
> }
>
> -static struct pci_device_id ilo_devices[] = {
> +static DEFINE_PCI_DEVICE_TABLE(ilo_devices) = {

No, I hate this macro, see, it's actually taking you more characters to
use it than to just properly define the structure yourself. It's
pointless and stupid.

So no, I'm not going to accept this patch, sorry.

I would love to see a patch removing this macro from the kernel, but I'm
not the PCI maintainer anymore, so I can't directly accept it :(

> { PCI_DEVICE(PCI_VENDOR_ID_COMPAQ, 0xB204) },
> { PCI_DEVICE(PCI_VENDOR_ID_HP, 0x3307) },
> { }
> diff --git a/drivers/misc/ioc4.c b/drivers/misc/ioc4.c
> index df03dd3..46adc36 100644
> --- a/drivers/misc/ioc4.c
> +++ b/drivers/misc/ioc4.c
> @@ -456,9 +456,9 @@ ioc4_remove(struct pci_dev *pdev)
> kfree(idd);
> }
>
> -static struct pci_device_id ioc4_id_table[] = {
> - {PCI_VENDOR_ID_SGI, PCI_DEVICE_ID_SGI_IOC4, PCI_ANY_ID,
> - PCI_ANY_ID, 0x0b4000, 0xFFFFFF},
> +static DEFINE_PCI_DEVICE_TABLE(ioc4_id_table) = {
> + { PCI_DEVICE(PCI_VENDOR_ID_SGI, PCI_DEVICE_ID_SGI_IOC4),
> + .class = 0x0b4000, .class_mask = 0xFFFFFF },

But the PCI_DEVICE() changes, yes, those are good as they make things
much more obvious as to what is going on. Care to send me a patch for
just that instead?

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/