diff mbox series

lpfc: Remove unnecessary null ndlp check in lpfc_sli_prep_wqe()

Message ID 20220426181315.8990-1-jsmart2021@gmail.com (mailing list archive)
State Accepted
Headers show
Series lpfc: Remove unnecessary null ndlp check in lpfc_sli_prep_wqe() | expand

Commit Message

James Smart April 26, 2022, 6:13 p.m. UTC
Smatch had the following warning:
drivers/scsi/lpfc/lpfc_sli.c:22305 lpfc_sli_prep_wqe() error: we previously assumed 'ndlp' could be null (see line 22298)

Remove the unnecessary null check

Fixes: d51cf5bd926c ("scsi: lpfc: Fix field overload in lpfc_iocbq data structure")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
---
 drivers/scsi/lpfc/lpfc_sli.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Martin K. Petersen April 26, 2022, 10:33 p.m. UTC | #1
James,

> Smatch had the following warning:
> drivers/scsi/lpfc/lpfc_sli.c:22305 lpfc_sli_prep_wqe() error: we
> previously assumed 'ndlp' could be null (see line 22298)
>
> Remove the unnecessary null check

Applied to 5.19/scsi-staging, thanks!
Martin K. Petersen May 3, 2022, 12:51 a.m. UTC | #2
On Tue, 26 Apr 2022 11:13:15 -0700, James Smart wrote:

> Smatch had the following warning:
> drivers/scsi/lpfc/lpfc_sli.c:22305 lpfc_sli_prep_wqe() error: we previously assumed 'ndlp' could be null (see line 22298)
> 
> Remove the unnecessary null check
> 
> 

Applied to 5.19/scsi-queue, thanks!

[1/1] lpfc: Remove unnecessary null ndlp check in lpfc_sli_prep_wqe()
      https://git.kernel.org/mkp/scsi/c/3d1d34ec1fbc
diff mbox series

Patch

diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index 8bf62697317a..f7815fe0da82 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -22284,7 +22284,7 @@  lpfc_sli_prep_wqe(struct lpfc_hba *phba, struct lpfc_iocbq *job)
 				bf_set(wqe_ct, &wqe->els_req.wqe_com, 1);
 				bf_set(wqe_ctxt_tag, &wqe->els_req.wqe_com,
 				       phba->vpi_ids[job->vport->vpi]);
-			} else if (pcmd && ndlp) {
+			} else if (pcmd) {
 				bf_set(wqe_ct, &wqe->els_req.wqe_com, 0);
 				bf_set(wqe_ctxt_tag, &wqe->els_req.wqe_com,
 				       phba->sli4_hba.rpi_ids[ndlp->nlp_rpi]);