diff options
| author | Harvey Harrison <harvey.harrison@gmail.com> | 2008-10-18 23:28:36 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-20 11:52:40 -0400 |
| commit | acf0108a84edae22b99655eb2f6f6c9f7ec4d449 (patch) | |
| tree | bfd93125ccff25c774c2e4d71a8ba537312950ab | |
| parent | b8e465f4945bc0e9f324e3bbe15f5180a8e9a6fe (diff) | |
byteorder: use generic C version for value byteswapping
This makes the new implementation of the byteorder helpers match the old
in how it degraded when an arch-defined version was not available:
1) swab()
- look for arch defined
- if not, use generic c version
2) swabp()
- look for arch-defined
- if not, deref pointer and use swab()
3) swabs()
- look for arch defined
- if not, use swabp
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
| -rw-r--r-- | include/linux/swab.h | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/include/linux/swab.h b/include/linux/swab.h index 270d5c208a89..bbed279f3b32 100644 --- a/include/linux/swab.h +++ b/include/linux/swab.h | |||
| @@ -47,8 +47,6 @@ static inline __attribute_const__ __u16 ___swab16(__u16 val) | |||
| 47 | { | 47 | { |
| 48 | #ifdef __arch_swab16 | 48 | #ifdef __arch_swab16 |
| 49 | return __arch_swab16(val); | 49 | return __arch_swab16(val); |
| 50 | #elif defined(__arch_swab16p) | ||
| 51 | return __arch_swab16p(&val); | ||
| 52 | #else | 50 | #else |
| 53 | return __const_swab16(val); | 51 | return __const_swab16(val); |
| 54 | #endif | 52 | #endif |
| @@ -58,8 +56,6 @@ static inline __attribute_const__ __u32 ___swab32(__u32 val) | |||
| 58 | { | 56 | { |
| 59 | #ifdef __arch_swab32 | 57 | #ifdef __arch_swab32 |
| 60 | return __arch_swab32(val); | 58 | return __arch_swab32(val); |
| 61 | #elif defined(__arch_swab32p) | ||
| 62 | return __arch_swab32p(&val); | ||
| 63 | #else | 59 | #else |
| 64 | return __const_swab32(val); | 60 | return __const_swab32(val); |
| 65 | #endif | 61 | #endif |
| @@ -69,8 +65,6 @@ static inline __attribute_const__ __u64 ___swab64(__u64 val) | |||
| 69 | { | 65 | { |
| 70 | #ifdef __arch_swab64 | 66 | #ifdef __arch_swab64 |
| 71 | return __arch_swab64(val); | 67 | return __arch_swab64(val); |
| 72 | #elif defined(__arch_swab64p) | ||
| 73 | return __arch_swab64p(&val); | ||
| 74 | #elif defined(__SWAB_64_THRU_32__) | 68 | #elif defined(__SWAB_64_THRU_32__) |
| 75 | __u32 h = val >> 32; | 69 | __u32 h = val >> 32; |
| 76 | __u32 l = val & ((1ULL << 32) - 1); | 70 | __u32 l = val & ((1ULL << 32) - 1); |
| @@ -84,8 +78,6 @@ static inline __attribute_const__ __u32 ___swahw32(__u32 val) | |||
| 84 | { | 78 | { |
| 85 | #ifdef __arch_swahw32 | 79 | #ifdef __arch_swahw32 |
| 86 | return __arch_swahw32(val); | 80 | return __arch_swahw32(val); |
| 87 | #elif defined(__arch_swahw32p) | ||
| 88 | return __arch_swahw32p(&val); | ||
| 89 | #else | 81 | #else |
| 90 | return __const_swahw32(val); | 82 | return __const_swahw32(val); |
| 91 | #endif | 83 | #endif |
| @@ -95,8 +87,6 @@ static inline __attribute_const__ __u32 ___swahb32(__u32 val) | |||
| 95 | { | 87 | { |
| 96 | #ifdef __arch_swahb32 | 88 | #ifdef __arch_swahb32 |
| 97 | return __arch_swahb32(val); | 89 | return __arch_swahb32(val); |
| 98 | #elif defined(__arch_swahb32p) | ||
| 99 | return __arch_swahb32p(&val); | ||
| 100 | #else | 90 | #else |
| 101 | return __const_swahb32(val); | 91 | return __const_swahb32(val); |
| 102 | #endif | 92 | #endif |
