public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: drivers: scsi: lpfc: Fix warning: Using plain integer as NULL pointer in lpfc_init.c
@ 2024-08-10 11:23 Dipendra Khadka
  2024-08-12 16:24 ` Justin Tee
  0 siblings, 1 reply; 3+ messages in thread
From: Dipendra Khadka @ 2024-08-10 11:23 UTC (permalink / raw)
  To: james.smart, dick.kennedy, martin.petersen
  Cc: Dipendra Khadka, linux-scsi, linux-kernel

sparse reported following warnings:

'''
drivers/scsi/lpfc/lpfc_init.c:5517:32: warning: Using plain integer as NULL pointer
drivers/scsi/lpfc/lpfc_init.c:5526:32: warning: Using plain integer as NULL pointer
'''
This patch chanes integer 0 to NULL.

Signed-off-by: Dipendra Khadka <kdipendra88@gmail.com>
---
 drivers/scsi/lpfc/lpfc_init.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 69a5249e007a..7f012ba3edb2 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -5514,7 +5514,7 @@ lpfc_sli4_perform_vport_cvl(struct lpfc_vport *vport)
 		/* Cannot find existing Fabric ndlp, so allocate a new one */
 		ndlp = lpfc_nlp_init(vport, Fabric_DID);
 		if (!ndlp)
-			return 0;
+			return NULL;
 		/* Set the node type */
 		ndlp->nlp_type |= NLP_FABRIC;
 		/* Put ndlp onto node list */
@@ -5523,7 +5523,7 @@ lpfc_sli4_perform_vport_cvl(struct lpfc_vport *vport)
 		/* re-setup ndlp without removing from node list */
 		ndlp = lpfc_enable_node(vport, ndlp, NLP_STE_UNUSED_NODE);
 		if (!ndlp)
-			return 0;
+			return NULL;
 	}
 	if ((phba->pport->port_state < LPFC_FLOGI) &&
 		(phba->pport->port_state != LPFC_VPORT_FAILED))
-- 
2.43.0


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

* Re: [PATCH] staging: drivers: scsi: lpfc: Fix warning: Using plain integer as NULL pointer in lpfc_init.c
  2024-08-10 11:23 [PATCH] staging: drivers: scsi: lpfc: Fix warning: Using plain integer as NULL pointer in lpfc_init.c Dipendra Khadka
@ 2024-08-12 16:24 ` Justin Tee
  2024-08-15 19:02   ` Dipendra Khadka
  0 siblings, 1 reply; 3+ messages in thread
From: Justin Tee @ 2024-08-12 16:24 UTC (permalink / raw)
  To: Dipendra Khadka
  Cc: Justin Tee, james.smart, dick.kennedy, martin.petersen,
	linux-scsi, linux-kernel

Hi Dipendra,

Perhaps the branch being referred to is out of date?

This has already been addressed in the following commit.

commit 5860d9fb5622ecd79913ac981403c612f6c8a2d8
Author: Colin Ian King <colin.i.king@gmail.com>
Date:   Sat Sep 25 23:41:13 2021 +0100

    scsi: lpfc: Return NULL rather than a plain 0 integer

    Function lpfc_sli4_perform_vport_cvl() returns a pointer to struct
    lpfc_nodelist so returning a plain 0 integer isn't good practice.  Fix this
    by returning a NULL instead.

    Link: https://lore.kernel.org/r/20210925224113.183040-1-colin.king@canonical.com
    Signed-off-by: Colin Ian King <colin.king@canonical.com>
    Signed-off-by: Martin K. Petersen martin.petersen@oracle.com


And, the routine called lpfc_enable_node doesn’t exist anymore.

Regards,
Justin Tee

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

* Re: [PATCH] staging: drivers: scsi: lpfc: Fix warning: Using plain integer as NULL pointer in lpfc_init.c
  2024-08-12 16:24 ` Justin Tee
@ 2024-08-15 19:02   ` Dipendra Khadka
  0 siblings, 0 replies; 3+ messages in thread
From: Dipendra Khadka @ 2024-08-15 19:02 UTC (permalink / raw)
  To: Justin Tee
  Cc: Justin Tee, james.smart, dick.kennedy, martin.petersen,
	linux-scsi, linux-kernel

Hi Justin,

On Mon, 12 Aug 2024 at 22:09, Justin Tee <justintee8345@gmail.com> wrote:
>
> Hi Dipendra,
>
> Perhaps the branch being referred to is out of date?
>

Sorry, you are right. It is due to the branch mismatching.

> This has already been addressed in the following commit.
>
> commit 5860d9fb5622ecd79913ac981403c612f6c8a2d8
> Author: Colin Ian King <colin.i.king@gmail.com>
> Date:   Sat Sep 25 23:41:13 2021 +0100
>
>     scsi: lpfc: Return NULL rather than a plain 0 integer
>
>     Function lpfc_sli4_perform_vport_cvl() returns a pointer to struct
>     lpfc_nodelist so returning a plain 0 integer isn't good practice.  Fix this
>     by returning a NULL instead.
>
>     Link: https://lore.kernel.org/r/20210925224113.183040-1-colin.king@canonical.com
>     Signed-off-by: Colin Ian King <colin.king@canonical.com>
>     Signed-off-by: Martin K. Petersen martin.petersen@oracle.com
>
>
> And, the routine called lpfc_enable_node doesn’t exist anymore.
>
> Regards,
> Justin Tee

Best Regard,
Dipendra Khadka

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

end of thread, other threads:[~2024-08-15 19:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-10 11:23 [PATCH] staging: drivers: scsi: lpfc: Fix warning: Using plain integer as NULL pointer in lpfc_init.c Dipendra Khadka
2024-08-12 16:24 ` Justin Tee
2024-08-15 19:02   ` Dipendra Khadka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox