Skip to contentSkip to conversation

NFC: llcp: Use list_for_each_entry in llcp_accept_poll

PATCH Applied Axel Lin 2 participants 2 messages Nov 6, 2014 – Nov 28, 2014

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 NFC: llcp: Use list_for_each_entry in llcp_accept_poll

list_for_each_entry_safe() is necessary if list objects are deleted from the list while traversing it. Not the case here, so we can use the base list_for_each_entry variant.

---
 net/nfc/llcp_sock.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
net/nfc/llcp_sock.c +3 -3
index 83bc785..e181e29 100644
@@ -524,13 +524,13 @@ static int llcp_sock_getname(struct socket *sock, struct sockaddr *uaddr,
 
 static inline unsigned int llcp_accept_poll(struct sock *parent)
 {
-	struct nfc_llcp_sock *llcp_sock, *n, *parent_sock;
+	struct nfc_llcp_sock *llcp_sock, *parent_sock;
 	struct sock *sk;
 
 	parent_sock = nfc_llcp_sock(parent);
 
-	list_for_each_entry_safe(llcp_sock, n, &parent_sock->accept_queue,
-				 accept_queue) {
+	list_for_each_entry(llcp_sock, &parent_sock->accept_queue,
+			    accept_queue) {
 		sk = &llcp_sock->sk;
 
 		if (sk->sk_state == LLCP_CONNECTED)
Signature · 1 line
1.9.1
Applied
#1 lore raw

Hi Axel,

Quoted 8 lines · Axel Lin

list_for_each_entry_safe() is necessary if list objects are deleted from the list while traversing it. Not the case here, so we can use the base list_for_each_entry variant.

---
 net/nfc/llcp_sock.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Applied to nfc-next, thanks.

Cheers,
Samuel.