scsi: lpfc: Refactor and clean up mailbox command memory free
authorJustin Tee <justin.tee@broadcom.com>
Tue, 31 Oct 2023 19:12:21 +0000 (12:12 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 15 Nov 2023 14:52:58 +0000 (09:52 -0500)
commit349b1e2c1bdaf0bd00ac5065593563dbf6426fa6
treec5a99ff37f715d61f69d8ba3c227d157e9852d38
parent57ea41eb7fe6d6a6bf80f40de9acddb33b41eeb9
scsi: lpfc: Refactor and clean up mailbox command memory free

A lot of repeated clean up code exists when freeing mailbox commands in
lpfc_mem_free_all().

Introduce a lpfc_mem_free_sli_mbox() helper routine to refactor the
copy-paste code.  Additionally, reinitialize the mailbox command structure
context pointers to NULL in lpfc_sli4_mbox_cmd_free().

Signed-off-by: Justin Tee <justin.tee@broadcom.com>
Link: https://lore.kernel.org/r/20231031191224.150862-7-justintee8345@gmail.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_mbox.c
drivers/scsi/lpfc/lpfc_mem.c
drivers/scsi/lpfc/lpfc_sli.c
drivers/scsi/lpfc/lpfc_sli.h