Skip to content

Commit

Permalink
Fix up 64-bit byte swaps for most 32-bit architectures
Browse files Browse the repository at this point in the history
The __SWAB_64_THRU_32__ case of a 64-bit byte swap was depending on the
no-longer-existant ___swab32() method (three underscores).  We got rid
of some of the worst indirection and complexity, and now it should just
use the 32-bit swab function that was defined right above it.

Reported-and-tested-by: Nicolas Pitre <nico@cam.org>
Reported-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Linus Torvalds committed Jan 7, 2009
1 parent 637b180 commit ede6f5a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/linux/swab.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ static inline __attribute_const__ __u64 __fswab64(__u64 val)
#elif defined(__SWAB_64_THRU_32__)
__u32 h = val >> 32;
__u32 l = val & ((1ULL << 32) - 1);
return (((__u64)___swab32(l)) << 32) | ((__u64)(___swab32(h)));
return (((__u64)__fswab32(l)) << 32) | ((__u64)(__fswab32(h)));
#else
return ___constant_swab64(val);
#endif
Expand Down

0 comments on commit ede6f5a

Please sign in to comment.