Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f6849d01 authored by Colin Ian King's avatar Colin Ian King Committed by David S. Miller
Browse files

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: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent abd21a87
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -592,15 +592,11 @@ 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);
	dev_err(&adapter->pdev->dev, "Receive Peg initialization not complete, state: 0x%x.\n",
		val);
	return -EIO;
}

	return 0;
}

int
qlcnic_check_fw_status(struct qlcnic_adapter *adapter)
{