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>
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
-#include <endian.h>
#include <stdint.h>
#include "xg_private.h"
#include <asm/byteorder.h>
#endif
-#ifdef __LITTLE_ENDIAN
static inline u16 INIT get_unaligned_le16(const void *p)
{
return le16_to_cpup(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