diff options
author | Geliang Tang <geliangtang@163.com> | 2015-12-18 16:33:25 +0100 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2015-12-20 08:11:10 +0100 |
commit | 7eb7404f7ee4bf59cb034897ab678aba2755c5e0 (patch) | |
tree | 8a8d4ed999773f5b208bb0ca0771971e900fc5e9 /net/bluetooth/af_bluetooth.c | |
parent | tcp: diag: add support for request sockets to tcp_abort() (diff) | |
download | linux-7eb7404f7ee4bf59cb034897ab678aba2755c5e0.tar.xz linux-7eb7404f7ee4bf59cb034897ab678aba2755c5e0.zip |
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/af_bluetooth.c')
-rw-r--r-- | net/bluetooth/af_bluetooth.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c index cb4e8d4f7c25..955eda93e66f 100644 --- a/net/bluetooth/af_bluetooth.c +++ b/net/bluetooth/af_bluetooth.c @@ -174,13 +174,13 @@ EXPORT_SYMBOL(bt_accept_unlink); struct sock *bt_accept_dequeue(struct sock *parent, struct socket *newsock) { - struct list_head *p, *n; + struct bt_sock *s, *n; struct sock *sk; BT_DBG("parent %p", parent); - list_for_each_safe(p, n, &bt_sk(parent)->accept_q) { - sk = (struct sock *) list_entry(p, struct bt_sock, accept_q); + list_for_each_entry_safe(s, n, &bt_sk(parent)->accept_q, accept_q) { + sk = (struct sock *)s; lock_sock(sk); @@ -388,11 +388,11 @@ EXPORT_SYMBOL(bt_sock_stream_recvmsg); static inline unsigned int bt_accept_poll(struct sock *parent) { - struct list_head *p, *n; + struct bt_sock *s, *n; struct sock *sk; - list_for_each_safe(p, n, &bt_sk(parent)->accept_q) { - sk = (struct sock *) list_entry(p, struct bt_sock, accept_q); + list_for_each_entry_safe(s, n, &bt_sk(parent)->accept_q, accept_q) { + sk = (struct sock *)s; if (sk->sk_state == BT_CONNECTED || (test_bit(BT_SK_DEFER_SETUP, &bt_sk(parent)->flags) && sk->sk_state == BT_CONNECT2)) |