Re: C99 Initialisers

From: Greg KH
Date: Tue Aug 12 2003 - 00:46:05 EST


On Tue, Aug 12, 2003 at 03:39:36AM +0100, Matthew Wilcox wrote:
> On Mon, Aug 11, 2003 at 07:18:53PM -0700, Robert Love wrote:
> > Convert GNU-style to C99-style. I think converting unnamed initializers
> > to named initializers is a Good Thing, too.
>
> By and large ... here's a counterexample:
>
> static struct pci_device_id tg3_pci_tbl[] __devinitdata = {
> { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5700,
> PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
> { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5701,
> PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
> ...
>
> I don't think anyone would appreciate you converting that to:
>
> static struct pci_device_id tg3_pci_tbl[] __devinitdata = {
> {
> .vendor = PCI_VENDOR_ID_BROADCOM,
> .device = PCI_DEVICE_ID_TIGON3_5700,
> .subvendor = PCI_ANY_ID,
> .subdevice = PCI_ANY_ID,
> .class = 0,
> .class_mask = 0,
> .driver_data = 0,
> },

I sure would. Oh, you can drop the .class, .class_mask, and
.driver_data lines, and then it even looks cleaner.

I would love to see that kind of change made for pci drivers.

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/