aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/byteorder/little_endian.h
diff options
context:
space:
mode:
authorHarvey Harrison <harvey.harrison@gmail.com>2009-01-06 17:56:21 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-06 21:10:26 -0500
commit991c0e6d1ae3df59f0ddfe05edecec8319e35a1b (patch)
tree3bc3d717b6d3e6a05d07b62738e0605851a7259a /include/linux/byteorder/little_endian.h
parentc89a9f5a42811aa5b2f258e32750c0109f570fc1 (diff)
byteorder: only use linux/swab.h
The first step to make swab.h a regular header that will include an asm/swab.h with arch overrides. Avoid the gratuitous differences introduced in the new linux/swab.h by naming the ___constant_swabXX bits and __fswabXX bits exactly as found in the old implementation in byteorder/swab[b].h Use this new swab.h in byteorder/[big|little]_endian.h and remove the two old swab headers. Although the inclusion of asm/byteorder.h looks strange in linux/swab.h, this will allow each arch to move the actual arch overrides for the swab bits in an asm file and then the includes can be cleaned up without requiring a flag day for all arches at once. Keep providing __fswabXX in case some userspace was using them directly, but the revised __swabXX should be used instead in any new code and will always do constant folding not dependent on the optimization level, which means the __constant versions can be phased out in-kernel. Arches that use the old-style arch macros will lose their optimized versions until they move to the new style, but at least they will still compile. Many arches have already moved and the patches to move the remaining arches are trivial. Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/byteorder/little_endian.h')
-rw-r--r--include/linux/byteorder/little_endian.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/include/linux/byteorder/little_endian.h b/include/linux/byteorder/little_endian.h
index cedc1b5a289..83195fb8296 100644
--- a/include/linux/byteorder/little_endian.h
+++ b/include/linux/byteorder/little_endian.h
@@ -9,8 +9,7 @@
9#endif 9#endif
10 10
11#include <linux/types.h> 11#include <linux/types.h>
12#include <linux/byteorder/swab.h> 12#include <linux/swab.h>
13#include <linux/byteorder/swabb.h>
14 13
15#define __constant_htonl(x) ((__force __be32)___constant_swab32((x))) 14#define __constant_htonl(x) ((__force __be32)___constant_swab32((x)))
16#define __constant_ntohl(x) ___constant_swab32((__force __be32)(x)) 15#define __constant_ntohl(x) ___constant_swab32((__force __be32)(x))