[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <47E2C420.5050008@zytor.com>
Date: Thu, 20 Mar 2008 13:08:00 -0700
From: "H. Peter Anvin" <hpa@...or.com>
To: Harvey Harrison <harvey.harrison@...il.com>
CC: Andrew Morton <akpm@...ux-foundation.org>,
LKML <linux-kernel@...r.kernel.org>,
linux-netdev <netdev@...r.kernel.org>
Subject: Re: [RFC PATCH] kernel: add byteorder macros with alignment fixups
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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists