Add helper to avoid possible unaligned memory access when handling uint64 value using big-endian representation. --- src/shared/util.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/shared/util.h b/src/shared/util.h index baeba91..883b278 100644 --- a/src/shared/util.h +++ b/src/shared/util.h @@ -155,3 +155,8 @@ static inline void put_le64(uint64_t val, const void *ptr) { put_unaligned(cpu_to_le64(val), (uint64_t *) ptr); } + +static inline void put_be64(uint64_t val, const void *ptr) +{ + put_unaligned(cpu_to_be64(val), (uint64_t *) ptr); +} -- 1.8.3.1 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html