From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Harvey Harrison <harvey.harrison@gmail.com>
Cc: Matthew Wilcox <matthew@wil.cx>,
Andrew Morton <akpm@linux-foundation.org>,
linux-scsi <linux-scsi@vger.kernel.org>
Subject: Re: [RFC PATCH-mm] scsi: use unaligned endian helpers rather than byteshifting
Date: Wed, 03 Dec 2008 14:33:06 -0600 [thread overview]
Message-ID: <1228336386.5551.66.camel@localhost.localdomain> (raw)
In-Reply-To: <1228333043.5412.35.camel@brick>
On Wed, 2008-12-03 at 11:37 -0800, Harvey Harrison wrote:
> Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
> ---
> Depends on the unaligned access work in -mm. Just so you can see what the
> transition would look like. See in particular the READ/WRITE6 bits
> as just reading the full 32 bits and masking ends up being better on
> lots of arches. (x86/powerpc/SH at least)
Well, as I've said before, I'm not particularly interested in moving
SCSI over to the generic accessors. It does look like the proponents of
SCSI specific ones gave up as well (most driver writers even open coded
their own over the u32 one we already have).
However, things like this
> @@ -1479,29 +1480,18 @@ static void io_callback(void *context, struct fib * fibptr)
> switch (scsicmd->cmnd[0]) {
> case WRITE_6:
> case READ_6:
> - lba = ((scsicmd->cmnd[1] & 0x1F) << 16) |
> - (scsicmd->cmnd[2] << 8) | scsicmd->cmnd[3];
> + lba = load_be32_noalign((__be32 *)&scsicmd->cmnd[0]) & 0x1fffff;
> break;
Make me think absolutely no way. It's far less readable than the
original. The first thing that leaps to the mind of any SCSI person
seeing this is what on earth is the opcode doing loaded as part of that
expression. It takes a bit of thought to see it's loaded and then
discarded by the and operation.
James
next prev parent reply other threads:[~2008-12-03 20:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-03 19:37 [RFC PATCH-mm] scsi: use unaligned endian helpers rather than byteshifting Harvey Harrison
2008-12-03 20:15 ` Matthew Wilcox
2008-12-03 20:27 ` Harvey Harrison
2008-12-03 20:33 ` James Bottomley [this message]
2008-12-05 9:07 ` Harvey Harrison
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=1228336386.5551.66.camel@localhost.localdomain \
--to=james.bottomley@hansenpartnership.com \
--cc=akpm@linux-foundation.org \
--cc=harvey.harrison@gmail.com \
--cc=linux-scsi@vger.kernel.org \
--cc=matthew@wil.cx \
/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