public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Lord <liml@rtr.ca>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Paul Mackerras <paulus@samba.org>,
	Harvey Harrison <harvey.harrison@gmail.com>,
	linux-arch <linux-arch@vger.kernel.org>,
	Jeff Garzik <jeff@garzik.org>,
	linux-ide <linux-ide@vger.kernel.org>
Subject: Re: [PATCH 05/37] ata: use get/put_endian helpers
Date: Fri, 30 May 2008 09:15:36 -0400	[thread overview]
Message-ID: <483FFDF8.1070607@rtr.ca> (raw)
In-Reply-To: <20080529220450.2f701d93.akpm@linux-foundation.org>

Andrew Morton wrote:
> On Fri, 30 May 2008 14:10:47 +1000 Paul Mackerras <paulus@samba.org> wrote:
> 
>>>> What's the point here?
>>> Readability and maintainability.  Once one becomes familar with a
>>> particular idion like this you can read it and say "ah, I know what
>>> that's doing" rather than having to peer at every character and work it
>>> out at each site where it happens.
>>>
>>> As usual: a PITA now, but better long-term.
>>>
>>> otoh,
>>>
>>> - I think the args are backwards
>> I think you just admitted that the new version is less readable.  At
>> least with an '=' operator you know which side is the thing that's
>> being modified.  With a put_XXX function, I would have to go look up
>> the definition (particularly since outb et al. are also the wrong way
>> around, i.e. have the destination as the second argument).
> 
> Well yes, but you don't have to worry about that when reviewing because
> you know the compiler will catch reversals.
> 
> Still not terribly keen about it all, but geeze the code which it is
> trying to clarify is godawful:
> 
> 	*(__le32 *)(buf + i) = cpu_to_le32(addr);
> 
> wtf?
> 
> Then again the replacement
> 
> 	put_le32(addr, (__le32 *)(buf + i));
> 
> is still wtf.
..

Exactly my point.  With the "improved" version, I now have to go
hunting for yet another macro in yet another header file in order
to see what the code is doing and to verify correctness.
And I (and other reviewers) are just a teensy bit less likely to
follow through with that every time, meaning we'll miss bugs.

This is somewhat akin to Linus's dislike of typedefs for structs.
It just hides what's really going on, for no obvious gain.  Sorry.  :)

Cheers

  parent reply	other threads:[~2008-05-30 13:15 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-29 20:18 [PATCH 05/37] ata: use get/put_endian helpers Harvey Harrison
2008-05-29 20:18 ` Harvey Harrison
2008-05-30  2:26 ` Mark Lord
2008-05-30  2:52   ` Andrew Morton
2008-05-30  3:37     ` Harvey Harrison
2008-05-30  4:08       ` Andrew Morton
2008-05-30  4:08         ` Andrew Morton
2008-05-30  4:14         ` Harvey Harrison
2008-05-30  4:10     ` Paul Mackerras
2008-05-30  4:10       ` Paul Mackerras
2008-05-30  4:18       ` Harvey Harrison
2008-05-30  4:18         ` Harvey Harrison
2008-05-30  5:04       ` Andrew Morton
2008-05-30  5:04         ` Andrew Morton
2008-05-30 13:15         ` Mark Lord [this message]
2008-05-30 13:15           ` Mark Lord

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=483FFDF8.1070607@rtr.ca \
    --to=liml@rtr.ca \
    --cc=akpm@linux-foundation.org \
    --cc=harvey.harrison@gmail.com \
    --cc=jeff@garzik.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=paulus@samba.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