Commit 49768ce9 authored by Baokun Li's avatar Baokun Li Committed by David S. Miller

net: hns3: use list_move_tail instead of list_del/list_add_tail in hclgevf_main.c

Using list_move_tail() instead of list_del() + list_add_tail() in hclgevf_main.c.
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarBaokun Li <libaokun1@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 39c3783e
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment