Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp794713imm; Fri, 29 Jun 2018 06:34:04 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdUqX5CMVX3AqcWYmiNvP5diF9GAQZE6BJZzkebrckIkLv8VzdyLSItByEZNuiHL6+zWvN8 X-Received: by 2002:a62:4695:: with SMTP id o21-v6mr8865214pfi.176.1530279244228; Fri, 29 Jun 2018 06:34:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530279244; cv=none; d=google.com; s=arc-20160816; b=WPtrSBNyOGdccbwty0VeP6VFaOJriLGhu37cEyGL6XIbIUe1JUvwSKwb0ZmuVrsLfS Q6860Z8HNcRXsHrzi9SaWhDqvXqBPQPYHvEtqyr6xNm68/Cnz3rHXMJY9PTo+4Sru7BR CvTmqiqnYkmjPIsdVsksbMNbqO6nhx/MftflC8pnB3Y4N1qkK3U+r1UaF9YZunmloFao 1GybfwFOHuAjYD4fWGvvIqIeyh3dohMjexgLlWyK1acLj+TuA/umUBkY6T3JSygA3NMr eBImyODA8Og9G/z5mtnGU35u4GXfcngPWcUZTFDnntjOqfB4LItCBoc6JWPEgNanZuLj fo1g== 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:arc-authentication-results; bh=s6YQfCPcX16Wo8CWHJ6KvlUZS15+t9SpBWZqZSvA1dg=; b=vRu5O88dgDfCZXg/6eCzQtwggj1nYLr6nuU/3IbArSrg2rBNsexuEZci7M5gemazK7 +I4yMe0FgJSDuwlYOivZUCOGzszgd3/X19UhpU1Ld8AfPALdiXejmXThALOc6STdvyq4 lPwhCNL7X6tI3tN3mVTDYaCXEOZgD4d4i6ovZHdsu9BUJOHrONOK+kI4V0hf7yLsDHv+ 3fU3z3aSeIRmZIToGWWZS+ErJc2uLsbxIoKUFRuJYW9QVWWWVL14wfU/7f7czJoF8KS0 pXAcfnNQHJOWr/exJkRwpbcujjTjerAQZeXe/U5zBMfoOS1/TM37W33opU0ty7InEdh1 vf+w== 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 z1-v6si9211318plo.516.2018.06.29.06.33.48; Fri, 29 Jun 2018 06:34:04 -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 S933164AbeF2K5R (ORCPT + 99 others); Fri, 29 Jun 2018 06:57:17 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:49154 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1753166AbeF2Kyk (ORCPT ); Fri, 29 Jun 2018 06:54:40 -0400 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id B574E3CE6654; Fri, 29 Jun 2018 18:54:34 +0800 (CST) Received: from linux-ioko.site (10.71.200.31) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.382.0; Fri, 29 Jun 2018 18:51:23 +0800 From: Peng Li To: CC: , , , , , Subject: [PATCH net-next 06/10] net: hns3: remove a redundant hclge_cmd_csq_done Date: Fri, 29 Jun 2018 19:23:01 +0800 Message-ID: <1530271385-49668-7-git-send-email-lipeng321@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1530271385-49668-1-git-send-email-lipeng321@huawei.com> References: <1530271385-49668-1-git-send-email-lipeng321@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.71.200.31] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Huazhong Tan Set complete in the first hclge_cmd_csq_done of hclge_cmd_send, and check if complete later, unnecessary to do hclge_cmd_csq_done again. Signed-off-by: Huazhong Tan Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c index 28556a9..facfff6 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c @@ -241,15 +241,18 @@ int hclge_cmd_send(struct hclge_hw *hw, struct hclge_desc *desc, int num) */ if (HCLGE_SEND_SYNC(le16_to_cpu(desc->flag))) { do { - if (hclge_cmd_csq_done(hw)) + if (hclge_cmd_csq_done(hw)) { + complete = true; break; + } udelay(1); timeout++; } while (timeout < hw->cmq.tx_timeout); } - if (hclge_cmd_csq_done(hw)) { - complete = true; + if (!complete) { + retval = -EAGAIN; + } else { handle = 0; while (handle < num) { /* Get the result of hardware write back */ @@ -272,9 +275,6 @@ int hclge_cmd_send(struct hclge_hw *hw, struct hclge_desc *desc, int num) } } - if (!complete) - retval = -EAGAIN; - /* Clean the command send queue */ handle = hclge_cmd_csq_clean(hw); if (handle != num) { -- 1.9.1