[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <yq1il0vqnzv.fsf@ca-mkp.ca.oracle.com>
Date: Fri, 05 Apr 2024 21:27:45 -0400
From: "Martin K. Petersen" <martin.petersen@...cle.com>
To: Arnd Bergmann <arnd@...nel.org>
Cc: "Manoj N. Kumar" <manoj@...ux.ibm.com>,
"Matthew R. Ochs"
<mrochs@...ux.ibm.com>,
Uma Krishnan <ukrishn@...ux.ibm.com>,
"Martin K.
Petersen" <martin.petersen@...cle.com>,
Arnd Bergmann <arnd@...db.de>,
"James E.J. Bottomley" <jejb@...ux.ibm.com>,
Nathan Chancellor
<nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Bill
Wendling <morbo@...gle.com>,
Justin Stitt <justinstitt@...gle.com>, linux-scsi@...r.kernel.org,
linux-kernel@...r.kernel.org, llvm@...ts.linux.dev
Subject: Re: [PATCH] [v2] cxlflash: fix function pointer cast warnings
Arnd,
> 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.
Applied to 6.10/scsi-staging, thanks!
--
Martin K. Petersen Oracle Linux Engineering
Powered by blists - more mailing lists