[RFC 2/7] Use memcpy to convert from network to host order on BE hosts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 lib/bluetooth.h |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/lib/bluetooth.h b/lib/bluetooth.h
index bc020ad..d8f36f8 100644
--- a/lib/bluetooth.h
+++ b/lib/bluetooth.h
@@ -127,9 +127,7 @@ static inline void btoh128(const uint128_t *src, uint128_t *dst)
 #define ntoh64(x) (x)
 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];
+	memcpy(dst, src, sizeof(uint128_t));
 }
 
 static inline void btoh128(const uint128_t *src, uint128_t *dst)
-- 
1.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux