aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2013-01-26 17:31:28 -0500
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>2013-02-01 12:50:16 -0500
commit4821002ce2baa130666c2d777e0ed30bee6c7702 (patch)
treed8c7757a392054bd008163e39f2d6d98fbec9b23 /net/bluetooth
parentde66aa63054a6fe348869722221d5cd3463d74a0 (diff)
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 <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/hci_core.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index d13ce99b410a..22e77a786545 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1183,14 +1183,10 @@ static void hci_discov_off(struct work_struct *work)
1183 1183
1184int hci_uuids_clear(struct hci_dev *hdev) 1184int hci_uuids_clear(struct hci_dev *hdev)
1185{ 1185{
1186 struct list_head *p, *n; 1186 struct bt_uuid *uuid, *tmp;
1187
1188 list_for_each_safe(p, n, &hdev->uuids) {
1189 struct bt_uuid *uuid;
1190 1187
1191 uuid = list_entry(p, struct bt_uuid, list); 1188 list_for_each_entry_safe(uuid, tmp, &hdev->uuids, list) {
1192 1189 list_del(&uuid->list);
1193 list_del(p);
1194 kfree(uuid); 1190 kfree(uuid);
1195 } 1191 }
1196 1192