scsi: cxlflash: Fix function pointer cast warnings
authorArnd Bergmann <arnd@arndb.de>
Thu, 4 Apr 2024 16:14:58 +0000 (18:14 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 8 Apr 2024 19:08:52 +0000 (15:08 -0400)
commit28fc2bd2c7298d647fcbab7b11532a1f5fda7470
treedbe2c42185da88d11ead4d02c2fb0e3c5db93f77
parent33507b3964f136ea1592718cb81885c8f9354f65
scsi: cxlflash: Fix function pointer cast warnings

Calling a function through an incompatible pointer type causes breaks kcfi,
so clang warns about the assignments:

drivers/scsi/cxlflash/main.c:3498:3: error: cast from 'int (*)(struct cxlflash_cfg *, struct ht_cxlflash_lun_provision *)' to 'hioctl' (aka 'int (*)(struct cxlflash_cfg *, void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
 3498 |                 (hioctl)cxlflash_lun_provision },
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/cxlflash/main.c:3500:3: error: cast from 'int (*)(struct cxlflash_cfg *, struct ht_cxlflash_afu_debug *)' to 'hioctl' (aka 'int (*)(struct cxlflash_cfg *, void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
 3500 |                 (hioctl)cxlflash_afu_debug },
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~

Address these by changing the functions to have the correct type and
replace the function pointer cast with a cast of its argument.

Link: https://lore.kernel.org/lkml/20240326145140.3257163-6-arnd@kernel.org/
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20240404161524.3473857-1-arnd@kernel.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/cxlflash/lunmgt.c
drivers/scsi/cxlflash/main.c
drivers/scsi/cxlflash/superpipe.c
drivers/scsi/cxlflash/superpipe.h
drivers/scsi/cxlflash/vlun.c