aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/byteorder/swabb.h
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@stusta.de>2007-02-10 04:46:06 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-11 13:51:34 -0500
commitbfb58478fe2f8cbbb776d910ff3549515e3c8f4f (patch)
tree5ec3b254051c2eb007674454698036ec6bbd3e08 /include/linux/byteorder/swabb.h
parenta9cccd34372f7075e8746395609bc78f0fbaf204 (diff)
[PATCH] cleanup linux/byteorder/swabb.h
- no longer a userspace header - add #include <linux/types.h> for in-kernel compilation Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/byteorder/swabb.h')
-rw-r--r--include/linux/byteorder/swabb.h13
1 files changed, 4 insertions, 9 deletions
diff --git a/include/linux/byteorder/swabb.h b/include/linux/byteorder/swabb.h
index ae5e5f914bf4..8c780c7d779e 100644
--- a/include/linux/byteorder/swabb.h
+++ b/include/linux/byteorder/swabb.h
@@ -25,6 +25,8 @@
25 * 25 *
26 */ 26 */
27 27
28#include <linux/types.h>
29
28#define ___swahw32(x) \ 30#define ___swahw32(x) \
29({ \ 31({ \
30 __u32 __x = (x); \ 32 __u32 __x = (x); \
@@ -77,19 +79,14 @@
77/* 79/*
78 * Allow constant folding 80 * Allow constant folding
79 */ 81 */
80#if defined(__GNUC__) && defined(__OPTIMIZE__) 82#define __swahw32(x) \
81# define __swahw32(x) \
82(__builtin_constant_p((__u32)(x)) ? \ 83(__builtin_constant_p((__u32)(x)) ? \
83 ___swahw32((x)) : \ 84 ___swahw32((x)) : \
84 __fswahw32((x))) 85 __fswahw32((x)))
85# define __swahb32(x) \ 86#define __swahb32(x) \
86(__builtin_constant_p((__u32)(x)) ? \ 87(__builtin_constant_p((__u32)(x)) ? \
87 ___swahb32((x)) : \ 88 ___swahb32((x)) : \
88 __fswahb32((x))) 89 __fswahb32((x)))
89#else
90# define __swahw32(x) __fswahw32(x)
91# define __swahb32(x) __fswahb32(x)
92#endif /* OPTIMIZE */
93 90
94 91
95static inline __u32 __fswahw32(__u32 x) 92static inline __u32 __fswahw32(__u32 x)
@@ -128,13 +125,11 @@ static inline void __swahb32s(__u32 *addr)
128 */ 125 */
129#endif /* __BYTEORDER_HAS_U64__ */ 126#endif /* __BYTEORDER_HAS_U64__ */
130 127
131#if defined(__KERNEL__)
132#define swahw32 __swahw32 128#define swahw32 __swahw32
133#define swahb32 __swahb32 129#define swahb32 __swahb32
134#define swahw32p __swahw32p 130#define swahw32p __swahw32p
135#define swahb32p __swahb32p 131#define swahb32p __swahb32p
136#define swahw32s __swahw32s 132#define swahw32s __swahw32s
137#define swahb32s __swahb32s 133#define swahb32s __swahb32s
138#endif
139 134
140#endif /* _LINUX_BYTEORDER_SWABB_H */ 135#endif /* _LINUX_BYTEORDER_SWABB_H */