linux/drivers/scsi/bfa
Arnd Bergmann 37126399da scsi: bfa: Fix function pointer type mismatch for state machines
The bfa driver is full of state machines and a generic abstraction layer
for them. This relies on casting function pointers, but that is no longer
allowed when CONFIG_CFI_CLANG is enabled and causes a huge number of
warnings like:

drivers/scsi/bfa/bfad.c:169:3: error: cast from 'void (*)(struct bfad_s *, enum bfad_sm_event)' to 'bfa_sm_t' (aka 'void (*)(void *, int)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
                bfa_sm_set_state(bfad, bfad_sm_created);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Rework the mechanism to no longer require the function pointer casts, by
having separate types for each individual state machine. This in turn
requires moving the enum definitions for each state machine into the header
files in order to define the typedef.

Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20240222124433.2046570-2-arnd@kernel.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2024-02-26 21:16:48 -05:00
..
bfa_core.c scsi: bfa: Fix function pointer type mismatch for hcb_qe->cbfn 2024-02-26 21:16:48 -05:00
bfa_cs.h scsi: bfa: Fix function pointer type mismatch for state machines 2024-02-26 21:16:48 -05:00
bfa_defs_fcs.h
bfa_defs_svc.h
bfa_defs.h
bfa_fc.h scsi: bfa: Replace one-element array with flexible-array member in struct fc_rscn_pl_s 2023-08-21 17:13:56 -04:00
bfa_fcbuild.c scsi: bfa: Replace one-element array with flexible-array member in struct fc_rscn_pl_s 2023-08-21 17:13:56 -04:00
bfa_fcbuild.h
bfa_fcpim.c scsi: bfa: Fix function pointer type mismatch for state machines 2024-02-26 21:16:48 -05:00
bfa_fcpim.h scsi: bfa: Fix function pointer type mismatch for state machines 2024-02-26 21:16:48 -05:00
bfa_fcs_fcpim.c scsi: bfa: Fix function pointer type mismatch for state machines 2024-02-26 21:16:48 -05:00
bfa_fcs_lport.c scsi: bfa: Fix function pointer type mismatch for state machines 2024-02-26 21:16:48 -05:00
bfa_fcs_rport.c scsi: bfa: Fix function pointer type mismatch for state machines 2024-02-26 21:16:48 -05:00
bfa_fcs.c scsi: bfa: Replace all non-returning strlcpy() with strscpy() 2023-05-16 21:38:36 -04:00
bfa_fcs.h scsi: bfa: Fix function pointer type mismatch for state machines 2024-02-26 21:16:48 -05:00
bfa_hw_cb.c
bfa_hw_ct.c
bfa_ioc_cb.c
bfa_ioc_ct.c
bfa_ioc.c scsi: bfa: Fix function pointer type mismatch for state machines 2024-02-26 21:16:48 -05:00
bfa_ioc.h scsi: bfa: Fix function pointer type mismatch for state machines 2024-02-26 21:16:48 -05:00
bfa_modules.h
bfa_plog.h
bfa_port.c
bfa_port.h
bfa_svc.c scsi: bfa: Fix function pointer type mismatch for state machines 2024-02-26 21:16:48 -05:00
bfa_svc.h scsi: bfa: Fix function pointer type mismatch for state machines 2024-02-26 21:16:48 -05:00
bfa.h scsi: bfa: Fix function pointer type mismatch for state machines 2024-02-26 21:16:48 -05:00
bfad_attr.c scsi: bfa: Replace all non-returning strlcpy() with strscpy() 2023-05-16 21:38:36 -04:00
bfad_bsg.c scsi: bfa: Fix function pointer type mismatch for hcb_qe->cbfn 2024-02-26 21:16:48 -05:00
bfad_bsg.h
bfad_debugfs.c
bfad_drv.h scsi: bfa: Fix function pointer type mismatch for state machines 2024-02-26 21:16:48 -05:00
bfad_im.c scsi: bfa: Replace all non-returning strlcpy() with strscpy() 2023-05-16 21:38:36 -04:00
bfad_im.h
bfad.c scsi: bfa: Replace all non-returning strlcpy() with strscpy() 2023-05-16 21:38:36 -04:00
bfi_ms.h
bfi_reg.h
bfi.h
Makefile