Thread (22 messages) 22 messages, 3 authors, 2012-09-05

[RFC v4 13/18] eir: Use bt_get_* helper functions to access unaligned memory

flat view
STALE5164d

From: Szymon Janc <hidden>
Date: 2012-09-04 14:41:32
Subsystem: the rest · Maintainer: Linus Torvalds

Revision v4 (3 revisions archived).

Revisions (3)
  1. rfc
  2. v2 [diff against previous]
  3. v4 current [diff against previous]
---
 src/eir.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/eir.c b/src/eir.c
index 9d42917..50912a0 100644
--- a/src/eir.c
+++ b/src/eir.c
@@ -55,7 +55,8 @@ static void eir_parse_uuid16(struct eir_data *eir, void *data, uint8_t len)
 
 	service.type = SDP_UUID16;
 	for (i = 0; i < len / 2; i++, uuid16++) {
-		service.value.uuid16 = btohs(bt_get_unaligned(uuid16));
+		service.value.uuid16 = bt_get_le16(uuid16);
+
 		uuid_str = bt_uuid2string(&service);
 		eir->services = g_slist_append(eir->services, uuid_str);
 	}
@@ -70,7 +71,8 @@ static void eir_parse_uuid32(struct eir_data *eir, void *data, uint8_t len)
 
 	service.type = SDP_UUID32;
 	for (i = 0; i < len / 4; i++, uuid32++) {
-		service.value.uuid32 = btohl(bt_get_unaligned(uuid32));
+		service.value.uuid32 = bt_get_le32(uuid32);
+
 		uuid_str = bt_uuid2string(&service);
 		eir->services = g_slist_append(eir->services, uuid_str);
 	}
-- 
1.7.9.5
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help