summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZach Brown <zab@redhat.com>2013-08-14 16:16:42 -0700
committerDavid Sterba <dsterba@suse.cz>2013-09-03 19:41:09 +0200
commit1eb159a295261c56d14b962eb3d4763f8ce38807 (patch)
tree7580375b7aaf1e5cfe1ad13cb5ceeaef08590796
parentd1dc0919808b4a80c47ca720e5ff610ed6f4a1b5 (diff)
btrfs-progs: fix unaligned compat endian warnings
The _una_ struct's entire job is to pass an argument to le*_to_cpu. So it's a little embarassing that it uses a native cpu types and generates endian warnings. ctree.h:1616:1: warning: incorrect type in assignment (different base types) ctree.h:1616:1: expected unsigned long long [unsigned] [usertype] x ctree.h:1616:1: got restricted __le64 [usertype] <noident> Signed-off-by: Zach Brown <zab@redhat.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
-rw-r--r--kerncompat.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/kerncompat.h b/kerncompat.h
index ebb54b13..7d57b1b0 100644
--- a/kerncompat.h
+++ b/kerncompat.h
@@ -278,9 +278,9 @@ typedef u64 __bitwise __be64;
#define le16_to_cpu(x) ((__force u16)(__le16)(x))
#endif
-struct __una_u16 { u16 x; } __attribute__((__packed__));
-struct __una_u32 { u32 x; } __attribute__((__packed__));
-struct __una_u64 { u64 x; } __attribute__((__packed__));
+struct __una_u16 { __le16 x; } __attribute__((__packed__));
+struct __una_u32 { __le32 x; } __attribute__((__packed__));
+struct __una_u64 { __le64 x; } __attribute__((__packed__));
#define get_unaligned_le8(p) (*((u8 *)(p)))
#define put_unaligned_le8(val,p) ((*((u8 *)(p))) = (val))