Re: [PATCH v3] rust: cpufreq: Ensure C ABI compatibility in all unsafe
From: Viresh Kumar
Date: Thu Jun 19 2025 - 04:17:07 EST
On 13-06-25, 15:48, Abhinav Ananthu wrote:
> Update all `unsafe extern "C"` callback functions in the cpufreq module to
> use `kernel::ffi` types (`c_int`, `c_uint`, etc.) instead of Rust-native
> types like `i32`, `u32`, or `usize`.
>
> This change ensures that all Rust callbacks have signatures that are
> ABI-compatible with their corresponding C counterparts, which is critical
> for FFI correctness and safety.
>
> Suggested-by: Miguel Ojeda <ojeda@xxxxxxxxxx>
> Link: https://github.com/Rust-for-Linux/linux/issues/1170
> Signed-off-by: Abhinav Ananthu <abhinav.ogl@xxxxxxxxx>
> ---
> rust/kernel/cpufreq.rs | 26 +++++++++++++-------------
> 1 file changed, 13 insertions(+), 13 deletions(-)
Applied. Thanks.
There are few users of kernel::ffi::* in cpufreq.rs and opp.rs, if you want to
convert them as well.
--
viresh