From: Gustavo F. Padovan Date: Thu, 15 Dec 2011 00:52:31 +0000 (-0200) Subject: Bluetooth: Use list_for_each_entry in hci_conn_hash_flush() X-Git-Tag: v3.12-rc1~4160^2~44^2~71^2~38 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3e9c40a6f72a4ee7a978204cac00f91ad08bbe9b;p=kernel%2Fkernel-generic.git Bluetooth: Use list_for_each_entry in hci_conn_hash_flush() Signed-off-by: Gustavo F. Padovan --- diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index 1a07694..dfe807f 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) void hci_conn_hash_flush(struct hci_dev *hdev) { struct hci_conn_hash *h = &hdev->conn_hash; - struct list_head *p; + struct hci_conn *c; BT_DBG("hdev %s", hdev->name); - p = h->list.next; - while (p != &h->list) { - struct hci_conn *c; - - c = list_entry(p, struct hci_conn, list); - p = p->next; - + list_for_each_entry(c, &h->list, list) { c->state = BT_CLOSED; hci_proto_disconn_cfm(c, HCI_ERROR_LOCAL_HOST_TERM);