Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4971653pxj; Wed, 9 Jun 2021 06:27:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8dAutSdMlyCIqtM5pcDZ444A0Vaf3INr4gBR4fkU4hysIyfB4uKm/zUKayajVy5o6WnNH X-Received: by 2002:a05:6402:d06:: with SMTP id eb6mr1938222edb.337.1623245261684; Wed, 09 Jun 2021 06:27:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623245261; cv=none; d=google.com; s=arc-20160816; b=VL3x+xh1+lhOxNmFJ5LqPA0pdLHK/fZ4nuH86Ptz13W8bNdb/zLR+h/09zTA3f2KcQ 02lR2cywcErb/wOk8Re3H7MDZvaelVsUumvwxwuBkMpnI6uGQezzXoJgSw/om4R2iTAA 5cIcY3MrbVxDzCO4pMUvfBdVcKQ5Tp/qGESOayZCLU6sZn20zRxr6aUFh+3N6V01e9jB nS+djqc927aiPl5m7N4DOXvOS0bPa8w+kWlm8ny/CBD0mHxrX5oD5ehJzChXD0QyInrQ yXjO/mh9slnVC6EHnGJl8lNb3ngCBFLz9IvpQmuB4XIuzts+jhcLaJKUmvWchPy/cNxX 7cMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=gV9FR/tXXDUneuwSopSP4syjxbuuqc5RitigQWfGUJw=; b=zo3lXLl3bZQm1Q1vCNefwAyQgxqKvX3U0uzwGgryUiZfu2xH/Z+T5wAmIps28HJBbo i9Pns+JST+xx2wCSdgSsQP7TfzGWV8JMaFUk4DMTdKgxUI/uywBeyVjcagKI1vPBILK7 2WMYX/kFDer4Qvm/OeprWyaQAoCCA9UgUBaHThKsw5dPcLybGLsEsizjCrQgJww38WfT 2eFpdnlMR4JuVBvTPm199CTMq0bo8QM+1CTrBXHsLG6Z4koyLz8p096NR3eL4792St0k aMIuEuEUyWk+PZuUHI1THtmwZCK3pxCfSdbKPxe2mKz5yzjLdMMP3OuvRKvfnifJ8zo0 Ax+w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f23si2280914ejj.287.2021.06.09.06.27.18; Wed, 09 Jun 2021 06:27:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237013AbhFIHKa (ORCPT + 99 others); Wed, 9 Jun 2021 03:10:30 -0400 Received: from szxga03-in.huawei.com ([45.249.212.189]:5346 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234352AbhFIHKI (ORCPT ); Wed, 9 Jun 2021 03:10:08 -0400 Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.53]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4G0J4h2xzkz6tqL; Wed, 9 Jun 2021 15:04:20 +0800 (CST) Received: from dggpeml500020.china.huawei.com (7.185.36.88) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 9 Jun 2021 15:08:11 +0800 Received: from huawei.com (10.175.127.227) by dggpeml500020.china.huawei.com (7.185.36.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 9 Jun 2021 15:08:11 +0800 From: Baokun Li To: , Yisen Zhuang , Salil Mehta , "David S. Miller" , Jakub Kicinski , Huazhong Tan , Guangbin Huang , "Jian Shen" , Yufeng Mo , Guojia Liao , Jiaran Zhang CC: , , , , , , , Hulk Robot 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 Message-ID: <20210609071720.1346684-1-libaokun1@huawei.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT X-Originating-IP: [10.175.127.227] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpeml500020.china.huawei.com (7.185.36.88) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Using list_move_tail() instead of list_del() + list_add_tail() in hclgevf_main.c. Reported-by: Hulk Robot Signed-off-by: Baokun Li --- 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);