scsi: lpfc: Define types in a union for generic void *context3 ptr
authorJustin Tee <justin.tee@broadcom.com>
Tue, 5 Mar 2024 20:05:01 +0000 (12:05 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sun, 10 Mar 2024 22:56:44 +0000 (18:56 -0400)
commit85d77f917a3b86872d3d52d5cea945a661858d20
tree786fd9b96b16bd10ce62025217e1425ac820d947
parent115d137aa918d879e3cca9605bbf59e0482aa734
scsi: lpfc: Define types in a union for generic void *context3 ptr

In LPFC_MBOXQ_t, the void *context3 ptr is used for various paths.  It is
treated as a generic pointer, and is type casted during its usage.

The issue with this is that it can sometimes get confusing when reading
code as to what the context3 ptr is being used for and mistakenly be reused
in a different context.

Rename context3 to ctx_u, and declare it as a union of defined ptr types.
From now on, the ctx_u ptr may be used only if users define the use case
type.

Signed-off-by: Justin Tee <justin.tee@broadcom.com>
Link: https://lore.kernel.org/r/20240305200503.57317-11-justintee8345@gmail.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_bsg.c
drivers/scsi/lpfc/lpfc_els.c
drivers/scsi/lpfc/lpfc_mbox.c
drivers/scsi/lpfc/lpfc_nportdisc.c
drivers/scsi/lpfc/lpfc_sli.c
drivers/scsi/lpfc/lpfc_sli.h
drivers/scsi/lpfc/lpfc_sli4.h