diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2013-01-26 17:31:30 -0500 |
---|---|---|
committer | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2013-02-01 12:50:17 -0500 |
commit | 056341c8cb677356eb2c20a82e788ccb51c6a37b (patch) | |
tree | 3c451a1706f495e4c564f1b5d84ab5decb8f4ddd /net/bluetooth | |
parent | 83be8eca2e67faaec45280224b798828bbfa69aa (diff) |
Bluetooth: Simplify UUID removal code
The UUID removal code 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/mgmt.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 8de6d576dc70..1e906d8d86ac 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c | |||
@@ -1372,7 +1372,7 @@ static int remove_uuid(struct sock *sk, struct hci_dev *hdev, void *data, | |||
1372 | { | 1372 | { |
1373 | struct mgmt_cp_remove_uuid *cp = data; | 1373 | struct mgmt_cp_remove_uuid *cp = data; |
1374 | struct pending_cmd *cmd; | 1374 | struct pending_cmd *cmd; |
1375 | struct list_head *p, *n; | 1375 | struct bt_uuid *match, *tmp; |
1376 | u8 bt_uuid_any[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; | 1376 | u8 bt_uuid_any[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; |
1377 | int err, found; | 1377 | int err, found; |
1378 | 1378 | ||
@@ -1400,9 +1400,7 @@ static int remove_uuid(struct sock *sk, struct hci_dev *hdev, void *data, | |||
1400 | 1400 | ||
1401 | found = 0; | 1401 | found = 0; |
1402 | 1402 | ||
1403 | list_for_each_safe(p, n, &hdev->uuids) { | 1403 | list_for_each_entry_safe(match, tmp, &hdev->uuids, list) { |
1404 | struct bt_uuid *match = list_entry(p, struct bt_uuid, list); | ||
1405 | |||
1406 | if (memcmp(match->uuid, cp->uuid, 16) != 0) | 1404 | if (memcmp(match->uuid, cp->uuid, 16) != 0) |
1407 | continue; | 1405 | continue; |
1408 | 1406 | ||