diff mbox

[1/3] btrfs-progs: kerncompat: introduce get_unaligned helpers

Message ID 1e55bd34e72df64877490d68abf9e1eedf023e4b.1462291729.git.dsterba@suse.com (mailing list archive)
State Accepted
Headers show

Commit Message

David Sterba May 3, 2016, 4:12 p.m. UTC
Signed-off-by: David Sterba <dsterba@suse.com>
---
 kerncompat.h | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox

Patch

diff --git a/kerncompat.h b/kerncompat.h
index ee65aa72ad6d..574f468226c2 100644
--- a/kerncompat.h
+++ b/kerncompat.h
@@ -334,12 +334,16 @@  struct __una_u32 { __le32 x; } __attribute__((__packed__));
 struct __una_u64 { __le64 x; } __attribute__((__packed__));
 
 #define get_unaligned_le8(p) (*((u8 *)(p)))
+#define get_unaligned_8(p) (*((u8 *)(p)))
 #define put_unaligned_le8(val,p) ((*((u8 *)(p))) = (val))
 #define get_unaligned_le16(p) le16_to_cpu(((const struct __una_u16 *)(p))->x)
+#define get_unaligned_16(p) (((const struct __una_u16 *)(p))->x)
 #define put_unaligned_le16(val,p) (((struct __una_u16 *)(p))->x = cpu_to_le16(val))
 #define get_unaligned_le32(p) le32_to_cpu(((const struct __una_u32 *)(p))->x)
+#define get_unaligned_32(p) (((const struct __una_u32 *)(p))->x)
 #define put_unaligned_le32(val,p) (((struct __una_u32 *)(p))->x = cpu_to_le32(val))
 #define get_unaligned_le64(p) le64_to_cpu(((const struct __una_u64 *)(p))->x)
+#define get_unaligned_64(p) (((const struct __una_u64 *)(p))->x)
 #define put_unaligned_le64(val,p) (((struct __una_u64 *)(p))->x = cpu_to_le64(val))
 
 #ifndef true