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);