linux-stable/drivers/scsi/bfa
Arnd Bergmann 42249ebd24 scsi: bfa: Fix function pointer type mismatch for hcb_qe->cbfn
[ Upstream commit b69600231f ]

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: 37ea0558b8 ("[SCSI] bfa: Added support to collect and reset fcport stats")
Fixes: 3ec4f2c8bf ("[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-03-26 18:17:24 -04:00
..
Makefile
bfa.h scsi: bfa: Fix function pointer type mismatch for hcb_qe->cbfn 2024-03-26 18:17:24 -04:00
bfa_core.c scsi: bfa: Fix function pointer type mismatch for hcb_qe->cbfn 2024-03-26 18:17:24 -04:00
bfa_cs.h
bfa_defs.h
bfa_defs_fcs.h
bfa_defs_svc.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
bfa_fcpim.h
bfa_fcs.c scsi: bfa: Replace all non-returning strlcpy() with strscpy() 2023-05-16 21:38:36 -04:00
bfa_fcs.h
bfa_fcs_fcpim.c
bfa_fcs_lport.c scsi: bfa: Replace all non-returning strlcpy() with strscpy() 2023-05-16 21:38:36 -04:00
bfa_fcs_rport.c
bfa_hw_cb.c
bfa_hw_ct.c
bfa_ioc.c scsi: bfa: Replace all non-returning strlcpy() with strscpy() 2023-05-16 21:38:36 -04:00
bfa_ioc.h scsi: bfa: Fix function pointer type mismatch for hcb_qe->cbfn 2024-03-26 18:17:24 -04:00
bfa_ioc_cb.c
bfa_ioc_ct.c
bfa_modules.h
bfa_plog.h
bfa_port.c
bfa_port.h
bfa_svc.c scsi: bfa: Replace all non-returning strlcpy() with strscpy() 2023-05-16 21:38:36 -04:00
bfa_svc.h
bfad.c scsi: bfa: Replace all non-returning strlcpy() with strscpy() 2023-05-16 21:38:36 -04: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-03-26 18:17:24 -04:00
bfad_bsg.h
bfad_debugfs.c scsi: bfa: Remove redundant NULL check 2022-04-25 23:23:05 -04:00
bfad_drv.h scsi: bfa: Drop redundant pci_enable_pcie_error_reporting() 2023-03-09 22:00:38 -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 scsi: bfa: Convert bfad_reset_sdev_bflags() from a macro into a function 2022-11-08 03:34:39 +00:00
bfi.h
bfi_ms.h
bfi_reg.h