* [PATCH] mei: late_bind: Fix -Wincompatible-function-pointer-types-strict
@ 2025-09-20 23:17 Nathan Chancellor
2025-10-23 14:27 ` Lucas De Marchi
0 siblings, 1 reply; 4+ messages in thread
From: Nathan Chancellor @ 2025-09-20 23:17 UTC (permalink / raw)
To: Lucas De Marchi, Rodrigo Vivi, Alexander Usyskin, Anshuman Gupta,
Mika Westerberg
Cc: Arnd Bergmann, Greg Kroah-Hartman, intel-xe, linux-kernel,
Nathan Chancellor
When building with -Wincompatible-function-pointer-types-strict, a
warning designed to catch kernel control flow integrity (kCFI) issues at
build time, there is an instance in the new mei late binding code
originating from the type parameter of mei_lb_push_payload():
drivers/misc/mei/mei_lb.c:211:18: error: incompatible function pointer types initializing 'int (*)(struct device *, u32, u32, const void *, size_t)' (aka 'int (*)(struct device *, unsigned int, unsigned int, const void *, unsigned long)') with an expression of type 'int (struct device *, enum intel_lb_type, u32, const void *, size_t)' (aka 'int (struct device *, enum intel_lb_type, unsigned int, const void *, unsigned long)') [-Werror,-Wincompatible-function-pointer-types-strict]
211 | .push_payload = mei_lb_push_payload,
| ^~~~~~~~~~~~~~~~~~~
While 'unsigned int' and 'enum intel_lb_type' are ABI compatible, hence
no regular warning from -Wincompatible-function-pointer-types, the
mismatch will trigger a kCFI violation when mei_lb_push_payload() is
called indirectly.
Update the type parameter of mei_lb_push_payload() to be 'u32' to match
the prototype in 'struct intel_lb_component_ops', clearing up the
warning and kCFI violation.
Fixes: 741eeabb7c78 ("mei: late_bind: add late binding component driver")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
drivers/misc/mei/mei_lb.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/misc/mei/mei_lb.c b/drivers/misc/mei/mei_lb.c
index 77686b108d3c..78717ee8ac9a 100644
--- a/drivers/misc/mei/mei_lb.c
+++ b/drivers/misc/mei/mei_lb.c
@@ -134,8 +134,7 @@ static bool mei_lb_check_response(const struct device *dev, ssize_t bytes,
return true;
}
-static int mei_lb_push_payload(struct device *dev,
- enum intel_lb_type type, u32 flags,
+static int mei_lb_push_payload(struct device *dev, u32 type, u32 flags,
const void *payload, size_t payload_size)
{
struct mei_cl_device *cldev;
---
base-commit: d9b2623319fa20c2206754284291817488329648
change-id: 20250920-drm-xe-fix-wifpts-58fd1be433d4
Best regards,
--
Nathan Chancellor <nathan@kernel.org>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] mei: late_bind: Fix -Wincompatible-function-pointer-types-strict
2025-09-20 23:17 [PATCH] mei: late_bind: Fix -Wincompatible-function-pointer-types-strict Nathan Chancellor
@ 2025-10-23 14:27 ` Lucas De Marchi
2025-10-23 16:52 ` Nathan Chancellor
0 siblings, 1 reply; 4+ messages in thread
From: Lucas De Marchi @ 2025-10-23 14:27 UTC (permalink / raw)
To: Nathan Chancellor
Cc: Rodrigo Vivi, Alexander Usyskin, Anshuman Gupta, Mika Westerberg,
Arnd Bergmann, Greg Kroah-Hartman, intel-xe, linux-kernel
On Sat, Sep 20, 2025 at 04:17:50PM -0700, Nathan Chancellor wrote:
>When building with -Wincompatible-function-pointer-types-strict, a
>warning designed to catch kernel control flow integrity (kCFI) issues at
>build time, there is an instance in the new mei late binding code
>originating from the type parameter of mei_lb_push_payload():
>
> drivers/misc/mei/mei_lb.c:211:18: error: incompatible function pointer types initializing 'int (*)(struct device *, u32, u32, const void *, size_t)' (aka 'int (*)(struct device *, unsigned int, unsigned int, const void *, unsigned long)') with an expression of type 'int (struct device *, enum intel_lb_type, u32, const void *, size_t)' (aka 'int (struct device *, enum intel_lb_type, unsigned int, const void *, unsigned long)') [-Werror,-Wincompatible-function-pointer-types-strict]
> 211 | .push_payload = mei_lb_push_payload,
> | ^~~~~~~~~~~~~~~~~~~
>
>While 'unsigned int' and 'enum intel_lb_type' are ABI compatible, hence
>no regular warning from -Wincompatible-function-pointer-types, the
>mismatch will trigger a kCFI violation when mei_lb_push_payload() is
>called indirectly.
>
>Update the type parameter of mei_lb_push_payload() to be 'u32' to match
>the prototype in 'struct intel_lb_component_ops', clearing up the
>warning and kCFI violation.
>
>Fixes: 741eeabb7c78 ("mei: late_bind: add late binding component driver")
>Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Sasha, is this fix something you are taking through char-misc since the
commits that added it already propagated through the 6.18-rc?
thanks
Lucas De Marchi
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] mei: late_bind: Fix -Wincompatible-function-pointer-types-strict
2025-10-23 14:27 ` Lucas De Marchi
@ 2025-10-23 16:52 ` Nathan Chancellor
2025-10-23 16:59 ` Lucas De Marchi
0 siblings, 1 reply; 4+ messages in thread
From: Nathan Chancellor @ 2025-10-23 16:52 UTC (permalink / raw)
To: Lucas De Marchi
Cc: Rodrigo Vivi, Alexander Usyskin, Anshuman Gupta, Mika Westerberg,
Arnd Bergmann, Greg Kroah-Hartman, intel-xe, linux-kernel
On Thu, Oct 23, 2025 at 09:27:03AM -0500, Lucas De Marchi wrote:
> On Sat, Sep 20, 2025 at 04:17:50PM -0700, Nathan Chancellor wrote:
> > When building with -Wincompatible-function-pointer-types-strict, a
> > warning designed to catch kernel control flow integrity (kCFI) issues at
> > build time, there is an instance in the new mei late binding code
> > originating from the type parameter of mei_lb_push_payload():
> >
> > drivers/misc/mei/mei_lb.c:211:18: error: incompatible function pointer types initializing 'int (*)(struct device *, u32, u32, const void *, size_t)' (aka 'int (*)(struct device *, unsigned int, unsigned int, const void *, unsigned long)') with an expression of type 'int (struct device *, enum intel_lb_type, u32, const void *, size_t)' (aka 'int (struct device *, enum intel_lb_type, unsigned int, const void *, unsigned long)') [-Werror,-Wincompatible-function-pointer-types-strict]
> > 211 | .push_payload = mei_lb_push_payload,
> > | ^~~~~~~~~~~~~~~~~~~
> >
> > While 'unsigned int' and 'enum intel_lb_type' are ABI compatible, hence
> > no regular warning from -Wincompatible-function-pointer-types, the
> > mismatch will trigger a kCFI violation when mei_lb_push_payload() is
> > called indirectly.
> >
> > Update the type parameter of mei_lb_push_payload() to be 'u32' to match
> > the prototype in 'struct intel_lb_component_ops', clearing up the
> > warning and kCFI violation.
> >
> > Fixes: 741eeabb7c78 ("mei: late_bind: add late binding component driver")
> > Signed-off-by: Nathan Chancellor <nathan@kernel.org>
>
> Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
>
> Sasha, is this fix something you are taking through char-misc since the
> commits that added it already propagated through the 6.18-rc?
It looks like Greg already took this via char-misc-linus:
https://git.kernel.org/gregkh/char-misc/c/98718e80af0bb1cd80f4bfe565dd60c57debad51
Cheers,
Nathan
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] mei: late_bind: Fix -Wincompatible-function-pointer-types-strict
2025-10-23 16:52 ` Nathan Chancellor
@ 2025-10-23 16:59 ` Lucas De Marchi
0 siblings, 0 replies; 4+ messages in thread
From: Lucas De Marchi @ 2025-10-23 16:59 UTC (permalink / raw)
To: Nathan Chancellor
Cc: Rodrigo Vivi, Alexander Usyskin, Anshuman Gupta, Mika Westerberg,
Arnd Bergmann, Greg Kroah-Hartman, intel-xe, linux-kernel
On Thu, Oct 23, 2025 at 06:52:05PM +0200, Nathan Chancellor wrote:
>On Thu, Oct 23, 2025 at 09:27:03AM -0500, Lucas De Marchi wrote:
>> On Sat, Sep 20, 2025 at 04:17:50PM -0700, Nathan Chancellor wrote:
>> > When building with -Wincompatible-function-pointer-types-strict, a
>> > warning designed to catch kernel control flow integrity (kCFI) issues at
>> > build time, there is an instance in the new mei late binding code
>> > originating from the type parameter of mei_lb_push_payload():
>> >
>> > drivers/misc/mei/mei_lb.c:211:18: error: incompatible function pointer types initializing 'int (*)(struct device *, u32, u32, const void *, size_t)' (aka 'int (*)(struct device *, unsigned int, unsigned int, const void *, unsigned long)') with an expression of type 'int (struct device *, enum intel_lb_type, u32, const void *, size_t)' (aka 'int (struct device *, enum intel_lb_type, unsigned int, const void *, unsigned long)') [-Werror,-Wincompatible-function-pointer-types-strict]
>> > 211 | .push_payload = mei_lb_push_payload,
>> > | ^~~~~~~~~~~~~~~~~~~
>> >
>> > While 'unsigned int' and 'enum intel_lb_type' are ABI compatible, hence
>> > no regular warning from -Wincompatible-function-pointer-types, the
>> > mismatch will trigger a kCFI violation when mei_lb_push_payload() is
>> > called indirectly.
>> >
>> > Update the type parameter of mei_lb_push_payload() to be 'u32' to match
>> > the prototype in 'struct intel_lb_component_ops', clearing up the
>> > warning and kCFI violation.
>> >
>> > Fixes: 741eeabb7c78 ("mei: late_bind: add late binding component driver")
>> > Signed-off-by: Nathan Chancellor <nathan@kernel.org>
>>
>> Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
>>
>> Sasha, is this fix something you are taking through char-misc since the
>> commits that added it already propagated through the 6.18-rc?
>
>It looks like Greg already took this via char-misc-linus:
>
>https://git.kernel.org/gregkh/char-misc/c/98718e80af0bb1cd80f4bfe565dd60c57debad51
ahh, ok. I was checking rc2 and noticing this was not there yet.
thanks
Lucas De Marchi
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-10-23 17:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-20 23:17 [PATCH] mei: late_bind: Fix -Wincompatible-function-pointer-types-strict Nathan Chancellor
2025-10-23 14:27 ` Lucas De Marchi
2025-10-23 16:52 ` Nathan Chancellor
2025-10-23 16:59 ` Lucas De Marchi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®