Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH 1/2] Fix wrong parameter order for memcpy in btoh128 function
@ 2011-02-11 17:51 Claudio Takahasi
  2011-02-11 17:51 ` [PATCH 2/2] Add const modifier to avoid wrong usage of byte order functions Claudio Takahasi
  2011-02-11 22:06 ` [PATCH 1/2] Fix wrong parameter order for memcpy in btoh128 function Johan Hedberg
  0 siblings, 2 replies; 3+ messages in thread
From: Claudio Takahasi @ 2011-02-11 17:51 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Claudio Takahasi

---
 lib/sdp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/sdp.c b/lib/sdp.c
index 8a31b55..d5b99d4 100644
--- a/lib/sdp.c
+++ b/lib/sdp.c
@@ -96,7 +96,7 @@ static inline void ntoh128(uint128_t *src, uint128_t *dst)
 
 static inline void btoh128(uint128_t *src, uint128_t *dst)
 {
-	memcpy(src, dst, sizeof(uint128_t));
+	memcpy(dst, src, sizeof(uint128_t));
 }
 
 #endif
-- 
1.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] Add const modifier to avoid wrong usage of byte order functions
  2011-02-11 17:51 [PATCH 1/2] Fix wrong parameter order for memcpy in btoh128 function Claudio Takahasi
@ 2011-02-11 17:51 ` Claudio Takahasi
  2011-02-11 22:06 ` [PATCH 1/2] Fix wrong parameter order for memcpy in btoh128 function Johan Hedberg
  1 sibling, 0 replies; 3+ messages in thread
From: Claudio Takahasi @ 2011-02-11 17:51 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Claudio Takahasi

---
 lib/sdp.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/sdp.c b/lib/sdp.c
index d5b99d4..3e3a8f8 100644
--- a/lib/sdp.c
+++ b/lib/sdp.c
@@ -62,14 +62,14 @@
 
 #if __BYTE_ORDER == __BIG_ENDIAN
 #define ntoh64(x) (x)
-static inline void ntoh128(uint128_t *src, uint128_t *dst)
+static inline void ntoh128(const uint128_t *src, uint128_t *dst)
 {
 	int i;
 	for (i = 0; i < 16; i++)
 		dst->data[i] = src->data[i];
 }
 
-static inline void btoh128(uint128_t *src, uint128_t *dst)
+static inline void btoh128(const uint128_t *src, uint128_t *dst)
 {
 	int i;
 	for (i = 0; i < 16; i++)
@@ -87,14 +87,14 @@ static inline uint64_t ntoh64(uint64_t n)
 	return h;
 }
 
-static inline void ntoh128(uint128_t *src, uint128_t *dst)
+static inline void ntoh128(const uint128_t *src, uint128_t *dst)
 {
 	int i;
 	for (i = 0; i < 16; i++)
 		dst->data[15 - i] = src->data[i];
 }
 
-static inline void btoh128(uint128_t *src, uint128_t *dst)
+static inline void btoh128(const uint128_t *src, uint128_t *dst)
 {
 	memcpy(dst, src, sizeof(uint128_t));
 }
-- 
1.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] Fix wrong parameter order for memcpy in btoh128 function
  2011-02-11 17:51 [PATCH 1/2] Fix wrong parameter order for memcpy in btoh128 function Claudio Takahasi
  2011-02-11 17:51 ` [PATCH 2/2] Add const modifier to avoid wrong usage of byte order functions Claudio Takahasi
@ 2011-02-11 22:06 ` Johan Hedberg
  1 sibling, 0 replies; 3+ messages in thread
From: Johan Hedberg @ 2011-02-11 22:06 UTC (permalink / raw)
  To: Claudio Takahasi; +Cc: linux-bluetooth

Hi Claudio,

On Fri, Feb 11, 2011, Claudio Takahasi wrote:
> ---
>  lib/sdp.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Both patches have been pushed upstream. Thanks.

Johan

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-02-11 22:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-11 17:51 [PATCH 1/2] Fix wrong parameter order for memcpy in btoh128 function Claudio Takahasi
2011-02-11 17:51 ` [PATCH 2/2] Add const modifier to avoid wrong usage of byte order functions Claudio Takahasi
2011-02-11 22:06 ` [PATCH 1/2] Fix wrong parameter order for memcpy in btoh128 function Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox