endian: Fix cpu_to_be64 on big-endian
authorJeremy Kerr <jk@ozlabs.org>
Mon, 18 Aug 2014 10:45:39 +0000 (18:45 +0800)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 30 Mar 2015 06:46:32 +0000 (17:16 +1030)
Commit 9e2c88b5 added an extra return (with an unconditional byteswap)
in cpu_to_be64. This breaks on big-endian, where we shouldn't be
byteswapping.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ccan/endian/endian.h

index dc9f62e646df471d3341cedd6db2f5e2928cff36..0c99cc802db0e0acac0668d11d305fe89b4b5aed 100644 (file)
@@ -279,7 +279,6 @@ static inline uint16_t le16_to_cpu(leint16_t le_val)
  */
 static inline beint64_t cpu_to_be64(uint64_t native)
 {
-       return ((ENDIAN_CAST beint64_t)BSWAP_64(native));
        return CPU_TO_BE64(native);
 }