Re: [RFC PATCH] kernel: add byteorder macros with alignment fixups

From: Harvey Harrison
Date: Mon Mar 24 2008 - 12:36:01 EST


On Sun, 2008-03-23 at 14:59 +0100, Pavel Machek wrote:
> On Thu 2008-03-20 12:22:33, Harvey Harrison wrote:
> > +#ifdef __KERNEL__
> > +
> > +static inline u64 le64_to_cpu_unaligned(void *p)
> > +{
> > + return __le64_to_cpu(get_unaligned((__le64 *)p));
> > +}
>
> Why the cast? Should le64_to_cpu() take __le64 * parameter, so that normal
> typechecking still works?
> Pavel

Well, most places that would use this have a char *, or a u8 * so I was
avoiding a cast in most callers.

HPA made a good suggestion about this being in asm-generic allowing
arches to optimize this, so I'm reworking with that approach.

Harvey

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/