* [PATCH -next] cxgb4: clip_tbl: use list_del_init instead of list_del/INIT_LIST_HEAD
@ 2021-05-18 13:01 Yang Yingliang
2021-05-18 20:50 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Yang Yingliang @ 2021-05-18 13:01 UTC (permalink / raw)
To: linux-kernel, netdev; +Cc: rajur, davem, kuba
Using list_del_init() instead of list_del() + INIT_LIST_HEAD()
to simpify the code.
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
drivers/net/ethernet/chelsio/cxgb4/clip_tbl.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/chelsio/cxgb4/clip_tbl.c b/drivers/net/ethernet/chelsio/cxgb4/clip_tbl.c
index 12fcf84d67ad..163efab27e9b 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/clip_tbl.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/clip_tbl.c
@@ -106,8 +106,7 @@ int cxgb4_clip_get(const struct net_device *dev, const u32 *lip, u8 v6)
if (!list_empty(&ctbl->ce_free_head)) {
ce = list_first_entry(&ctbl->ce_free_head,
struct clip_entry, list);
- list_del(&ce->list);
- INIT_LIST_HEAD(&ce->list);
+ list_del_init(&ce->list);
spin_lock_init(&ce->lock);
refcount_set(&ce->refcnt, 0);
atomic_dec(&ctbl->nfree);
@@ -179,8 +178,7 @@ void cxgb4_clip_release(const struct net_device *dev, const u32 *lip, u8 v6)
write_lock_bh(&ctbl->lock);
spin_lock_bh(&ce->lock);
if (refcount_dec_and_test(&ce->refcnt)) {
- list_del(&ce->list);
- INIT_LIST_HEAD(&ce->list);
+ list_del_init(&ce->list);
list_add_tail(&ce->list, &ctbl->ce_free_head);
atomic_inc(&ctbl->nfree);
if (v6)
--
2.25.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH -next] cxgb4: clip_tbl: use list_del_init instead of list_del/INIT_LIST_HEAD
2021-05-18 13:01 [PATCH -next] cxgb4: clip_tbl: use list_del_init instead of list_del/INIT_LIST_HEAD Yang Yingliang
@ 2021-05-18 20:50 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-05-18 20:50 UTC (permalink / raw)
To: Yang Yingliang; +Cc: linux-kernel, netdev, rajur, davem, kuba
Hello:
This patch was applied to netdev/net-next.git (refs/heads/master):
On Tue, 18 May 2021 21:01:35 +0800 you wrote:
> Using list_del_init() instead of list_del() + INIT_LIST_HEAD()
> to simpify the code.
>
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
> drivers/net/ethernet/chelsio/cxgb4/clip_tbl.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
Here is the summary with links:
- [-next] cxgb4: clip_tbl: use list_del_init instead of list_del/INIT_LIST_HEAD
https://git.kernel.org/netdev/net-next/c/44e261c715b6
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-05-18 20:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-18 13:01 [PATCH -next] cxgb4: clip_tbl: use list_del_init instead of list_del/INIT_LIST_HEAD Yang Yingliang
2021-05-18 20:50 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®