summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2004-08-11 07:07:12 +0000
committerMarcel Holtmann <marcel@holtmann.org>2004-08-11 07:07:12 +0000
commit8b84723cea240cbd9e55ba2acd683fadb3a79282 (patch)
tree97b650aaf2e575f07ff66d902d9cd8120285bf42 /include
parent1590d5be4605667ca2b405172d99a65c814723b2 (diff)
Use memmove for unaligned access, so gcc does not insert a __builtin_memcpy
Diffstat (limited to 'include')
-rw-r--r--include/bluetooth.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/bluetooth.h b/include/bluetooth.h
index d6359938..e286ffb9 100644
--- a/include/bluetooth.h
+++ b/include/bluetooth.h
@@ -93,10 +93,10 @@ enum {
#define bt_put_unaligned(val, ptr) ((void)( *(ptr) = (val) ))
#else
#define bt_get_unaligned(ptr) \
- ({ __typeof__(*(ptr)) __tmp; memcpy(&__tmp, (ptr), sizeof(*(ptr))); __tmp; })
+ ({ __typeof__(*(ptr)) __tmp; memmove(&__tmp, (ptr), sizeof(*(ptr))); __tmp; })
#define bt_put_unaligned(val, ptr) \
({ __typeof__(*(ptr)) __tmp = (val); \
- memcpy((ptr), &__tmp, sizeof(*(ptr))); \
+ memmove((ptr), &__tmp, sizeof(*(ptr))); \
(void)0; })
#endif