Thread (23 messages) 23 messages, 4 authors, 2012-09-03

[RFC 15/15] hciemu: Fix build errors due to unaligned memory access

flat view
STALE5164d SUPERSEDED

From: Szymon Janc <hidden>
Date: 2012-08-31 08:36:25
Subsystem: the rest · Maintainer: Linus Torvalds

Revision rfc of 3 in this series.

Revisions (3)
  1. rfc current
  2. v2 [diff vs current]
  3. v4 [diff vs current]
This fix following build errors on ARM.

  CC     test/hciemu.o
test/hciemu.c: In function num_completed_pkts:
test/hciemu.c:429:4: error: cast increases required alignment of target
	 type [-Werror=cast-align]
test/hciemu.c:430:4: error: cast increases required alignment of target
	type [-Werror=cast-align]
cc1: all warnings being treated as errors
make[1]: *** [test/hciemu.o] Error 1
make: *** [all] Error 2

Change-Id: Ica73d897065bf1116ee8a7052c169a1a3ba25ff7
---
 test/hciemu.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/test/hciemu.c b/test/hciemu.c
index 4c62223..8e31dbb 100644
--- a/test/hciemu.c
+++ b/test/hciemu.c
@@ -426,8 +426,10 @@ static void num_completed_pkts(struct vhci_conn *conn)
 	np = (void *) ptr; ptr += EVT_NUM_COMP_PKTS_SIZE;
 	np->num_hndl = 1;
 
-	*((uint16_t *) ptr) = htobs(conn->handle); ptr += 2;
-	*((uint16_t *) ptr) = htobs(vdev.acl_cnt); ptr += 2;
+	bt_put_be16(conn->handle, ptr);
+	ptr += 2;
+	bt_put_be16(vdev.acl_cnt, ptr);
+	ptr += 2;
 
 	write_snoop(vdev.dd, HCI_EVENT_PKT, 1, buf, ptr - buf);
 
-- 
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