]> xenbits.xensource.com Git - xen.git/commitdiff
libxc: remove broken endianess gate on lz4 decompressor
authorRoger Pau Monne <roger.pau@citrix.com>
Mon, 2 Jun 2014 15:08:12 +0000 (17:08 +0200)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 18 Jun 2014 16:18:13 +0000 (17:18 +0100)
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@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxc/xc_dom_decompress_lz4.c
xen/common/lz4/defs.h

index 08272fe41fdbbe488ac8df0740cada43f99fbcf3..490ec562064e6bb870233369eab9f4b3b4f9fe53 100644 (file)
@@ -1,7 +1,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <inttypes.h>
-#include <endian.h>
 #include <stdint.h>
 
 #include "xg_private.h"
index f46df0884eac3241c2005bbf677657c01677e2e6..d886a4e122b86c660ae7bd14e5c2fe08179923a2 100644 (file)
@@ -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