diff options
author | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-12-14 19:52:31 -0500 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-12-16 15:16:15 -0500 |
commit | 3e9c40a6f72a4ee7a978204cac00f91ad08bbe9b (patch) | |
tree | 8a741f40db1e086d3fc7cc3f7cc6368b874d9d71 /net/bluetooth/hci_conn.c | |
parent | f9c3123b5a7c9585902927b14983e6635aca00c6 (diff) |
Bluetooth: Use list_for_each_entry in hci_conn_hash_flush()
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth/hci_conn.c')
-rw-r--r-- | net/bluetooth/hci_conn.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index 1a076941829b..dfe807fb7e79 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c | |||
@@ -807,17 +807,11 @@ void hci_conn_enter_sniff_mode(struct hci_conn *conn) | |||
807 | void hci_conn_hash_flush(struct hci_dev *hdev) | 807 | void hci_conn_hash_flush(struct hci_dev *hdev) |
808 | { | 808 | { |
809 | struct hci_conn_hash *h = &hdev->conn_hash; | 809 | struct hci_conn_hash *h = &hdev->conn_hash; |
810 | struct list_head *p; | 810 | struct hci_conn *c; |
811 | 811 | ||
812 | BT_DBG("hdev %s", hdev->name); | 812 | BT_DBG("hdev %s", hdev->name); |
813 | 813 | ||
814 | p = h->list.next; | 814 | list_for_each_entry(c, &h->list, list) { |
815 | while (p != &h->list) { | ||
816 | struct hci_conn *c; | ||
817 | |||
818 | c = list_entry(p, struct hci_conn, list); | ||
819 | p = p->next; | ||
820 | |||
821 | c->state = BT_CLOSED; | 815 | c->state = BT_CLOSED; |
822 | 816 | ||
823 | hci_proto_disconn_cfm(c, HCI_ERROR_LOCAL_HOST_TERM); | 817 | hci_proto_disconn_cfm(c, HCI_ERROR_LOCAL_HOST_TERM); |