]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/vstructs.h
Update bcachefs sources to 8ffb42b3d0 bcachefs: Finish writing journal after journal...
[bcachefs-tools-debian] / libbcachefs / vstructs.h
index ce2cece0d0cb8672b9953659625a18410e80e973..53a694d71967196ad2784f89da5ea5c3966644a1 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 #ifndef _VSTRUCTS_H
 #define _VSTRUCTS_H
 
  */
 #define __vstruct_u64s(_s)                                             \
 ({                                                                     \
-       ( type_is((_s)->u64s, u64) ? le64_to_cpu((_s)->u64s)            \
-       : type_is((_s)->u64s, u32) ? le32_to_cpu((_s)->u64s)            \
-       : type_is((_s)->u64s, u16) ? le16_to_cpu((_s)->u64s)            \
-       : ((_s)->u64s));                                                \
+       ( type_is((_s)->u64s, u64) ? le64_to_cpu((__force __le64) (_s)->u64s)           \
+       : type_is((_s)->u64s, u32) ? le32_to_cpu((__force __le32) (_s)->u64s)           \
+       : type_is((_s)->u64s, u16) ? le16_to_cpu((__force __le16) (_s)->u64s)           \
+       : ((__force u8) ((_s)->u64s)));                                         \
 })
 
 #define __vstruct_bytes(_type, _u64s)                                  \
 ({                                                                     \
        BUILD_BUG_ON(offsetof(_type, _data) % sizeof(u64));             \
                                                                        \
-       (offsetof(_type, _data) + (_u64s) * sizeof(u64));               \
+       (size_t) (offsetof(_type, _data) + (_u64s) * sizeof(u64));      \
 })
 
 #define vstruct_bytes(_s)                                              \