Commit 3e9c40a6 authored by Gustavo F. Padovan's avatar Gustavo F. Padovan

Bluetooth: Use list_for_each_entry in hci_conn_hash_flush()

Signed-off-by: default avatarGustavo F. Padovan <padovan@profusion.mobi>
parent f9c3123b
...@@ -807,17 +807,11 @@ void hci_conn_enter_sniff_mode(struct hci_conn *conn) ...@@ -807,17 +807,11 @@ void hci_conn_enter_sniff_mode(struct hci_conn *conn)
void hci_conn_hash_flush(struct hci_dev *hdev) void hci_conn_hash_flush(struct hci_dev *hdev)
{ {
struct hci_conn_hash *h = &hdev->conn_hash; struct hci_conn_hash *h = &hdev->conn_hash;
struct list_head *p; struct hci_conn *c;
BT_DBG("hdev %s", hdev->name); BT_DBG("hdev %s", hdev->name);
p = h->list.next; list_for_each_entry(c, &h->list, list) {
while (p != &h->list) {
struct hci_conn *c;
c = list_entry(p, struct hci_conn, list);
p = p->next;
c->state = BT_CLOSED; c->state = BT_CLOSED;
hci_proto_disconn_cfm(c, HCI_ERROR_LOCAL_HOST_TERM); hci_proto_disconn_cfm(c, HCI_ERROR_LOCAL_HOST_TERM);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment