Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Adrian Bunk and committed by
Linus Torvalds
bfb58478 a9cccd34

+4 -10
-1
include/linux/byteorder/Kbuild
··· 2 2 header-y += little_endian.h 3 3 4 4 unifdef-y += generic.h 5 - unifdef-y += swabb.h 6 5 unifdef-y += swab.h
+4 -9
include/linux/byteorder/swabb.h
··· 25 25 * 26 26 */ 27 27 28 + #include <linux/types.h> 29 + 28 30 #define ___swahw32(x) \ 29 31 ({ \ 30 32 __u32 __x = (x); \ ··· 79 77 /* 80 78 * Allow constant folding 81 79 */ 82 - #if defined(__GNUC__) && defined(__OPTIMIZE__) 83 - # define __swahw32(x) \ 80 + #define __swahw32(x) \ 84 81 (__builtin_constant_p((__u32)(x)) ? \ 85 82 ___swahw32((x)) : \ 86 83 __fswahw32((x))) 87 - # define __swahb32(x) \ 84 + #define __swahb32(x) \ 88 85 (__builtin_constant_p((__u32)(x)) ? \ 89 86 ___swahb32((x)) : \ 90 87 __fswahb32((x))) 91 - #else 92 - # define __swahw32(x) __fswahw32(x) 93 - # define __swahb32(x) __fswahb32(x) 94 - #endif /* OPTIMIZE */ 95 88 96 89 97 90 static inline __u32 __fswahw32(__u32 x) ··· 125 128 */ 126 129 #endif /* __BYTEORDER_HAS_U64__ */ 127 130 128 - #if defined(__KERNEL__) 129 131 #define swahw32 __swahw32 130 132 #define swahb32 __swahb32 131 133 #define swahw32p __swahw32p 132 134 #define swahb32p __swahb32p 133 135 #define swahw32s __swahw32s 134 136 #define swahb32s __swahb32s 135 - #endif 136 137 137 138 #endif /* _LINUX_BYTEORDER_SWABB_H */