From: Cyrill Gorcunov Subject: Re: [PATCH 1/2] kernel: add common infrastructure for unaligned access Date: Sat, 12 Apr 2008 00:22:38 +0400 Message-ID: <20080411202238.GB9108@cvg> References: <1207885137.22001.86.camel@brick> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1207885137.22001.86.camel@brick> Sender: linux-arch-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: To: Harvey Harrison Cc: Andrew Morton , LKML , linux-arch , David Howells , Linus Torvalds [Harvey Harrison - Thu, Apr 10, 2008 at 08:38:57PM -0700] [...] | + | +static inline void __put_unaligned_be16(u16 val, u8 *p) | +{ | + *p++ = val >> 8; | + *p++ = val; | +} | + [...] | +static inline void __put_unaligned_le16(u16 val, u8 *p) | +{ | + *p++ = val; | + *p++ = val >> 8; | +} [...] Hi Harvey, do we really need second increments? I mean, wouldn't be better to use *p = val >> 8 and *p << 8? - Cyrill -