From: Baokun Li <libaokun1@huawei.com>
To: <linux-kernel@vger.kernel.org>,
Yisen Zhuang <yisen.zhuang@huawei.com>,
Salil Mehta <salil.mehta@huawei.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Huazhong Tan <tanhuazhong@huawei.com>,
Guangbin Huang <huangguangbin2@huawei.com>,
"Jian Shen" <shenjian15@huawei.com>,
Yufeng Mo <moyufeng@huawei.com>,
Guojia Liao <liaoguojia@huawei.com>,
Jiaran Zhang <zhangjiaran@huawei.com>
Cc: <weiyongjun1@huawei.com>, <yuehaibing@huawei.com>,
<yangjihong1@huawei.com>, <yukuai3@huawei.com>,
<libaokun1@huawei.com>, <netdev@vger.kernel.org>,
<kernel-janitors@vger.kernel.org>, Hulk Robot <hulkci@huawei.com>
Subject: [PATCH net-next v2] net: hns3: use list_move_tail instead of list_del/list_add_tail in hclgevf_main.c
Date: Wed, 9 Jun 2021 15:17:20 +0800 [thread overview]
Message-ID: <20210609071720.1346684-1-libaokun1@huawei.com> (raw)
Using list_move_tail() instead of list_del() + list_add_tail() in hclgevf_main.c.
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Baokun Li <libaokun1@huawei.com>
---
V1->V2:
CC mailist
.../hisilicon/hns3/hns3vf/hclgevf_main.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
index f84b3a135c06..52eaf82b7cd7 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
@@ -1536,8 +1536,7 @@ static void hclgevf_sync_from_add_list(struct list_head *add_list,
kfree(mac_node);
} else if (mac_node->state == HCLGEVF_MAC_ACTIVE) {
mac_node->state = HCLGEVF_MAC_TO_DEL;
- list_del(&mac_node->node);
- list_add_tail(&mac_node->node, mac_list);
+ list_move_tail(&mac_node->node, mac_list);
} else {
list_del(&mac_node->node);
kfree(mac_node);
@@ -1562,8 +1561,7 @@ static void hclgevf_sync_from_del_list(struct list_head *del_list,
list_del(&mac_node->node);
kfree(mac_node);
} else {
- list_del(&mac_node->node);
- list_add_tail(&mac_node->node, mac_list);
+ list_move_tail(&mac_node->node, mac_list);
}
}
}
@@ -1599,8 +1597,7 @@ static void hclgevf_sync_mac_list(struct hclgevf_dev *hdev,
list_for_each_entry_safe(mac_node, tmp, list, node) {
switch (mac_node->state) {
case HCLGEVF_MAC_TO_DEL:
- list_del(&mac_node->node);
- list_add_tail(&mac_node->node, &tmp_del_list);
+ list_move_tail(&mac_node->node, &tmp_del_list);
break;
case HCLGEVF_MAC_TO_ADD:
new_node = kzalloc(sizeof(*new_node), GFP_ATOMIC);
next reply other threads:[~2021-06-09 7:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-09 7:17 Baokun Li [this message]
2021-06-09 21:10 ` [PATCH net-next v2] net: hns3: use list_move_tail instead of list_del/list_add_tail in hclgevf_main.c patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210609071720.1346684-1-libaokun1@huawei.com \
--to=libaokun1@huawei.com \
--cc=davem@davemloft.net \
--cc=huangguangbin2@huawei.com \
--cc=hulkci@huawei.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kuba@kernel.org \
--cc=liaoguojia@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=moyufeng@huawei.com \
--cc=netdev@vger.kernel.org \
--cc=salil.mehta@huawei.com \
--cc=shenjian15@huawei.com \
--cc=tanhuazhong@huawei.com \
--cc=weiyongjun1@huawei.com \
--cc=yangjihong1@huawei.com \
--cc=yisen.zhuang@huawei.com \
--cc=yuehaibing@huawei.com \
--cc=yukuai3@huawei.com \
--cc=zhangjiaran@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).