[PATCH net-next v2] net: hns3: use list_move_tail instead of list_del/list_add_tail in hclge_main.c

Subsystems: hisilicon network subsystem 3 driver (hns3), hisilicon network subsystem driver, networking drivers, the rest

STALE1886d

2 messages, 2 authors, 2021-06-09 · open the first message on its own page

[PATCH net-next v2] net: hns3: use list_move_tail instead of list_del/list_add_tail in hclge_main.c

From: Baokun Li <hidden>
Date: 2021-06-09 07:12:03

Using list_move_tail() instead of list_del() + list_add_tail() in hclge_main.c.

Reported-by: Hulk Robot <redacted>
Signed-off-by: Baokun Li <redacted>
---
V1->V2:
	CC mailist

 .../hns3/hns3pf/hclge_main.c          | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index 6ecc106af334..2e95d36fcc52 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -8799,8 +8799,7 @@ static bool hclge_sync_from_add_list(struct list_head *add_list,
 			kfree(mac_node);
 		} else if (mac_node->state == HCLGE_MAC_ACTIVE) {
 			mac_node->state = HCLGE_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);
@@ -8829,8 +8828,7 @@ static void hclge_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);
 		}
 	}
 }
@@ -8874,8 +8872,7 @@ static void hclge_sync_vport_mac_table(struct hclge_vport *vport,
 	list_for_each_entry_safe(mac_node, tmp, list, node) {
 		switch (mac_node->state) {
 		case HCLGE_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 HCLGE_MAC_TO_ADD:
 			new_node = kzalloc(sizeof(*new_node), GFP_ATOMIC);
@@ -8957,8 +8954,7 @@ static void hclge_build_del_list(struct list_head *list,
 		switch (mac_cfg->state) {
 		case HCLGE_MAC_TO_DEL:
 		case HCLGE_MAC_ACTIVE:
-			list_del(&mac_cfg->node);
-			list_add_tail(&mac_cfg->node, tmp_del_list);
+			list_move_tail(&mac_cfg->node, tmp_del_list);
 			break;
 		case HCLGE_MAC_TO_ADD:
 			if (is_del_list) {
@@ -9053,8 +9049,7 @@ static void hclge_uninit_vport_mac_list(struct hclge_vport *vport,
 		switch (mac_node->state) {
 		case HCLGE_MAC_TO_DEL:
 		case HCLGE_MAC_ACTIVE:
-			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 HCLGE_MAC_TO_ADD:
 			list_del(&mac_node->node);

Re: [PATCH net-next v2] net: hns3: use list_move_tail instead of list_del/list_add_tail in hclge_main.c

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-06-09 21:10:11

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Wed, 9 Jun 2021 15:20:56 +0800 you wrote:
Using list_move_tail() instead of list_del() + list_add_tail() in hclge_main.c.

Reported-by: Hulk Robot <redacted>
Signed-off-by: Baokun Li <redacted>
---
V1->V2:
	CC mailist

[...]
Here is the summary with links:
  - [net-next,v2] net: hns3: use list_move_tail instead of list_del/list_add_tail in hclge_main.c
    https://git.kernel.org/netdev/net-next/c/4724acc47c94

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help