[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH v2 06/17] 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à <roger.pau@xxxxxxxxxx> Cc: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx> Cc: Ian Campbell <ian.campbell@xxxxxxxxxx> --- tools/libxc/xc_dom_decompress_lz4.c | 1 - xen/common/lz4/defs.h | 14 -------------- 2 files changed, 0 insertions(+), 15 deletions(-) diff --git a/tools/libxc/xc_dom_decompress_lz4.c b/tools/libxc/xc_dom_decompress_lz4.c index 08272fe..490ec56 100644 --- a/tools/libxc/xc_dom_decompress_lz4.c +++ b/tools/libxc/xc_dom_decompress_lz4.c @@ -1,7 +1,6 @@ #include <stdio.h> #include <stdlib.h> #include <inttypes.h> -#include <endian.h> #include <stdint.h> #include "xg_private.h" diff --git a/xen/common/lz4/defs.h b/xen/common/lz4/defs.h index f46df08..d886a4e 100644 --- a/xen/common/lz4/defs.h +++ b/xen/common/lz4/defs.h @@ -12,7 +12,6 @@ #include <asm/byteorder.h> #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 <asm/unaligned.h> - -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 -- 1.7.7.5 (Apple Git-26) _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |