From patchwork Mon Apr 5 17:06:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 415301 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp3840683jai; Mon, 5 Apr 2021 10:08:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwV3RmBFA4ozT+edMSzl3OQUGBIprWNzJniSfnE2meJIezHZK6OU6Fy7kmNS+a8NYDJL7hS X-Received: by 2002:a05:6638:343:: with SMTP id x3mr24969967jap.44.1617642500992; Mon, 05 Apr 2021 10:08:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617642500; cv=none; d=google.com; s=arc-20160816; b=Xx21pF0wQeAmk//GhnAFaXPqJabLIK6DJYOl6Pf1VPfqN/WkzdHX0/61OKWJ2B8sAK lSt4JE0v5YDm1hR50ym4UKgH1DVfHMjZYk6Mo3NzbWSFLqVz7rEKALXBVPZszVcCDUM9 WVc1XSxM8tY66OZZFvkbjLqwVFrTe4q9tjCyxZCktoquMZwhxojSDP6g/Cx86ySOWmEi P4obX36uaQfIXgkank/2sYCqjjXfVRwSSHCYrwRYVG5rtWIgx7bDw7hNhlcu3ysg1glP wjqzYtgTR7qtrzMI0Z+g9ZaStAZkEp2gErPSSTMyvrjqaDj8WOuKP5zWNX/LnVBqNXlZ RlGw== 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=4OHSLbDiHHFpjsUv5CxBKco6qfFyu3Lx17DBw8K0O/g=; b=yRr5KEKveBYiOqsb+pTTfkZcSjjG74eRgncryIlWeTnQXkLNpduZHUvya8RoFxY6Zy gAude2Mogd/0c4/VX995NZ5N7cKfXdJXnBWU106YVAJ2cO4jplwQs81iUrAaZs4xJOTH a3gv08Aq/Za0NRODmMWoR1YjuKdAgaZq/ktbFqHgDsjY5Kh4eQUagzY0A2YH+40flsH1 YvWDmOcvc3NKaNvZ50TX5k0fM1EPxk4h4kLMbBkyTDc+tmqXFsZgSwd2LI17b1nsn+8w gqSBjBwfR19xlMeA+1FHd/KG8A/pEy6WFqe7ENkYFkgVFs14K2L+u1/2ejlwg7F5A/Oc nKNw== 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 b6si234517ile.5.2021.04.05.10.08.20; Mon, 05 Apr 2021 10:08:20 -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 S234196AbhDERIZ (ORCPT + 8 others); Mon, 5 Apr 2021 13:08:25 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:16340 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234028AbhDERIR (ORCPT ); Mon, 5 Apr 2021 13:08:17 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4FDcVs145Pz9wtm; Tue, 6 Apr 2021 01:05:57 +0800 (CST) Received: from A190218597.china.huawei.com (10.47.69.183) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.498.0; Tue, 6 Apr 2021 01:08:00 +0800 From: Salil Mehta To: , CC: , , , , Subject: [PATCH V2 net 1/2] net: hns3: Remove the left over redundant check & assignment Date: Mon, 5 Apr 2021 18:06:44 +0100 Message-ID: <20210405170645.29620-2-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20210405170645.29620-1-salil.mehta@huawei.com> References: <20210405170645.29620-1-salil.mehta@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.47.69.183] 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 -- V1->V2: [1] Fixed comments from Leon Romanovsky Link: https://lkml.org/lkml/2021/4/4/14 --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 3 --- 1 file changed, 3 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..58d210bbb311 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -3966,7 +3966,6 @@ static void hclge_reset_event(struct pci_dev *pdev, struct hnae3_handle *handle) * normalcy is to reset. * 2. A new reset request from the stack due to timeout * - * For the first case,error event might not have ae handle available. * check if this is a new reset request and we are not here just because * last reset attempt did not succeed and watchdog hit us again. We will * know this if last reset request did not occur very recently (watchdog @@ -3976,8 +3975,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 Mon Apr 5 17:06:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 415303 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp3840743jai; Mon, 5 Apr 2021 10:08:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJziuPKkStrrSdPgF4BT9RNko6aFBte/3YfeFzv5CljSWD4/W6ZuTnqP+k7WQp5gw7Tq2SVD X-Received: by 2002:a92:d711:: with SMTP id m17mr1684727iln.12.1617642505332; Mon, 05 Apr 2021 10:08:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617642505; cv=none; d=google.com; s=arc-20160816; b=ad6sPmwYSmPw0sXQdlddoU9a9XEMid8edMhhYVi4T4ACXSNVMfRoleGYa/F/cFas5e reYT/WdUQWxSXhJw/gYxoWwBwvj8XMiH48Zr065K/2/EUNSJQTBade/PrHBoGm4PTclQ 5SHs8dhq7nWaJExiOE58lLdlvijH8hS9lMEwuhvnZOLKJnJxUtkN/ILtoxkNMAdCx+EE VTxYNpcouQzJgdcR0O77n0Me2Z8g6SvXzGc460zR4VstBkTK+EWW/SCoSwyIhKFhGYp6 Yj0eDRsowAgoQzVp9H6olCFN99Pdu4BC22/s3OV8DgMRvvGwXWwTIl2gcxGUgwdcKvSn nI2w== 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=GYBgbcd2nf9jd7l8MS9JWqGoPWkSwIcaNE52HUqmvMY=; b=C6cOOZF6z0aGa/GoceUi/R621DKPwfLCeUBnP4/WWjCyWCDTZZvAEx96Yu3YJzOSWM hpMSpVrG3hHJRh6Wt4a7TuCoVezP/vVjCCIIcQKeqB7ciGHy6C1lHv8U5qobfTzmr26+ eAqT6+JuSym3/zp0iVsnJoKH/7uhNJEGi9+ArglbWpYGlfCO4PFkM/2a81jJFKsPrUvJ eDwS+tUKathNKDB/PT5NDvVQmQLuK02PJxmgfKXzHIcZ3xb+81tRQLYX95Hp6uRiJ3PR /8PAkwaRVv8cdsW/yenMaCWnSSKyB5Qh2bAf/XdewjNWrXTcTKY3EnByFsPSbx2e/YN5 h3BA== 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 b6si234517ile.5.2021.04.05.10.08.25; Mon, 05 Apr 2021 10:08:25 -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 S234917AbhDERI3 (ORCPT + 8 others); Mon, 5 Apr 2021 13:08:29 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:15546 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234070AbhDERI0 (ORCPT ); Mon, 5 Apr 2021 13:08:26 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FDcVH6Hh1zPnfd; Tue, 6 Apr 2021 01:05:27 +0800 (CST) Received: from A190218597.china.huawei.com (10.47.69.183) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.498.0; Tue, 6 Apr 2021 01:08:03 +0800 From: Salil Mehta To: , CC: , , , , Subject: [PATCH V2 net 2/2] net: hns3: Remove un-necessary 'else-if' in the hclge_reset_event() Date: Mon, 5 Apr 2021 18:06:45 +0100 Message-ID: <20210405170645.29620-3-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20210405170645.29620-1-salil.mehta@huawei.com> References: <20210405170645.29620-1-salil.mehta@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.47.69.183] 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 58d210bbb311..2dd2af269b46 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -3980,7 +3980,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);