mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
Bluetooth: Simplify UUIDs clearing code
The code for clearing the UUIDs list can be simplified by using list_for_each_entry_safe instead of list_for_each_safe. Signed-off-by: Johan Hedberg <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
This commit is contained in:
parent
de66aa6305
commit
4821002ce2
1 changed files with 3 additions and 7 deletions
|
|
@ -1183,14 +1183,10 @@ static void hci_discov_off(struct work_struct *work)
|
|||
|
||||
int hci_uuids_clear(struct hci_dev *hdev)
|
||||
{
|
||||
struct list_head *p, *n;
|
||||
struct bt_uuid *uuid, *tmp;
|
||||
|
||||
list_for_each_safe(p, n, &hdev->uuids) {
|
||||
struct bt_uuid *uuid;
|
||||
|
||||
uuid = list_entry(p, struct bt_uuid, list);
|
||||
|
||||
list_del(p);
|
||||
list_for_each_entry_safe(uuid, tmp, &hdev->uuids, list) {
|
||||
list_del(&uuid->list);
|
||||
kfree(uuid);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue