[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220301075839.4156-6-xiam0nd.tong@gmail.com>
Date: Tue, 1 Mar 2022 15:58:38 +0800
From: Xiaomeng Tong <xiam0nd.tong@...il.com>
To: torvalds@...ux-foundation.org
Cc: arnd@...db.de, jakobkoschel@...il.com,
linux-kernel@...r.kernel.org, gregkh@...uxfoundation.org,
keescook@...omium.org, jannh@...gle.com,
linux-kbuild@...r.kernel.org, linux-mm@...ck.org,
netdev@...r.kernel.org, Xiaomeng Tong <xiam0nd.tong@...il.com>
Subject: [PATCH 5/6] net/core: remove iterator use outside the loop
Demonstrations for:
- list_for_each_entry_safe_reverse_inside
Signed-off-by: Xiaomeng Tong <xiam0nd.tong@...il.com>
---
net/core/gro.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/core/gro.c b/net/core/gro.c
index a11b286d1..4d4f1f2fb 100644
--- a/net/core/gro.c
+++ b/net/core/gro.c
@@ -286,9 +286,8 @@ static void __napi_gro_flush_chain(struct napi_struct *napi, u32 index,
bool flush_old)
{
struct list_head *head = &napi->gro_hash[index].list;
- struct sk_buff *skb, *p;
- list_for_each_entry_safe_reverse(skb, p, head, list) {
+ list_for_each_entry_safe_reverse_inside(skb, p, struct sk_buff, head, list) {
if (flush_old && NAPI_GRO_CB(skb)->age == jiffies)
return;
skb_list_del_init(skb);
--
2.17.1
Powered by blists - more mailing lists