Skip to content

Commit

Permalink
Bluetooth: Simplify UUIDs clearing code
Browse files Browse the repository at this point in the history
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 <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
  • Loading branch information
Johan Hedberg authored and Gustavo Padovan committed Feb 1, 2013
1 parent de66aa6 commit 4821002
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions net/bluetooth/hci_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

list_for_each_safe(p, n, &hdev->uuids) {
struct bt_uuid *uuid;
struct bt_uuid *uuid, *tmp;

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);
}

Expand Down

0 comments on commit 4821002

Please sign in to comment.