[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20081007233315.GM25780@parisc-linux.org>
Date: Tue, 7 Oct 2008 17:33:16 -0600
From: Matthew Wilcox <matthew@....cx>
To: Harvey Harrison <harvey.harrison@...il.com>
Cc: James Bottomley <James.Bottomley@...senPartnership.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Al Viro <viro@...IV.linux.org.uk>,
linux-arch <linux-arch@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
linux-scsi <linux-scsi@...r.kernel.org>,
Boaz Harrosh <bharrosh@...asas.com>
Subject: Re: [RFC] Normalizing byteorder/unaligned access API
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;
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.
--
Matthew Wilcox Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours. We can't possibly take such
a retrograde step."
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists