kernel_samsung_a53x/drivers/scsi/bfa
Arnd Bergmann 5fe0923e1e scsi: bfa: Fix function pointer type mismatch for hcb_qe->cbfn
[ Upstream commit b69600231f751304db914c63b937f7098ed2895c ]

Some callback functions used here take a boolean argument, others take a
status argument. This breaks KCFI type checking, so clang now warns about
the function pointer cast:

drivers/scsi/bfa/bfad_bsg.c:2138:29: error: cast from 'void (*)(void *, enum bfa_status)' to 'bfa_cb_cbfn_t' (aka 'void (*)(void *, enum bfa_boolean)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]

Assuming the code is actually correct here and the callers always match the
argument types of the callee, rework this to replace the explicit cast with
a union of the two pointer types. This does not change the behavior of the
code, so if something is actually broken here, a larger rework may be
necessary.

Fixes: 37ea0558b87a ("[SCSI] bfa: Added support to collect and reset fcport stats")
Fixes: 3ec4f2c8bff2 ("[SCSI] bfa: Added support to configure QOS and collect stats.")
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20240222124433.2046570-1-arnd@kernel.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 08:44:57 +01:00
..
bfa.h scsi: bfa: Fix function pointer type mismatch for hcb_qe->cbfn 2024-11-19 08:44:57 +01:00
bfa_core.c scsi: bfa: Fix function pointer type mismatch for hcb_qe->cbfn 2024-11-19 08:44:57 +01:00
bfa_cs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfa_defs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfa_defs_fcs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfa_defs_svc.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfa_fc.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfa_fcbuild.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfa_fcbuild.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfa_fcpim.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfa_fcpim.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfa_fcs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfa_fcs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfa_fcs_fcpim.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfa_fcs_lport.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfa_fcs_rport.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfa_hw_cb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfa_hw_ct.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfa_ioc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfa_ioc.h scsi: bfa: Fix function pointer type mismatch for hcb_qe->cbfn 2024-11-19 08:44:57 +01:00
bfa_ioc_cb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfa_ioc_ct.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfa_modules.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfa_plog.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfa_port.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfa_port.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfa_svc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfa_svc.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfad.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfad_attr.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfad_bsg.c scsi: bfa: Fix function pointer type mismatch for hcb_qe->cbfn 2024-11-19 08:44:57 +01:00
bfad_bsg.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfad_debugfs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfad_drv.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfad_im.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfad_im.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfi.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfi_ms.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfi_reg.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00