From patchwork Sat Apr 3 01:35:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 414916 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1836710jai; Fri, 2 Apr 2021 18:36:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwp39nOr6pIIr5nYZ/ATTKent2euYUGek6Jz2U3iazBVS2Y59l8/Bf/blKo0MdoiWtZGJjh X-Received: by 2002:a17:907:2bd9:: with SMTP id gv25mr2845826ejc.225.1617413803177; Fri, 02 Apr 2021 18:36:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617413803; cv=none; d=google.com; s=arc-20160816; b=mI1H5pnQXfTfInmrVklwPF6gPoGCrFWmjWavlB+UVbTQe5BaHb3pOGU9qM5OIXBD3l 6M+GOJ8Fy4LnG+QdhkmMIuMnvmt2HVSR9bobUrD8gUqP9fSmfPumrYgICT1RicLR7BDS nVCyVOMIJnWp1jiv97S0cPJbhNOMy4JqjvnPMbdqrXpUBQoB2nG7ot3NXLPo9v9Wx9l0 FemBXcqbRhQvFXZBEFQMXFvdwfDz2C0wFbtp48cXWb6h1244HI6xSHhbBtqgzuijv74X iRfkglR4yEzCcp8Yj1eFzrSz80Ad2albaHCAz5z4Krs9MGS8F3bjG6ymBABIxlRCMrxo viEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=U5ToLKwV9UtpEwk8EMYAwCRTdrL7qIPFGzviFvVcRrs=; b=DFAhkwpGcK0SrROc21O9iUbpRj1Aq1ZiQyMc0gbwVESfPLhPhL/1GFVzgNqU8iIzPt qx8w8w48KGWyYp11lRXGMz77f3taTCAZZ8L5kLsrRHSabe7HIEwoLu4djEK20h2/jL6p nYhX5M6DHjXyEtLNegxUa+arCTrtUyjJRJemM2OVchUpnvMjAOALGS+Pi1aMtxbbVN1c 1ZQrLmu7WQq1SuMtpy4QEYQlVkBS1YO2Xx+SssrfK6XpTqHoHYuRRG/yWKsUF2XObX0m ivJOe9c9TGYHNnYlDcnc6mVHfyLHLa2sWZP9NQOWBTkdOjJ1yG//fcmAlKqLd3w6gB4I i32w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-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 j13si7871692edn.369.2021.04.02.18.36.42; Fri, 02 Apr 2021 18:36:43 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-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 netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-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 S236214AbhDCBgn (ORCPT + 8 others); Fri, 2 Apr 2021 21:36:43 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:15471 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235990AbhDCBgl (ORCPT ); Fri, 2 Apr 2021 21:36:41 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FBzx15RhvzyN3l; Sat, 3 Apr 2021 09:34:29 +0800 (CST) Received: from A190218597.china.huawei.com (10.47.74.55) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.498.0; Sat, 3 Apr 2021 09:36:30 +0800 From: Salil Mehta To: , CC: , , , , Subject: [PATCH net 2/2] net: hns3: Remove un-necessary 'else-if' in the hclge_reset_event() Date: Sat, 3 Apr 2021 02:35:20 +0100 Message-ID: <20210403013520.22108-3-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20210403013520.22108-1-salil.mehta@huawei.com> References: <20210403013520.22108-1-salil.mehta@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.47.74.55] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Code to defer the reset(which caps the frequency of the reset) schedules the timer and returns. Hence, following 'else-if' looks un-necessary. Fixes: 9de0b86f6444 ("net: hns3: Prevent to request reset frequently") Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 7ad0722383f5..2ed464e13d1b 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -3981,7 +3981,9 @@ static void hclge_reset_event(struct pci_dev *pdev, struct hnae3_handle *handle) HCLGE_RESET_INTERVAL))) { mod_timer(&hdev->reset_timer, jiffies + HCLGE_RESET_INTERVAL); return; - } else if (hdev->default_reset_request) { + } + + if (hdev->default_reset_request) { hdev->reset_level = hclge_get_reset_level(ae_dev, &hdev->default_reset_request);