diff options
author | Colin Ian King <colin.king@canonical.com> | 2017-09-01 15:44:31 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-09-01 19:33:55 +0200 |
commit | f6849d01bdc0830c5f4aaba11785827e20d3bad5 (patch) | |
tree | aae18b94c6678d7ef42f471da674d0046ae4785e /drivers/net/ethernet/qlogic | |
parent | Merge branch 'mdio-mux-Misc-fix' (diff) | |
download | linux-f6849d01bdc0830c5f4aaba11785827e20d3bad5.tar.xz linux-f6849d01bdc0830c5f4aaba11785827e20d3bad5.zip |
qlcnic: remove redundant zero check on retries counter
At the end of the do while loop the integer counter retries will
always be zero and so the subsequent check to see if it is zero
is always true and therefore redundant. Remove the redundant check
and always return -EIO on this return path. Also unbreak the literal
string in dev_err message to clean up a checkpatch warning.
Detected by CoverityScan, CID#744279 ("Logically dead code")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/qlogic')
-rw-r--r-- | drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c index be41e4c77b65..c48a0e2d4d7e 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c @@ -592,13 +592,9 @@ qlcnic_receive_peg_ready(struct qlcnic_adapter *adapter) } while (--retries); - if (!retries) { - dev_err(&adapter->pdev->dev, "Receive Peg initialization not " - "complete, state: 0x%x.\n", val); - return -EIO; - } - - return 0; + dev_err(&adapter->pdev->dev, "Receive Peg initialization not complete, state: 0x%x.\n", + val); + return -EIO; } int |