Re: [PATCH 1/2] kernel: add common infrastructure for unaligned access

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Cyrill Gorcunov
Date: Friday, April 11, 2008 - 1:22 pm

[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 -
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 1/2] kernel: add common infrastructure for unal ..., Cyrill Gorcunov, (Fri Apr 11, 1:22 pm)