From 8b84723cea240cbd9e55ba2acd683fadb3a79282 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 11 Aug 2004 07:07:12 +0000 Subject: Use memmove for unaligned access, so gcc does not insert a __builtin_memcpy --- include/bluetooth.h | 4 ++-- 1 file 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 -- cgit