linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: Andrew Morton <akpm@osdl.org>
Cc: ahaas@airmail.net, B.Zolnierkiewicz@elka.pw.edu.pl,
	linux-ide@vger.kernel.org
Subject: Re: [PATCH] Small initializer patch for ide-disk.c
Date: Tue, 21 Dec 2004 16:51:26 -0500	[thread overview]
Message-ID: <41C89ADE.1010403@pobox.com> (raw)
In-Reply-To: <20041221133056.6a5a3259.akpm@osdl.org>

Andrew Morton wrote:
> Jeff Garzik <jgarzik@pobox.com> wrote:
> 
>>Art Haas wrote:
>>
>>>Hi.
>>>
>>>This patch adds C99 initializers to the file. It can clearly wait until
>>>after 2.6.10 is released if you want to send it to Linus.
>>
>>The unpatched version is far more readable and maintainable.
>>
> 
> 
> I was thinking the exact opposite ;)


The problem with this (and similar patches to PCI drivers' struct 
pci_device_id arrays) is that a single line explodes into 4-5 or more 
lines, when it is _already_ plainly obvious to the maintainer what each 
field value represents.

It uses more space without adding value to the maintainer ("I have to 
scroll a lot more to see the same information?  Thanks!").

Once the struct has exploded from one line per entry to bunches, the 
maintainer is then forced to reverse the damage by creating a macro that 
allows the data to shrink again.  Why not just avoid the expand-shrink 
cycle in the first place?  See example below, from drivers/ide/pci/piix.h.

Of course, Art's patch modifies drivers/ide/*, so Bart's opinion on the 
subject is far more important than mine.

	Jeff



#define DECLARE_PIIX_DEV(name_str) \
         {                                              \
                .name           = name_str,             \
                .init_setup     = init_setup_piix,      \
                .init_chipset   = init_chipset_piix,    \
                .init_hwif      = init_hwif_piix,       \
                .channels       = 2,                    \
                .autodma        = AUTODMA,              \
                .enablebits     = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, \
                .bootable       = ON_BOARD,             \
         }

  reply	other threads:[~2004-12-21 21:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-21 20:24 [PATCH] Small initializer patch for ide-disk.c Art Haas
2004-12-21 21:02 ` Jeff Garzik
2004-12-21 21:29   ` John W. Linville
2004-12-21 21:30   ` Art Haas
2004-12-21 21:30   ` Andrew Morton
2004-12-21 21:51     ` Jeff Garzik [this message]
2004-12-21 21:57       ` Randy.Dunlap
2004-12-21 22:01         ` Jeff Garzik
2004-12-21 22:04           ` Randy.Dunlap
2004-12-21 22:21             ` Jeff Garzik
2004-12-21 23:06       ` Bartlomiej Zolnierkiewicz
2004-12-21 21:51     ` Jeff Garzik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41C89ADE.1010403@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=B.Zolnierkiewicz@elka.pw.edu.pl \
    --cc=ahaas@airmail.net \
    --cc=akpm@osdl.org \
    --cc=linux-ide@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).