linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Randy.Dunlap" <rddunlap@osdl.org>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: Andrew Morton <akpm@osdl.org>,
	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 13:57:55 -0800	[thread overview]
Message-ID: <41C89C63.8090708@osdl.org> (raw)
In-Reply-To: <41C89ADE.1010403@pobox.com>

Jeff Garzik wrote:
> 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.

I like to see the field names listed too.

But the real question to me (other than "will some old-style
initializers be deprecated by gcc in the future?") is
"who will read such initializers?".  I don't think that it
hurts readabiility by/for the maintainer(s) but it does help
readability for the rest of us.  IMHO obviously.

-- 
~Randy

  reply	other threads:[~2004-12-21 21:59 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
2004-12-21 21:57       ` Randy.Dunlap [this message]
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=41C89C63.8090708@osdl.org \
    --to=rddunlap@osdl.org \
    --cc=B.Zolnierkiewicz@elka.pw.edu.pl \
    --cc=ahaas@airmail.net \
    --cc=akpm@osdl.org \
    --cc=jgarzik@pobox.com \
    --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).