提交 f53c20e9 编写于 作者: D David Herrmann 提交者: Gustavo Padovan

Bluetooth: allow constant arguments for bacmp()/bacpy()

There is no reason to require the source arguments to be writeable so fix
this to allow constant source addresses.
Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
Acked-by: NMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: NGustavo Padovan <gustavo.padovan@collabora.co.uk>
上级 e3492dc3
...@@ -193,11 +193,11 @@ static inline bool bdaddr_type_is_le(__u8 type) ...@@ -193,11 +193,11 @@ static inline bool bdaddr_type_is_le(__u8 type)
#define BDADDR_LOCAL (&(bdaddr_t) {{0, 0, 0, 0xff, 0xff, 0xff} }) #define BDADDR_LOCAL (&(bdaddr_t) {{0, 0, 0, 0xff, 0xff, 0xff} })
/* Copy, swap, convert BD Address */ /* Copy, swap, convert BD Address */
static inline int bacmp(bdaddr_t *ba1, bdaddr_t *ba2) static inline int bacmp(const bdaddr_t *ba1, const bdaddr_t *ba2)
{ {
return memcmp(ba1, ba2, sizeof(bdaddr_t)); return memcmp(ba1, ba2, sizeof(bdaddr_t));
} }
static inline void bacpy(bdaddr_t *dst, bdaddr_t *src) static inline void bacpy(bdaddr_t *dst, const bdaddr_t *src)
{ {
memcpy(dst, src, sizeof(bdaddr_t)); memcpy(dst, src, sizeof(bdaddr_t));
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册