]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: hns3: Remove un-necessary 'else-if' in the hclge_reset_event()
authorSalil Mehta <salil.mehta@huawei.com>
Mon, 5 Apr 2021 17:06:45 +0000 (18:06 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 5 Apr 2021 22:02:41 +0000 (15:02 -0700)
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 <salil.mehta@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c

index 58d210bbb3112fd79d0a6b939c5fc5c2a911b067..2dd2af269b464872caa45fb4366fe8a97c49f137 100644 (file)
@@ -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);