[PATCH 3/3] Bluetooth: Use advertising cache thread-safe functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch replaces some advertising cache unsafe function calls
by its thread-safe versions where applicable.

Signed-off-by: Andre Guedes <aguedespe@xxxxxxxxx>
---
 net/bluetooth/hci_core.c  |    6 +-----
 net/bluetooth/hci_event.c |    6 +-----
 2 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 536248d..24b7621 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1532,11 +1532,7 @@ static void hci_clear_adv_cache(struct work_struct *work)
 	struct hci_dev *hdev = container_of(work, struct hci_dev,
 							adv_work.work);
 
-	hci_dev_lock(hdev);
-
-	__hci_adv_entries_clear(hdev);
-
-	hci_dev_unlock(hdev);
+	hci_adv_entries_clear(hdev);
 }
 
 /* Must be holding hdev->lock */
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 6808069..3933ccd 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -3255,12 +3255,10 @@ static inline void hci_le_adv_report_evt(struct hci_dev *hdev,
 	void *ptr = &skb->data[1];
 	s8 rssi;
 
-	hci_dev_lock(hdev);
-
 	while (num_reports--) {
 		struct hci_ev_le_advertising_info *ev = ptr;
 
-		__hci_add_adv_entry(hdev, ev);
+		hci_add_adv_entry(hdev, ev);
 
 		rssi = ev->data[ev->length];
 		mgmt_device_found(hdev, &ev->bdaddr, LE_LINK, ev->bdaddr_type,
@@ -3268,8 +3266,6 @@ static inline void hci_le_adv_report_evt(struct hci_dev *hdev,
 
 		ptr += sizeof(*ev) + ev->length + 1;
 	}
-
-	hci_dev_unlock(hdev);
 }
 
 static inline void hci_le_ltk_request_evt(struct hci_dev *hdev,
-- 
1.7.9

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux