linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: lpfc: remove redundant null check on eqe
@ 2017-09-08  8:02 Colin King
  2017-09-14 14:47 ` James Smart
  2017-09-15 19:39 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: Colin King @ 2017-09-08  8:02 UTC (permalink / raw)
  To: James Smart, Dick Kennedy, James E . J . Bottomley,
	Martin K . Petersen, linux-scsi
  Cc: kernel-janitors, linux-kernel

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

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] scsi: lpfc: remove redundant null check on eqe
  2017-09-08  8:02 [PATCH] scsi: lpfc: remove redundant null check on eqe Colin King
@ 2017-09-14 14:47 ` James Smart
  2017-09-15 19:39 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: James Smart @ 2017-09-14 14:47 UTC (permalink / raw)
  To: Colin King, Dick Kennedy, James E . J . Bottomley,
	Martin K . Petersen, linux-scsi
  Cc: kernel-janitors, linux-kernel

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>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] scsi: lpfc: remove redundant null check on eqe
  2017-09-08  8:02 [PATCH] scsi: lpfc: remove redundant null check on eqe Colin King
  2017-09-14 14:47 ` James Smart
@ 2017-09-15 19:39 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2017-09-15 19:39 UTC (permalink / raw)
  To: Colin King
  Cc: James Smart, Dick Kennedy, James E . J . Bottomley,
	Martin K . Petersen, linux-scsi, kernel-janitors, linux-kernel


Colin,

> 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.

Applied to 4.15/scsi-queue. Thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-09-15 19:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-08  8:02 [PATCH] scsi: lpfc: remove redundant null check on eqe Colin King
2017-09-14 14:47 ` James Smart
2017-09-15 19:39 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).