From patchwork Sat Apr 3 01:35:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 414915 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1836697jai; Fri, 2 Apr 2021 18:36:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYgE5B9LzjY/DOAr7yobLszEp2odGAjGjIE3S6mVE0qGhurpahZPmsvCooTbvfLr3tR4qE X-Received: by 2002:a17:906:684b:: with SMTP id a11mr16263842ejs.329.1617413802031; Fri, 02 Apr 2021 18:36:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617413802; cv=none; d=google.com; s=arc-20160816; b=QWKJeAChLp4GVB8TAhWRyRZ8X6jo1WTOHU4oWiS3jFp958/8Ae6xqJCBnXg1ja8smV HZBlayt1cMFI1jnt4czPWwjAXzivvYcx+1aF/CrYhFD5o3AF9TY9QLHSRbQoHn5+QR6x Ihm+BM7j7hD2gXAW4hAkUd2wCCwq8atjH+KxNOkdnXryvRNK1RrqpUNsVyCIu/mKOifg hFUj1Xz5sCSxigDuMKRBvToMANa4TUIyAJVaSiOMjfA3uIZ2G906H6AqJ0L8Mjaj/dLa nZiCyz9ARWQR1GDQEGuHIucAiwumnDWvrjrpbWWu2vfkTIvZmfyAdrvig8oyX/H/aCVX 6JnQ== 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=B0SIvmrvxJVSi0b/6FWjsapPETj4I7D60YIx8bdDsYA=; b=qWO3DpsyjFqswQ7Gl/W6iSW6XHuymaavyKrT6xeo622ZsaxWubDqFg0EhbRkmjOSCs 0zH4D9BsrH96rldRsndSNJrz4NsWJ3PRO1CXzABEuheIjQZhe5G/BKeDf/WS9SV8Pl8J C+qAgAsB58PqnO2itr+eBq6vevfJNyqkzbL63EYT53TTtmPFKYHDko06VfXClSnpZ2Op KI7wiEZc84wKxRuNZFq++A/U6r2ZER5OdV7dxqXITUCOls9I1WLv3ur62/LSa1u3JKdR rVBnJyQIhTb/IBHtiAKVDwIvlM4nR3I4CF2wpWAJFRIgMa5QTv+jHvzerBZEpOt4gNCX n11Q== 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.41; Fri, 02 Apr 2021 18:36:42 -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 S236138AbhDCBgm (ORCPT + 8 others); Fri, 2 Apr 2021 21:36:42 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:15472 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234488AbhDCBgl (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 4FBzx15hR5zyNj7; 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:27 +0800 From: Salil Mehta To: , CC: , , , , Subject: [PATCH net 1/2] net: hns3: Remove the left over redundant check & assignment Date: Sat, 3 Apr 2021 02:35:19 +0100 Message-ID: <20210403013520.22108-2-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 This removes the left over check and assignment which is no longer used anywhere in the function and should have been removed as part of the below mentioned patch. Fixes: 012fcb52f67c ("net: hns3: activate reset timer when calling reset_event") Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 -- 1 file changed, 2 deletions(-) -- 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 e3f81c7e0ce7..7ad0722383f5 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -3976,8 +3976,6 @@ static void hclge_reset_event(struct pci_dev *pdev, struct hnae3_handle *handle) * want to make sure we throttle the reset request. Therefore, we will * not allow it again before 3*HZ times. */ - if (!handle) - handle = &hdev->vport[0].nic; if (time_before(jiffies, (hdev->last_reset_time + HCLGE_RESET_INTERVAL))) { 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);