Linux-kernel mailing list archive 2000-47,: Re: Patch(?): pci_device_id tables for linux-2.4.0-test11/drivers/block

# Re: Patch(?): pci_device_id tables for linux-2.4.0-test11/drivers/block

Jeff Garzik (jgarzik@mandrakesoft.com)
Wed, 22 Nov 2000 17:34:13 -0500

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Igmar Palsenberg: "Re: linux-2.2.18-pre19 asm/delay.h problem?"
- Previous message: Michael Marxmeier: "Re: e2fs performance as function of block size"
- Maybe in reply to: Adam J. Richter: "Patch(?): pci_device_id tables for linux-2.4.0-test11/drivers/block"
- Next in thread: Keith Owens: "Re: Patch(?): pci_device_id tables for linux-2.4.0-test11/drivers/block"

Andi Kleen wrote:
>
> On Wed, Nov 22, 2000 at 05:14:38PM -0500, Jeff Garzik wrote:
> > *This* is the over-engineering attitude I was talking about. The only
> > reason why you are preferring named initializers is because
> > pci_device_id MIGHT be changed. And if it is changed, it makes the
> > changeover just tad easier. For that, you ugly up the code and make it
> > more difficult to maintain.
>
> The other reason is that it makes self documenting code -- no need to look
> up the structure definition to make sense out of the code.

For the general case, that is true.

But note that the general case is usually a -single- structure being
initialized, not an array of structures. Unless the struct members
being initialized vary wildly from one array element to another, using
named initialized it redundant and -reduces- the ability of the
programmer to look at the pci_tbl[] and evaluate its contents at a
glance.

PCI tables do not use named initalizers on purpose. It was not an
accident or design mistake.

Jeff

    --
    Jeff Garzik             |
    Building 1024           | The chief enemy of creativity is "good" sense
    MandrakeSoft            |          -- Picasso
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    Please read the FAQ at http://www.tux.org/lkml/

- Next message: Igmar Palsenberg: "Re: linux-2.2.18-pre19 asm/delay.h problem?"
- Previous message: Michael Marxmeier: "Re: e2fs performance as function of block size"
- Maybe in reply to: Adam J. Richter: "Patch(?): pci_device_id tables for linux-2.4.0-test11/drivers/block"
- Next in thread: Keith Owens: "Re: Patch(?): pci_device_id tables for linux-2.4.0-test11/drivers/block"