[ccan] [PATCH] endian: Fix cpu_to_be64 on big-endian

Jeremy Kerr jk at ozlabs.org
Mon Aug 18 20:45:39 EST 2014


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 at ozlabs.org>

---
 ccan/endian/endian.h |    1 -
 1 file changed, 1 deletion(-)

diff --git a/ccan/endian/endian.h b/ccan/endian/endian.h
index dc9f62e..0c99cc8 100644
--- a/ccan/endian/endian.h
+++ b/ccan/endian/endian.h
@@ -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);
 }
 


More information about the ccan mailing list