Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3611463imm; Mon, 2 Jul 2018 02:14:24 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeXsUDVB1EulLG+e188kxeD9b0a1Aa8eJVN4IwYfdz98+jH2hHyRy9i1UlHulwlsPyxq1dz X-Received: by 2002:a62:9c9c:: with SMTP id u28-v6mr24717986pfk.90.1530522864262; Mon, 02 Jul 2018 02:14:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530522864; cv=none; d=google.com; s=arc-20160816; b=M3wMy/hlGhOS6frET50pAuju6fa0aDOnLlIfGz7BKW2g3vTect1CNPI4pD6/YoqAqr 36JsCgPH3kLtItsV2GY+6R8cI+9xfwwYCy2Z9701fMkk3O6XDhzR6MQGJPyIVRsAqOap QPUNdkkEmJhZR1YM1TtUbxWUmKldZ/1V+/2+ZhuhFcz68zd19DxNG4nBibGNYlxxN6Iy gXB21yf61A0rcEoWYAidS2L0bW9T6HG4IZAO2qR+S2LB1KjjUc9YcPnu7jtjOMP8hKAH cie11igXQuvpR/BDkcLDIh6R/d01Lur1oK+gNnSB0fMCGQy7DdFK4oIDi36ne1T0kYDu ohIw== 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=WwUXj4TIdK+3FVV+DevpjRYpu8iGjqx2waBHzJutLvE=; b=eoONr6JWG8hiv9xYQk10WBBtbEi7fKMXzaxXa0Zs7SDTv/B0DjRRH6dA9op5yDxE49 GZHK5CRnxTC/bD1DlUesFRtFyg+glm6dB4P6etEZCvsRgD4FTab9c/TlUUl0/b2F9/zr zRqvf3bpIxEFTffUTk2HuHIhwWMFLV5qvD9p23JTOBx2DKvKOfR9OYyDGTxH+YGD+R4/ K4cZevhYioes63KWApkaUb6JOoGbvhqcgVw2Fmkif8oiOny5uvWi/X5lPSouPBwTFpVQ /tShmEw1EAXDC6r4ubvbNWKmeOcGWGBygbxdF87ze0LWtxn2hRdfgHCT2+It27N00Epk ROeg== 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 n81-v6si15586214pfk.277.2018.07.02.02.14.09; Mon, 02 Jul 2018 02:14:24 -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 S933197AbeGBHUc (ORCPT + 99 others); Mon, 2 Jul 2018 03:20:32 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:9148 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753411AbeGBHTO (ORCPT ); Mon, 2 Jul 2018 03:19:14 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 838036E6AEEE0; Mon, 2 Jul 2018 15:18:57 +0800 (CST) Received: from linux-ioko.site (10.71.200.31) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.382.0; Mon, 2 Jul 2018 15:18:50 +0800 From: Peng Li To: CC: , , , , , Subject: [PATCH V2 net-next 5/9] net: hns3: remove a redundant hclge_cmd_csq_done Date: Mon, 2 Jul 2018 15:50:22 +0800 Message-ID: <1530517826-69226-6-git-send-email-lipeng321@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1530517826-69226-1-git-send-email-lipeng321@huawei.com> References: <1530517826-69226-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 0839e84..db80485 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c @@ -242,15 +242,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 */ @@ -274,9 +277,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