From: Roger Pau Monne Date: Mon, 2 Jun 2014 15:08:12 +0000 (+0200) Subject: libxc: remove broken endianess gate on lz4 decompressor X-Git-Tag: 4.5.0-rc1~664 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=fbcc8b292638c07fa114fc904baf0e59a642e7ba;p=xen.git libxc: remove broken endianess gate on lz4 decompressor The lz4 decompressor had wrongly implemented a gate between little-endian and big-endian versions of get_unaligned_le{16/32}, which turns out to be broken on all architectures supported by Xen, because __LITTLE_ENDIAN is not defined. Instead of trying to fix this, just implement the little-endian version and remove the switch. Signed-off-by: Roger Pau Monné Cc: Ian Jackson Acked-by: Ian Campbell --- diff --git a/tools/libxc/xc_dom_decompress_lz4.c b/tools/libxc/xc_dom_decompress_lz4.c index 08272fe41f..490ec56206 100644 --- a/tools/libxc/xc_dom_decompress_lz4.c +++ b/tools/libxc/xc_dom_decompress_lz4.c @@ -1,7 +1,6 @@ #include #include #include -#include #include #include "xg_private.h" diff --git a/xen/common/lz4/defs.h b/xen/common/lz4/defs.h index f46df0884e..d886a4e122 100644 --- a/xen/common/lz4/defs.h +++ b/xen/common/lz4/defs.h @@ -12,7 +12,6 @@ #include #endif -#ifdef __LITTLE_ENDIAN static inline u16 INIT get_unaligned_le16(const void *p) { return le16_to_cpup(p); @@ -22,19 +21,6 @@ static inline u32 INIT get_unaligned_le32(const void *p) { return le32_to_cpup(p); } -#else -#include - -static inline u16 INIT get_unaligned_le16(const void *p) -{ - return le16_to_cpu(__get_unaligned(p, 2)); -} - -static inline u32 INIT get_unaligned_le32(void *p) -{ - return le32_to_cpu(__get_unaligned(p, 4)); -} -#endif /* * Detects 64 bits mode