diff options
Diffstat (limited to 'include/uapi/linux')
| -rw-r--r-- | include/uapi/linux/swab.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/include/uapi/linux/swab.h b/include/uapi/linux/swab.h index e811474724c2..0e011eb91b5d 100644 --- a/include/uapi/linux/swab.h +++ b/include/uapi/linux/swab.h | |||
| @@ -45,7 +45,9 @@ | |||
| 45 | 45 | ||
| 46 | static inline __attribute_const__ __u16 __fswab16(__u16 val) | 46 | static inline __attribute_const__ __u16 __fswab16(__u16 val) |
| 47 | { | 47 | { |
| 48 | #ifdef __arch_swab16 | 48 | #ifdef __HAVE_BUILTIN_BSWAP16__ |
| 49 | return __builtin_bswap16(val); | ||
| 50 | #elif defined (__arch_swab16) | ||
| 49 | return __arch_swab16(val); | 51 | return __arch_swab16(val); |
| 50 | #else | 52 | #else |
| 51 | return ___constant_swab16(val); | 53 | return ___constant_swab16(val); |
| @@ -54,7 +56,9 @@ static inline __attribute_const__ __u16 __fswab16(__u16 val) | |||
| 54 | 56 | ||
| 55 | static inline __attribute_const__ __u32 __fswab32(__u32 val) | 57 | static inline __attribute_const__ __u32 __fswab32(__u32 val) |
| 56 | { | 58 | { |
| 57 | #ifdef __arch_swab32 | 59 | #ifdef __HAVE_BUILTIN_BSWAP32__ |
| 60 | return __builtin_bswap32(val); | ||
| 61 | #elif defined(__arch_swab32) | ||
| 58 | return __arch_swab32(val); | 62 | return __arch_swab32(val); |
| 59 | #else | 63 | #else |
| 60 | return ___constant_swab32(val); | 64 | return ___constant_swab32(val); |
| @@ -63,7 +67,9 @@ static inline __attribute_const__ __u32 __fswab32(__u32 val) | |||
| 63 | 67 | ||
| 64 | static inline __attribute_const__ __u64 __fswab64(__u64 val) | 68 | static inline __attribute_const__ __u64 __fswab64(__u64 val) |
| 65 | { | 69 | { |
| 66 | #ifdef __arch_swab64 | 70 | #ifdef __HAVE_BUILTIN_BSWAP64__ |
| 71 | return __builtin_bswap64(val); | ||
| 72 | #elif defined (__arch_swab64) | ||
| 67 | return __arch_swab64(val); | 73 | return __arch_swab64(val); |
| 68 | #elif defined(__SWAB_64_THRU_32__) | 74 | #elif defined(__SWAB_64_THRU_32__) |
| 69 | __u32 h = val >> 32; | 75 | __u32 h = val >> 32; |
