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
From
Date
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    [W:0.549 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site