All of lore.kernel.org
 help / color / mirror / Atom feed
From: Szymon Janc <szymon.janc@tieto.com>
To: <linux-bluetooth@vger.kernel.org>
Cc: Szymon Janc <szymon.janc@tieto.com>
Subject: [RFC v2 07/15] rctest: Fix compilation errors due to unaligned memory access
Date: Fri, 31 Aug 2012 14:40:03 +0200	[thread overview]
Message-ID: <1346416811-23484-8-git-send-email-szymon.janc@tieto.com> (raw)
In-Reply-To: <1346416811-23484-1-git-send-email-szymon.janc@tieto.com>

This fix following build errors on ARM.

  CC     test/rctest.o
test/rctest.c: In function do_send:
test/rctest.c:539:4: error: cast increases required alignment of target
	type [-Werror=cast-align]
test/rctest.c:540:4: error: cast increases required alignment of target
	type [-Werror=cast-align]
cc1: all warnings being treated as errors
make[1]: *** [test/rctest.o] Error 1

---
 test/rctest.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/test/rctest.c b/test/rctest.c
index f82d2cc..2dd54de 100644
--- a/test/rctest.c
+++ b/test/rctest.c
@@ -536,8 +536,9 @@ static void do_send(int sk)
 
 	seq = 0;
 	while ((num_frames == -1) || (num_frames-- > 0)) {
-		*(uint32_t *) buf = htobl(seq);
-		*(uint16_t *) (buf + 4) = htobs(data_size);
+		bt_put_le32(seq, buf);
+		bt_put_le16(data_size, buf + 4);
+
 		seq++;
 
 		if (send(sk, buf, data_size, 0) <= 0) {
-- 
1.7.9.5


  parent reply	other threads:[~2012-08-31 12:40 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-31 12:39 [RFC v2 00/15] Unaligned memory access fixes Szymon Janc
2012-08-31 12:39 ` [RFC v2 01/15] lib: Add host order unaligned access functions Szymon Janc
2012-08-31 12:39 ` [RFC v2 02/15] sap-u8500: Fix compile error due to unaligned memory access Szymon Janc
2012-08-31 12:39 ` [RFC v2 03/15] sdp: Use helper functions instead of bt_get_unaligned macro Szymon Janc
2012-08-31 12:40 ` [RFC v2 04/15] Add helper functions for putting integers on unaligned memory address Szymon Janc
2012-08-31 12:40 ` [RFC v2 05/15] sdp: Fix compilation errors due to unaligned memory access Szymon Janc
2012-08-31 12:40 ` [RFC v2 06/15] l2test: " Szymon Janc
2012-08-31 12:40 ` Szymon Janc [this message]
2012-08-31 12:40 ` [RFC v2 08/15] monitor: " Szymon Janc
2012-08-31 12:40 ` [RFC v2 09/15] scotest: " Szymon Janc
2012-08-31 12:40 ` [RFC v2 10/15] avrcp: " Szymon Janc
2012-08-31 12:40 ` [RFC v2 11/15] sap: " Szymon Janc
2012-08-31 12:40 ` [RFC v2 12/15] adaptername: Refactor handle_inotify_cb Szymon Janc
2012-08-31 13:19   ` Anderson Lizardo
2012-08-31 14:25     ` Szymon Janc
2012-08-31 14:29   ` [RFC v3] " Szymon Janc
2012-08-31 12:40 ` [RFC v2 13/15] sdpd-request: Fix build errors due to unaligned memory access Szymon Janc
2012-08-31 12:40 ` [RFC v2 14/15] sdpd-service: " Szymon Janc
2012-08-31 12:40 ` [RFC v2 15/15] hciemu: " Szymon Janc
2012-08-31 15:19   ` Anderson Lizardo
2012-09-03  6:42     ` Szymon Janc

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1346416811-23484-8-git-send-email-szymon.janc@tieto.com \
    --to=szymon.janc@tieto.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.