diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2015-01-11 22:33:33 -0500 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2015-01-12 04:26:09 -0500 |
commit | 41e91e71f61ead454c72b68d7c5cf13a2651e992 (patch) | |
tree | 3c40e48d70518ba563157d0b42bf6781c2725fb1 /net/bluetooth | |
parent | d7f72f61955ded6ae5f0381dcde1fcadce8833bb (diff) |
Bluetooth: Replace send_monitor_event with queue_monitor_skb
The send_monitor_event function is essentially the same as the newly
introduced queue_monitor_skb. So instead of having duplicated code,
replace send_monitor_event with queue_monitor_skb.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/hci_sock.c | 30 |
1 files changed, 1 insertions, 29 deletions
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c index 1987ea178b7d..1d65c5be7c82 100644 --- a/net/bluetooth/hci_sock.c +++ b/net/bluetooth/hci_sock.c | |||
@@ -294,34 +294,6 @@ void hci_send_to_monitor(struct hci_dev *hdev, struct sk_buff *skb) | |||
294 | kfree_skb(skb_copy); | 294 | kfree_skb(skb_copy); |
295 | } | 295 | } |
296 | 296 | ||
297 | static void send_monitor_event(struct sk_buff *skb) | ||
298 | { | ||
299 | struct sock *sk; | ||
300 | |||
301 | BT_DBG("len %d", skb->len); | ||
302 | |||
303 | read_lock(&hci_sk_list.lock); | ||
304 | |||
305 | sk_for_each(sk, &hci_sk_list.head) { | ||
306 | struct sk_buff *nskb; | ||
307 | |||
308 | if (sk->sk_state != BT_BOUND) | ||
309 | continue; | ||
310 | |||
311 | if (hci_pi(sk)->channel != HCI_CHANNEL_MONITOR) | ||
312 | continue; | ||
313 | |||
314 | nskb = skb_clone(skb, GFP_ATOMIC); | ||
315 | if (!nskb) | ||
316 | continue; | ||
317 | |||
318 | if (sock_queue_rcv_skb(sk, nskb)) | ||
319 | kfree_skb(nskb); | ||
320 | } | ||
321 | |||
322 | read_unlock(&hci_sk_list.lock); | ||
323 | } | ||
324 | |||
325 | static struct sk_buff *create_monitor_event(struct hci_dev *hdev, int event) | 297 | static struct sk_buff *create_monitor_event(struct hci_dev *hdev, int event) |
326 | { | 298 | { |
327 | struct hci_mon_hdr *hdr; | 299 | struct hci_mon_hdr *hdr; |
@@ -425,7 +397,7 @@ void hci_sock_dev_event(struct hci_dev *hdev, int event) | |||
425 | 397 | ||
426 | skb = create_monitor_event(hdev, event); | 398 | skb = create_monitor_event(hdev, event); |
427 | if (skb) { | 399 | if (skb) { |
428 | send_monitor_event(skb); | 400 | queue_monitor_skb(skb); |
429 | kfree_skb(skb); | 401 | kfree_skb(skb); |
430 | } | 402 | } |
431 | } | 403 | } |