Messages in this thread | | | Subject | Re: [RFC-PATCH] lib: add byteorder helpers for the aligned case | From | Harvey Harrison <> | Date | Fri, 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
| |