diff mbox

scsi: lpfc: remove redundant null check on eqe

Message ID 20170908080201.9592-1-colin.king@canonical.com (mailing list archive)
State Accepted
Headers show

Commit Message

Colin King Sept. 8, 2017, 8:02 a.m. UTC
From: Colin Ian King <colin.king@canonical.com>

The pointer eqe is always non-null inside the while loop, so the
check to see if eqe is NULL is redudant and hence can be removed.

Detected by CoverityScan CID#1248693 ("Logically Dead Code")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/scsi/lpfc/lpfc_sli.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

James Smart Sept. 14, 2017, 2:47 p.m. UTC | #1
On 9/8/2017 1:02 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The pointer eqe is always non-null inside the while loop, so the
> check to see if eqe is NULL is redudant and hence can be removed.
>
> Detected by CoverityScan CID#1248693 ("Logically Dead Code")
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>

Yep. thank you

Signed-off-by: James Smart <james.smart@broadcom.com>
diff mbox

Patch

diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index 8b119f87b51d..80036a9fae7f 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -13760,9 +13760,6 @@  lpfc_sli4_hba_intr_handler(int irq, void *dev_id)
 	 * Process all the event on FCP fast-path EQ
 	 */
 	while ((eqe = lpfc_sli4_eq_get(fpeq))) {
-		if (eqe == NULL)
-			break;
-
 		ccount += lpfc_sli4_hba_handle_eqe(phba, eqe, hba_eqidx);
 		if (!(++ecount % fpeq->entry_repost) ||
 		    ccount > LPFC_MAX_ISR_CQE)