From: Andrew Morton <akpm@linux-foundation.org>
To: Mark Lord <liml@rtr.ca>
Cc: 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: Thu, 29 May 2008 19:52:25 -0700 [thread overview]
Message-ID: <20080529195225.5665ae9c.akpm@linux-foundation.org> (raw)
In-Reply-To: <483F65CA.4050507@rtr.ca>
On Thu, 29 May 2008 22:26:18 -0400 Mark Lord <liml@rtr.ca> wrote:
> Harvey Harrison wrote:
> > Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
> > ---
> > drivers/ata/pdc_adma.c | 12 ++++++------
> > drivers/ata/sata_qstor.c | 12 +++++-------
> > 2 files changed, 11 insertions(+), 13 deletions(-)
> >
> > diff --git a/drivers/ata/pdc_adma.c b/drivers/ata/pdc_adma.c
> > index be53545..162eecb 100644
> > --- a/drivers/ata/pdc_adma.c
> > +++ b/drivers/ata/pdc_adma.c
> > @@ -284,11 +284,11 @@ static int adma_fill_sg(struct ata_queued_cmd *qc)
> > u32 len;
> >
> > addr = (u32)sg_dma_address(sg);
> > - *(__le32 *)(buf + i) = cpu_to_le32(addr);
> > + put_le32(addr, (__le32 *)(buf + i));
> ..
>
> I don't get it.
>
> 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 don't like the use of the put_*() namespace. It makes it look
like a uaccess operation.
next prev parent reply other threads:[~2008-05-30 2:52 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 [this message]
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
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=20080529195225.5665ae9c.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=harvey.harrison@gmail.com \
--cc=jeff@garzik.org \
--cc=liml@rtr.ca \
--cc=linux-arch@vger.kernel.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