Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2222130ybi; Thu, 4 Jul 2019 07:07:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqzME47oSPwN0uVwcrYCovONEIWFjpsK1GEE4dsQIkKxfrACDfoP1qPBWKV9C3pALX6C9Yxd X-Received: by 2002:a17:90a:4806:: with SMTP id a6mr2169689pjh.38.1562249239534; Thu, 04 Jul 2019 07:07:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562249239; cv=none; d=google.com; s=arc-20160816; b=R7RRwCZ6uffrFjPzQcGi0cVweYnOiGYmGZGGXvWRsiQECvPtZaHc9rk0K9++6eBz0j dRhIv++l2tFcmZhVVrFTWC3OizKo8M17UcHgDPKBOT7kKFrJF6LNO/Gb24L8XelJXqHU 54a/vISaUymdcHdHXhAWm60tCSSnVG+0obpYixkILJbjxE9e6NZTzUnttRqrpL+o8WGf 0VhgcUwpU27sJaDdp00He98sBjso9iPGd/SrFx5+1WMSENZMGe6RPL/dOUmq0rKhFfI/ 7HQwEZLLDGlxoCq1u/msJ2bTaBKWndhcnlZT1SHYepwOxt7S3hPfC9WO4oqgJLlL7cmJ HXTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=216gTDA/PYWllAXKJNBbKXgpIPL6T2dxteAPISFSv1U=; b=HYrN1bM8n7hwaWCZ/+h+UZwg4mHUP8+m1itSkP7OC0mTVz1J1Zo68YGodR0CEMTgIh vZLzn8FdqcdZSHSTmgPskKCPFZKPHe3D/2iD7iECm36nkXI9ONCqhlMRK73FweC9h9z7 78s0zVmm7qK8CsSK2j7LEJymuzH+tOr/oGu8BYpyiCBl6/p53uP6xKJXq7ngQXtEJsrY fV7qHXCWG0JCJozsFSGw9nJKKnIC+Tm+uEGAv8X7uZVuCSTyIXn2B8BT+tlUvyKSzWVI u6fLskPmPVG3jPASFm7hNVD47nEI6kbwimvoKsBKGtQFyuYjbpAzfhdeM1bE8RDkI7/k Mrww== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z62si5545819pgd.472.2019.07.04.07.07.04; Thu, 04 Jul 2019 07:07:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727508AbfGDOGg (ORCPT + 99 others); Thu, 4 Jul 2019 10:06:36 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:8706 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727398AbfGDOGc (ORCPT ); Thu, 4 Jul 2019 10:06:32 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 27DCFB793B9BA315CA11; Thu, 4 Jul 2019 22:06:27 +0800 (CST) Received: from localhost.localdomain (10.67.212.132) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.439.0; Thu, 4 Jul 2019 22:06:16 +0800 From: Huazhong Tan To: CC: , , , , , Peng Li , Huazhong Tan Subject: [PATCH net-next 5/9] net: hns3: set default value for param "type" in hclgevf_bind_ring_to_vector Date: Thu, 4 Jul 2019 22:04:24 +0800 Message-ID: <1562249068-40176-6-git-send-email-tanhuazhong@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1562249068-40176-1-git-send-email-tanhuazhong@huawei.com> References: <1562249068-40176-1-git-send-email-tanhuazhong@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.212.132] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peng Li The value of param type is always not changed in hclgevf_bind_ring_to_vector, move the assignment to front of "for {}" can reduce the redundant assignment. Signed-off-by: Peng Li Signed-off-by: Huazhong Tan --- drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c index ff7e8cb..a13a0e1 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c @@ -994,6 +994,8 @@ static int hclgevf_bind_ring_to_vector(struct hnae3_handle *handle, bool en, u8 type; req = (struct hclge_mbx_vf_to_pf_cmd *)desc.data; + type = en ? HCLGE_MBX_MAP_RING_TO_VECTOR : + HCLGE_MBX_UNMAP_RING_TO_VECTOR; for (node = ring_chain; node; node = node->next) { int idx_offset = HCLGE_MBX_RING_MAP_BASIC_MSG_NUM + @@ -1003,9 +1005,6 @@ static int hclgevf_bind_ring_to_vector(struct hnae3_handle *handle, bool en, hclgevf_cmd_setup_basic_desc(&desc, HCLGEVF_OPC_MBX_VF_TO_PF, false); - type = en ? - HCLGE_MBX_MAP_RING_TO_VECTOR : - HCLGE_MBX_UNMAP_RING_TO_VECTOR; req->msg[0] = type; req->msg[1] = vector_id; } -- 2.7.4