if (len < 2)
return -EILSEQ;
- n = ntohs(get_unaligned(data));
+ n = get_unaligned_be16(data);
data++; len -= 2;
if (len < n)
int i;
for (i = 0; i < n; i++) {
- f[i].start = ntohs(get_unaligned(data++));
- f[i].end = ntohs(get_unaligned(data++));
+ f[i].start = get_unaligned_be16(data++);
+ f[i].end = get_unaligned_be16(data++);
BT_DBG("proto filter start %d end %d",
f[i].start, f[i].end);
if (len < 2)
return -EILSEQ;
- n = ntohs(get_unaligned((__be16 *) data));
+ n = get_unaligned_be16(data);
data += 2; len -= 2;
if (len < n)
conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(rp->handle));
if (conn) {
- __le16 policy = get_unaligned((__le16 *) (sent + 2));
- conn->link_policy = __le16_to_cpu(policy);
+ conn->link_policy = get_unaligned_le16(sent + 2);
}
hci_dev_unlock(hdev);
return;
if (!status) {
- __u16 setting = __le16_to_cpu(get_unaligned((__le16 *) sent));
+ __u16 setting = get_unaligned_le16(sent);
if (hdev->voice_setting != setting) {
hdev->voice_setting = setting;
struct hci_conn *conn;
__u16 handle, count;
- handle = __le16_to_cpu(get_unaligned(ptr++));
- count = __le16_to_cpu(get_unaligned(ptr++));
+ handle = get_unaligned_le16(ptr++);
+ count = get_unaligned_le16(ptr++);
conn = hci_conn_hash_lookup_handle(hdev, handle);
if (conn) {
skb->dev = (void *) hdev;
if (bt_cb(skb)->pkt_type == HCI_COMMAND_PKT) {
- u16 opcode = __le16_to_cpu(get_unaligned((__le16 *) skb->data));
+ u16 opcode = get_unaligned_le16(skb->data);
u16 ogf = hci_opcode_ogf(opcode);
u16 ocf = hci_opcode_ocf(opcode);
del_timer(&conn->info_timer);
if (type == L2CAP_IT_FEAT_MASK)
- conn->feat_mask = __le32_to_cpu(get_unaligned((__le32 *) rsp->data));
+ conn->feat_mask = get_unaligned_le32(rsp->data);
l2cap_conn_start(conn);