Skip to content

Commit 76969f8

Browse files
LoveKarlssonkartben
authored andcommitted
bluetooth: host: Avoid warning for unaligned access
Rewrote places in the bluetooth code that converts objects larger than one byte by taking the address of an unaligned struct member and changed it to a function that takes the value directly and converts it to big endian. Signed-off-by: Lars-Ove Karlsson <lars-ove.karlsson@iar.com>
1 parent e33606f commit 76969f8

File tree

1 file changed

+2
-2
lines changed
  • subsys/bluetooth/host/classic

1 file changed

+2
-2
lines changed

subsys/bluetooth/host/classic/a2dp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,8 @@ static void bt_a2dp_media_data_callback(struct bt_avdtp_sep *sep, struct net_buf
282282
stream = ep->stream;
283283
media_hdr = net_buf_pull_mem(buf, sizeof(*media_hdr));
284284

285-
stream->ops->recv(stream, buf, sys_get_be16((uint8_t *)&media_hdr->sequence_number),
286-
sys_get_be32((uint8_t *)&media_hdr->time_stamp));
285+
stream->ops->recv(stream, buf, sys_be16_to_cpu(media_hdr->sequence_number),
286+
sys_be32_to_cpu(media_hdr->time_stamp));
287287
}
288288
#endif
289289

0 commit comments

Comments
 (0)