lkml.org 
[lkml]   [2008]   [May]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC-PATCH] lib: add byteorder helpers for the aligned case
FromHarvey Harrison <>
DateFri, 16 May 2008 17:37:56 -0700
On Fri, 2008-05-16 at 20:35 -0400, Alan Stern wrote:
> On Fri, 16 May 2008, Harvey Harrison wrote:
>
> > +static inline void put_le16(u16 val, void *ptr)
> > +{
> > + *(__le16 *)ptr = cpu_to_le16(val);
> > +}
>
> Is this able to do the byte rearrangement at compile time if val is a
> compile-time constant? I imagine it would.
>

Yes, the cpu_to_le/be functions to get optimized if they are passed a
compile time constant.


Harvey



\
 
 \ /
  Last update: 2008-05-17 02:41    [from the cache]
©2003-2010