diff options
author | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2012-05-23 03:04:20 -0400 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2012-06-04 23:34:08 -0400 |
commit | c3c7ea65941a0b7a4f1b9655e7aaaab6ce1874d2 (patch) | |
tree | 09643091d66605256524b9c601cd08edf01a4a26 /include | |
parent | fc5fef615a963c8b13abf0bbc2a8e8d7c3fd1ffb (diff) |
Bluetooth: Fix coding style in include/net/bluetooth
Fix all warning and errors reported by checkpatch but license trailing
whitespace and bdaddr_t definition.
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/bluetooth/bluetooth.h | 26 | ||||
-rw-r--r-- | include/net/bluetooth/hci.h | 4 | ||||
-rw-r--r-- | include/net/bluetooth/hci_core.h | 12 |
3 files changed, 23 insertions, 19 deletions
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index b98181bd2b33..7a9f9612db5a 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h | |||
@@ -25,7 +25,7 @@ | |||
25 | #ifndef __BLUETOOTH_H | 25 | #ifndef __BLUETOOTH_H |
26 | #define __BLUETOOTH_H | 26 | #define __BLUETOOTH_H |
27 | 27 | ||
28 | #include <asm/types.h> | 28 | #include <linux/types.h> |
29 | #include <asm/byteorder.h> | 29 | #include <asm/byteorder.h> |
30 | #include <linux/list.h> | 30 | #include <linux/list.h> |
31 | #include <linux/poll.h> | 31 | #include <linux/poll.h> |
@@ -168,8 +168,8 @@ typedef struct { | |||
168 | #define BDADDR_LE_PUBLIC 0x01 | 168 | #define BDADDR_LE_PUBLIC 0x01 |
169 | #define BDADDR_LE_RANDOM 0x02 | 169 | #define BDADDR_LE_RANDOM 0x02 |
170 | 170 | ||
171 | #define BDADDR_ANY (&(bdaddr_t) {{0, 0, 0, 0, 0, 0}}) | 171 | #define BDADDR_ANY (&(bdaddr_t) {{0, 0, 0, 0, 0, 0} }) |
172 | #define BDADDR_LOCAL (&(bdaddr_t) {{0, 0, 0, 0xff, 0xff, 0xff}}) | 172 | #define BDADDR_LOCAL (&(bdaddr_t) {{0, 0, 0, 0xff, 0xff, 0xff} }) |
173 | 173 | ||
174 | /* Copy, swap, convert BD Address */ | 174 | /* Copy, swap, convert BD Address */ |
175 | static inline int bacmp(bdaddr_t *ba1, bdaddr_t *ba2) | 175 | static inline int bacmp(bdaddr_t *ba1, bdaddr_t *ba2) |
@@ -215,7 +215,7 @@ int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
215 | struct msghdr *msg, size_t len, int flags); | 215 | struct msghdr *msg, size_t len, int flags); |
216 | int bt_sock_stream_recvmsg(struct kiocb *iocb, struct socket *sock, | 216 | int bt_sock_stream_recvmsg(struct kiocb *iocb, struct socket *sock, |
217 | struct msghdr *msg, size_t len, int flags); | 217 | struct msghdr *msg, size_t len, int flags); |
218 | uint bt_sock_poll(struct file * file, struct socket *sock, poll_table *wait); | 218 | uint bt_sock_poll(struct file *file, struct socket *sock, poll_table *wait); |
219 | int bt_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); | 219 | int bt_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); |
220 | int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo); | 220 | int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo); |
221 | 221 | ||
@@ -225,12 +225,12 @@ struct sock *bt_accept_dequeue(struct sock *parent, struct socket *newsock); | |||
225 | 225 | ||
226 | /* Skb helpers */ | 226 | /* Skb helpers */ |
227 | struct l2cap_ctrl { | 227 | struct l2cap_ctrl { |
228 | unsigned int sframe : 1, | 228 | unsigned int sframe:1, |
229 | poll : 1, | 229 | poll:1, |
230 | final : 1, | 230 | final:1, |
231 | fcs : 1, | 231 | fcs:1, |
232 | sar : 2, | 232 | sar:2, |
233 | super : 2; | 233 | super:2; |
234 | __u16 reqseq; | 234 | __u16 reqseq; |
235 | __u16 txseq; | 235 | __u16 txseq; |
236 | __u8 retries; | 236 | __u8 retries; |
@@ -249,7 +249,8 @@ static inline struct sk_buff *bt_skb_alloc(unsigned int len, gfp_t how) | |||
249 | { | 249 | { |
250 | struct sk_buff *skb; | 250 | struct sk_buff *skb; |
251 | 251 | ||
252 | if ((skb = alloc_skb(len + BT_SKB_RESERVE, how))) { | 252 | skb = alloc_skb(len + BT_SKB_RESERVE, how); |
253 | if (skb) { | ||
253 | skb_reserve(skb, BT_SKB_RESERVE); | 254 | skb_reserve(skb, BT_SKB_RESERVE); |
254 | bt_cb(skb)->incoming = 0; | 255 | bt_cb(skb)->incoming = 0; |
255 | } | 256 | } |
@@ -261,7 +262,8 @@ static inline struct sk_buff *bt_skb_send_alloc(struct sock *sk, | |||
261 | { | 262 | { |
262 | struct sk_buff *skb; | 263 | struct sk_buff *skb; |
263 | 264 | ||
264 | if ((skb = sock_alloc_send_skb(sk, len + BT_SKB_RESERVE, nb, err))) { | 265 | skb = sock_alloc_send_skb(sk, len + BT_SKB_RESERVE, nb, err); |
266 | if (skb) { | ||
265 | skb_reserve(skb, BT_SKB_RESERVE); | 267 | skb_reserve(skb, BT_SKB_RESERVE); |
266 | bt_cb(skb)->incoming = 0; | 268 | bt_cb(skb)->incoming = 0; |
267 | } | 269 | } |
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index 0bc5555510f3..5de351e49d49 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
@@ -1309,12 +1309,12 @@ static inline struct hci_sco_hdr *hci_sco_hdr(const struct sk_buff *skb) | |||
1309 | } | 1309 | } |
1310 | 1310 | ||
1311 | /* Command opcode pack/unpack */ | 1311 | /* Command opcode pack/unpack */ |
1312 | #define hci_opcode_pack(ogf, ocf) (__u16) ((ocf & 0x03ff)|(ogf << 10)) | 1312 | #define hci_opcode_pack(ogf, ocf) ((__u16) ((ocf & 0x03ff)|(ogf << 10))) |
1313 | #define hci_opcode_ogf(op) (op >> 10) | 1313 | #define hci_opcode_ogf(op) (op >> 10) |
1314 | #define hci_opcode_ocf(op) (op & 0x03ff) | 1314 | #define hci_opcode_ocf(op) (op & 0x03ff) |
1315 | 1315 | ||
1316 | /* ACL handle and flags pack/unpack */ | 1316 | /* ACL handle and flags pack/unpack */ |
1317 | #define hci_handle_pack(h, f) (__u16) ((h & 0x0fff)|(f << 12)) | 1317 | #define hci_handle_pack(h, f) ((__u16) ((h & 0x0fff)|(f << 12))) |
1318 | #define hci_handle(h) (h & 0x0fff) | 1318 | #define hci_handle(h) (h & 0x0fff) |
1319 | #define hci_flags(h) (h >> 12) | 1319 | #define hci_flags(h) (h >> 12) |
1320 | 1320 | ||
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index 6c658fc7ac93..a8ba50d7a81e 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -65,7 +65,7 @@ struct discovery_state { | |||
65 | DISCOVERY_RESOLVING, | 65 | DISCOVERY_RESOLVING, |
66 | DISCOVERY_STOPPING, | 66 | DISCOVERY_STOPPING, |
67 | } state; | 67 | } state; |
68 | struct list_head all; /* All devices found during inquiry */ | 68 | struct list_head all; /* All devices found during inquiry */ |
69 | struct list_head unknown; /* Name state not known */ | 69 | struct list_head unknown; /* Name state not known */ |
70 | struct list_head resolve; /* Name needs to be resolved */ | 70 | struct list_head resolve; /* Name needs to be resolved */ |
71 | __u32 timestamp; | 71 | __u32 timestamp; |
@@ -360,7 +360,8 @@ extern int l2cap_connect_cfm(struct hci_conn *hcon, u8 status); | |||
360 | extern int l2cap_disconn_ind(struct hci_conn *hcon); | 360 | extern int l2cap_disconn_ind(struct hci_conn *hcon); |
361 | extern int l2cap_disconn_cfm(struct hci_conn *hcon, u8 reason); | 361 | extern int l2cap_disconn_cfm(struct hci_conn *hcon, u8 reason); |
362 | extern int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt); | 362 | extern int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt); |
363 | extern int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, u16 flags); | 363 | extern int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, |
364 | u16 flags); | ||
364 | 365 | ||
365 | extern int sco_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr); | 366 | extern int sco_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr); |
366 | extern int sco_connect_cfm(struct hci_conn *hcon, __u8 status); | 367 | extern int sco_connect_cfm(struct hci_conn *hcon, __u8 status); |
@@ -429,8 +430,8 @@ enum { | |||
429 | static inline bool hci_conn_ssp_enabled(struct hci_conn *conn) | 430 | static inline bool hci_conn_ssp_enabled(struct hci_conn *conn) |
430 | { | 431 | { |
431 | struct hci_dev *hdev = conn->hdev; | 432 | struct hci_dev *hdev = conn->hdev; |
432 | return (test_bit(HCI_SSP_ENABLED, &hdev->dev_flags) && | 433 | return test_bit(HCI_SSP_ENABLED, &hdev->dev_flags) && |
433 | test_bit(HCI_CONN_SSP_ENABLED, &conn->flags)); | 434 | test_bit(HCI_CONN_SSP_ENABLED, &conn->flags); |
434 | } | 435 | } |
435 | 436 | ||
436 | static inline void hci_conn_hash_init(struct hci_dev *hdev) | 437 | static inline void hci_conn_hash_init(struct hci_dev *hdev) |
@@ -661,7 +662,8 @@ int hci_get_conn_info(struct hci_dev *hdev, void __user *arg); | |||
661 | int hci_get_auth_info(struct hci_dev *hdev, void __user *arg); | 662 | int hci_get_auth_info(struct hci_dev *hdev, void __user *arg); |
662 | int hci_inquiry(void __user *arg); | 663 | int hci_inquiry(void __user *arg); |
663 | 664 | ||
664 | struct bdaddr_list *hci_blacklist_lookup(struct hci_dev *hdev, bdaddr_t *bdaddr); | 665 | struct bdaddr_list *hci_blacklist_lookup(struct hci_dev *hdev, |
666 | bdaddr_t *bdaddr); | ||
665 | int hci_blacklist_clear(struct hci_dev *hdev); | 667 | int hci_blacklist_clear(struct hci_dev *hdev); |
666 | int hci_blacklist_add(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); | 668 | int hci_blacklist_add(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); |
667 | int hci_blacklist_del(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); | 669 | int hci_blacklist_del(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); |