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

From: H. Peter Anvin
Date: Thu Mar 20 2008 - 16:08:22 EST


Harvey Harrison wrote:
A common pattern in the kernel (especially networking) is:

le32_to_cpu(get_unaligned((__le32 *)x));

Repeat for various combinations of le/be and 64/32/16 bit. Add
a variant that operates on possibly unaligned pointers to
byteorder/generic.h


This should go in <asm-generic/*> since on some architectures this can be done significantly faster than the chained pattern, since you can get the reordering for "free". Thus, architectures should be able to override the generic.

-hpa
--
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/