aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorHarvey Harrison <harvey.harrison@gmail.com>2008-05-02 19:25:46 -0400
committerDavid S. Miller <davem@davemloft.net>2008-05-02 19:25:46 -0400
commit83985319393973f280ca2a797047780a7955cf19 (patch)
tree438e92affd9c605188404e920b8605670d0d6ab0 /net
parent260ffeed3fd185d29f08e98fb47c09e71bb59cd8 (diff)
bluetooth: use get/put_unaligned_* helpers
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/bnep/core.c8
-rw-r--r--net/bluetooth/hci_event.c9
-rw-r--r--net/bluetooth/hci_sock.c2
-rw-r--r--net/bluetooth/l2cap.c2
4 files changed, 10 insertions, 11 deletions
diff --git a/net/bluetooth/bnep/core.c b/net/bluetooth/bnep/core.c
index 347e935faaf0..f85d94643aaf 100644
--- a/net/bluetooth/bnep/core.c
+++ b/net/bluetooth/bnep/core.c
@@ -135,7 +135,7 @@ static int bnep_ctrl_set_netfilter(struct bnep_session *s, __be16 *data, int len
135 if (len < 2) 135 if (len < 2)
136 return -EILSEQ; 136 return -EILSEQ;
137 137
138 n = ntohs(get_unaligned(data)); 138 n = get_unaligned_be16(data);
139 data++; len -= 2; 139 data++; len -= 2;
140 140
141 if (len < n) 141 if (len < n)
@@ -150,8 +150,8 @@ static int bnep_ctrl_set_netfilter(struct bnep_session *s, __be16 *data, int len
150 int i; 150 int i;
151 151
152 for (i = 0; i < n; i++) { 152 for (i = 0; i < n; i++) {
153 f[i].start = ntohs(get_unaligned(data++)); 153 f[i].start = get_unaligned_be16(data++);
154 f[i].end = ntohs(get_unaligned(data++)); 154 f[i].end = get_unaligned_be16(data++);
155 155
156 BT_DBG("proto filter start %d end %d", 156 BT_DBG("proto filter start %d end %d",
157 f[i].start, f[i].end); 157 f[i].start, f[i].end);
@@ -180,7 +180,7 @@ static int bnep_ctrl_set_mcfilter(struct bnep_session *s, u8 *data, int len)
180 if (len < 2) 180 if (len < 2)
181 return -EILSEQ; 181 return -EILSEQ;
182 182
183 n = ntohs(get_unaligned((__be16 *) data)); 183 n = get_unaligned_be16(data);
184 data += 2; len -= 2; 184 data += 2; len -= 2;
185 185
186 if (len < n) 186 if (len < n)
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 46df2e403df8..6aef8f24e581 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -129,8 +129,7 @@ static void hci_cc_write_link_policy(struct hci_dev *hdev, struct sk_buff *skb)
129 129
130 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(rp->handle)); 130 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(rp->handle));
131 if (conn) { 131 if (conn) {
132 __le16 policy = get_unaligned((__le16 *) (sent + 2)); 132 conn->link_policy = get_unaligned_le16(sent + 2);
133 conn->link_policy = __le16_to_cpu(policy);
134 } 133 }
135 134
136 hci_dev_unlock(hdev); 135 hci_dev_unlock(hdev);
@@ -313,7 +312,7 @@ static void hci_cc_write_voice_setting(struct hci_dev *hdev, struct sk_buff *skb
313 return; 312 return;
314 313
315 if (!status) { 314 if (!status) {
316 __u16 setting = __le16_to_cpu(get_unaligned((__le16 *) sent)); 315 __u16 setting = get_unaligned_le16(sent);
317 316
318 if (hdev->voice_setting != setting) { 317 if (hdev->voice_setting != setting) {
319 hdev->voice_setting = setting; 318 hdev->voice_setting = setting;
@@ -1152,8 +1151,8 @@ static inline void hci_num_comp_pkts_evt(struct hci_dev *hdev, struct sk_buff *s
1152 struct hci_conn *conn; 1151 struct hci_conn *conn;
1153 __u16 handle, count; 1152 __u16 handle, count;
1154 1153
1155 handle = __le16_to_cpu(get_unaligned(ptr++)); 1154 handle = get_unaligned_le16(ptr++);
1156 count = __le16_to_cpu(get_unaligned(ptr++)); 1155 count = get_unaligned_le16(ptr++);
1157 1156
1158 conn = hci_conn_hash_lookup_handle(hdev, handle); 1157 conn = hci_conn_hash_lookup_handle(hdev, handle);
1159 if (conn) { 1158 if (conn) {
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
index 1d36c093523b..747fabd735d2 100644
--- a/net/bluetooth/hci_sock.c
+++ b/net/bluetooth/hci_sock.c
@@ -440,7 +440,7 @@ static int hci_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
440 skb->dev = (void *) hdev; 440 skb->dev = (void *) hdev;
441 441
442 if (bt_cb(skb)->pkt_type == HCI_COMMAND_PKT) { 442 if (bt_cb(skb)->pkt_type == HCI_COMMAND_PKT) {
443 u16 opcode = __le16_to_cpu(get_unaligned((__le16 *) skb->data)); 443 u16 opcode = get_unaligned_le16(skb->data);
444 u16 ogf = hci_opcode_ogf(opcode); 444 u16 ogf = hci_opcode_ogf(opcode);
445 u16 ocf = hci_opcode_ocf(opcode); 445 u16 ocf = hci_opcode_ocf(opcode);
446 446
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index a4849f2c1d81..6e180d255505 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -1827,7 +1827,7 @@ static inline int l2cap_information_rsp(struct l2cap_conn *conn, struct l2cap_cm
1827 del_timer(&conn->info_timer); 1827 del_timer(&conn->info_timer);
1828 1828
1829 if (type == L2CAP_IT_FEAT_MASK) 1829 if (type == L2CAP_IT_FEAT_MASK)
1830 conn->feat_mask = __le32_to_cpu(get_unaligned((__le32 *) rsp->data)); 1830 conn->feat_mask = get_unaligned_le32(rsp->data);
1831 1831
1832 l2cap_conn_start(conn); 1832 l2cap_conn_start(conn);
1833 1833