mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-13 17:28:56 +00:00
Bluetooth: Use list_for_each_entry in hci_conn_hash_flush()
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
This commit is contained in:
parent
f9c3123b5a
commit
3e9c40a6f7
@ -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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user