Thread (97 messages) flat view 97 messages, 4 authors, 2014-03-25
STALE4526d

[PATCH BlueZ v0 01/62] shared: Add put_le64()

From: Claudio Takahasi <hidden>
Date: 2014-03-20 14:42:26
Subsystem: the rest · Maintainer: Linus Torvalds

Add helper to avoid possible unaligned memory access when handling
uint64 value using little-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 f9170bb..a129272 100644
--- a/src/shared/util.h
+++ b/src/shared/util.h
@@ -110,3 +110,8 @@ static inline void put_le32(uint32_t val, void *dst)
 {
 	put_unaligned(cpu_to_le32(val), (uint32_t *) dst);
 }
+
+static inline void put_le64(uint64_t val, const void *ptr)
+{
+	put_unaligned(cpu_to_le64(val), (uint64_t *) ptr);
+}
-- 
1.8.3.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help