Skip to content

Commit bfb5847

Browse files
AdrianBunkLinus Torvalds
authored andcommitted
[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>
1 parent a9cccd3 commit bfb5847

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

include/linux/byteorder/Kbuild

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@ header-y += big_endian.h
22
header-y += little_endian.h
33

44
unifdef-y += generic.h
5-
unifdef-y += swabb.h
65
unifdef-y += swab.h

include/linux/byteorder/swabb.h

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
*
2626
*/
2727

28+
#include <linux/types.h>
29+
2830
#define ___swahw32(x) \
2931
({ \
3032
__u32 __x = (x); \
@@ -77,19 +79,14 @@
7779
/*
7880
* Allow constant folding
7981
*/
80-
#if defined(__GNUC__) && defined(__OPTIMIZE__)
81-
# define __swahw32(x) \
82+
#define __swahw32(x) \
8283
(__builtin_constant_p((__u32)(x)) ? \
8384
___swahw32((x)) : \
8485
__fswahw32((x)))
85-
# define __swahb32(x) \
86+
#define __swahb32(x) \
8687
(__builtin_constant_p((__u32)(x)) ? \
8788
___swahb32((x)) : \
8889
__fswahb32((x)))
89-
#else
90-
# define __swahw32(x) __fswahw32(x)
91-
# define __swahb32(x) __fswahb32(x)
92-
#endif /* OPTIMIZE */
9390

9491

9592
static inline __u32 __fswahw32(__u32 x)
@@ -128,13 +125,11 @@ static inline void __swahb32s(__u32 *addr)
128125
*/
129126
#endif /* __BYTEORDER_HAS_U64__ */
130127

131-
#if defined(__KERNEL__)
132128
#define swahw32 __swahw32
133129
#define swahb32 __swahb32
134130
#define swahw32p __swahw32p
135131
#define swahb32p __swahb32p
136132
#define swahw32s __swahw32s
137133
#define swahb32s __swahb32s
138-
#endif
139134

140135
#endif /* _LINUX_BYTEORDER_SWABB_H */

0 commit comments

Comments
 (0)