[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] libxc: remove broken endianess gate on lz4 decompressor



commit fbcc8b292638c07fa114fc904baf0e59a642e7ba
Author:     Roger Pau Monne <roger.pau@xxxxxxxxxx>
AuthorDate: Mon Jun 2 17:08:12 2014 +0200
Commit:     Ian Campbell <ian.campbell@xxxxxxxxxx>
CommitDate: Wed Jun 18 17:18:13 2014 +0100

    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>
    Acked-by: 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
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.