aboutsummaryrefslogtreecommitdiffstats
path: root/kerncompat.h
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2016-07-27 23:13:09 +0200
committerDavid Sterba <dsterba@suse.com>2016-07-28 14:08:30 +0200
commit1c47e5b03922772c1a9429c7817cc728c99e2530 (patch)
treef9fe3b4ef12fdd63118ce91336c1bf3dfd24e001 /kerncompat.h
parent7ce43670dab828aa377072189ff1599173f1d7ed (diff)
downloadbtrfs-progs-1c47e5b03922772c1a9429c7817cc728c99e2530.tar.gz
btrfs-progs-1c47e5b03922772c1a9429c7817cc728c99e2530.tar.xz
btrfs-progs-1c47e5b03922772c1a9429c7817cc728c99e2530.zip
btrfs-progs: kerncompat: introduce put_unaligned_x helpers
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'kerncompat.h')
-rw-r--r--kerncompat.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/kerncompat.h b/kerncompat.h
index c9b9b79..8b9a84c 100644
--- a/kerncompat.h
+++ b/kerncompat.h
@@ -337,15 +337,19 @@ 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 put_unaligned_8(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 put_unaligned_16(val,p) (((struct __una_u16 *)(p))->x = (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 put_unaligned_32(val,p) (((struct __una_u32 *)(p))->x = (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))
+#define put_unaligned_64(val,p) (((struct __una_u64 *)(p))->x = (val))
#ifndef true
#define true 1