提交 4821002c 编写于 作者: J Johan Hedberg 提交者: Gustavo Padovan

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: NJohan Hedberg <johan.hedberg@intel.com>
Acked-by: NMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: NGustavo Padovan <gustavo.padovan@collabora.co.uk>
上级 de66aa63
...@@ -1183,14 +1183,10 @@ static void hci_discov_off(struct work_struct *work) ...@@ -1183,14 +1183,10 @@ static void hci_discov_off(struct work_struct *work)
int hci_uuids_clear(struct hci_dev *hdev) 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_for_each_entry_safe(uuid, tmp, &hdev->uuids, list) {
list_del(&uuid->list);
list_del(p);
kfree(uuid); kfree(uuid);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册