From: Harvey Harrison <harvey.harrison@gmail.com>
To: Matthew Wilcox <matthew@wil.cx>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>,
Andrew Morton <akpm@linux-foundation.org>,
Al Viro <viro@ZenIV.linux.org.uk>,
linux-arch <linux-arch@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
linux-scsi <linux-scsi@vger.kernel.org>,
Boaz Harrosh <bharrosh@panasas.com>
Subject: Re: [RFC] Normalizing byteorder/unaligned access API
Date: Tue, 07 Oct 2008 16:39:48 -0700 [thread overview]
Message-ID: <1223422788.8195.45.camel@brick> (raw)
In-Reply-To: <20081007233315.GM25780@parisc-linux.org>
On Tue, 2008-10-07 at 17:33 -0600, Matthew Wilcox wrote:
> On Tue, Oct 07, 2008 at 03:39:25PM -0700, Harvey Harrison wrote:
> > As an example, in the write command handling in achba.c, a patch similar to the following
> > (assumes the existence of a __be24 type somewhere):
>
> What type could be defined to be '__be24'? Would
>
> typedef struct {
> unsigned char data[3];
> } __be24;
__packed
>
> do the trick? It's not an integral type, but I'm not sure if that matters.
>
> > + cmnd_lba = unaligned_be24_to_cpup(&tmp->lba) & 0x001FFFFF;
>
> That might be easier to read if you're using a 500-column terminal. For
> the rest of us,
> cmnd_lba = scsi_get_u24(cmnd + 2) & 0x1FFFFF;
> is much easier to read.
Suggestions welcome on shorter common names for the unaligned helpers.
Cheers,
Harvey
next prev parent reply other threads:[~2008-10-07 23:39 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-07 21:53 [RFC] Normalizing byteorder/unaligned access API Harvey Harrison
2008-10-07 22:12 ` James Bottomley
2008-10-07 22:39 ` Harvey Harrison
2008-10-07 23:33 ` Matthew Wilcox
2008-10-07 23:39 ` Harvey Harrison [this message]
2008-10-08 7:15 ` Geert Uytterhoeven
2008-10-07 23:28 ` Matthew Wilcox
2008-10-07 23:35 ` Harvey Harrison
2008-10-07 23:55 ` Matthew Wilcox
2008-10-08 0:02 ` Harvey Harrison
2008-10-08 7:31 ` Marcel Holtmann
2008-10-08 7:13 ` Geert Uytterhoeven
2008-10-08 7:34 ` 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=1223422788.8195.45.camel@brick \
--to=harvey.harrison@gmail.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=akpm@linux-foundation.org \
--cc=bharrosh@panasas.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=matthew@wil.cx \
--cc=viro@ZenIV.linux.org.uk \
/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