Re: [PATCH] MISC: Convert to DEFINE_PCI_DEVICE_TABLE

From: Joe Perches
Date: Fri Dec 02 2011 - 16:01:56 EST


On Fri, 2011-12-02 at 08:03 -0800, Greg KH wrote:
> 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.
[]
> > diff --git 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.

Not quite.

include/linux/pci.h:#define DEFINE_PCI_DEVICE_TABLE(_table) \
include/linux/pci.h- const struct pci_device_id _table[] __devinitconst

Using the macro does declare the struct const and
use attribute __devinitconst to place the table into
section .devinit.rodata.

The straight definition does not.

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

Never in doubt, not always right...

cheers, Joe

--
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/