summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_core.c
diff options
context:
space:
mode:
authorGeliang Tang <geliangtang@163.com>2015-12-18 23:33:25 +0800
committerMarcel Holtmann <marcel@holtmann.org>2015-12-20 08:11:10 +0100
commit7eb7404f7ee4bf59cb034897ab678aba2755c5e0 (patch)
tree8a8d4ed999773f5b208bb0ca0771971e900fc5e9 /net/bluetooth/hci_core.c
parent07f6f4a31e5a8dee67960fc07bb0b37c5f879d4d (diff)
downloadlinux-7eb7404f7ee4bf59cb034897ab678aba2755c5e0.tar.bz2
Bluetooth: use list_for_each_entry*
Use list_for_each_entry*() instead of list_for_each*() to simplify the code. Signed-off-by: Geliang Tang <geliangtang@163.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/hci_core.c')
-rw-r--r--net/bluetooth/hci_core.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 9fb443a5473a..47bcef754796 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -2713,12 +2713,10 @@ struct bdaddr_list *hci_bdaddr_list_lookup(struct list_head *bdaddr_list,
void hci_bdaddr_list_clear(struct list_head *bdaddr_list)
{
- struct list_head *p, *n;
+ struct bdaddr_list *b, *n;
- list_for_each_safe(p, n, bdaddr_list) {
- struct bdaddr_list *b = list_entry(p, struct bdaddr_list, list);
-
- list_del(p);
+ list_for_each_entry_safe(b, n, bdaddr_list, list) {
+ list_del(&b->list);
kfree(b);
}
}