Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757383AbYJGXd1 (ORCPT ); Tue, 7 Oct 2008 19:33:27 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754786AbYJGXdS (ORCPT ); Tue, 7 Oct 2008 19:33:18 -0400 Received: from palinux.external.hp.com ([192.25.206.14]:37638 "EHLO mail.parisc-linux.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752129AbYJGXdR (ORCPT ); Tue, 7 Oct 2008 19:33:17 -0400 Date: Tue, 7 Oct 2008 17:33:16 -0600 From: Matthew Wilcox To: Harvey Harrison Cc: James Bottomley , Andrew Morton , Al Viro , linux-arch , LKML , linux-scsi , Boaz Harrosh Subject: Re: [RFC] Normalizing byteorder/unaligned access API Message-ID: <20081007233315.GM25780@parisc-linux.org> References: <1223416391.8195.22.camel@brick> <1223417543.7484.7.camel@localhost.localdomain> <1223419166.8195.37.camel@brick> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1223419166.8195.37.camel@brick> User-Agent: Mutt/1.5.13 (2006-08-11) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1086 Lines: 29 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/