Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1725339

[PATCH 1/2] Bluetooth: make baswap src const

From Bjorn Andersson <bjorn.andersson@linaro.org>
Newsgroups linux.kernel
Subject [PATCH 1/2] Bluetooth: make baswap src const
Date 2017-09-01 22:50 +0200
Message-ID <ul134-1I4-19@gated-at.bofh.it> (permalink)
References <ul134-1I4-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Loic Poulain <loic.poulain@linaro.org>

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---
 include/net/bluetooth/bluetooth.h | 2 +-
 net/bluetooth/lib.c               | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
index 01487192f628..020142bb9735 100644
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -233,7 +233,7 @@ static inline void bacpy(bdaddr_t *dst, const bdaddr_t *src)
 	memcpy(dst, src, sizeof(bdaddr_t));
 }
 
-void baswap(bdaddr_t *dst, bdaddr_t *src);
+void baswap(bdaddr_t *dst, const bdaddr_t *src);
 
 /* Common socket structures and functions */
 
diff --git a/net/bluetooth/lib.c b/net/bluetooth/lib.c
index aa4cf64e32a6..6048cc07568b 100644
--- a/net/bluetooth/lib.c
+++ b/net/bluetooth/lib.c
@@ -30,10 +30,10 @@
 
 #include <net/bluetooth/bluetooth.h>
 
-void baswap(bdaddr_t *dst, bdaddr_t *src)
+void baswap(bdaddr_t *dst, const bdaddr_t *src)
 {
+	const unsigned char *s = (const unsigned char *)src;
 	unsigned char *d = (unsigned char *) dst;
-	unsigned char *s = (unsigned char *) src;
 	unsigned int i;
 
 	for (i = 0; i < 6; i++)
-- 
2.12.0

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/2] btqcomsmd: Allow specifying board mac address Bjorn Andersson <bjorn.andersson@linaro.org> - 2017-09-01 22:50 +0200
  [PATCH 1/2] Bluetooth: make baswap src const Bjorn Andersson <bjorn.andersson@linaro.org> - 2017-09-01 22:50 +0200
    Re: [PATCH 1/2] Bluetooth: make baswap src const Marcel Holtmann <marcel@holtmann.org> - 2017-09-01 23:00 +0200

csiph-web