linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: lpfc: return NULL rather than a plain 0 integer
@ 2021-09-25 22:41 Colin King
  2021-09-29  3:21 ` Martin K. Petersen
  2021-10-05  4:34 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: Colin King @ 2021-09-25 22:41 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>

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.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/scsi/lpfc/lpfc_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 8d5537ec0f30..6dc0be8bc177 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -6564,7 +6564,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 */
-- 
2.32.0


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

* Re: [PATCH] scsi: lpfc: return NULL rather than a plain 0 integer
  2021-09-25 22:41 [PATCH] scsi: lpfc: return NULL rather than a plain 0 integer Colin King
@ 2021-09-29  3:21 ` Martin K. Petersen
  2021-10-05  4:34 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2021-09-29  3:21 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,

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

Applied to 5.16/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: [PATCH] scsi: lpfc: return NULL rather than a plain 0 integer
  2021-09-25 22:41 [PATCH] scsi: lpfc: return NULL rather than a plain 0 integer Colin King
  2021-09-29  3:21 ` Martin K. Petersen
@ 2021-10-05  4:34 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2021-10-05  4:34 UTC (permalink / raw)
  To: James Smart, linux-scsi, James E . J . Bottomley, Dick Kennedy,
	Colin King
  Cc: Martin K . Petersen, kernel-janitors, linux-kernel

On Sat, 25 Sep 2021 23:41:13 +0100, Colin King wrote:

> From: Colin Ian King <colin.king@canonical.com>
> 
> 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.
> 
> 
> [...]

Applied to 5.16/scsi-queue, thanks!

[1/1] scsi: lpfc: return NULL rather than a plain 0 integer
      https://git.kernel.org/mkp/scsi/c/5860d9fb5622

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2021-10-05  4:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-25 22:41 [PATCH] scsi: lpfc: return NULL rather than a plain 0 integer Colin King
2021-09-29  3:21 ` Martin K. Petersen
2021-10-05  4:34 ` 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).