rust: cpufreq: Ensure C ABI compatibility in all unsafe
authorAbhinav Ananthu <abhinav.ogl@gmail.com>
Fri, 13 Jun 2025 10:18:16 +0000 (15:48 +0530)
committerViresh Kumar <viresh.kumar@linaro.org>
Thu, 19 Jun 2025 07:55:46 +0000 (13:25 +0530)
commit10bb7f09e346f152d2627e0b3619c402d64a50e9
tree44011611420567b567aaa358d161552f8ad76563
parent43ab245a9ec3837a0ca75c3ed9ba887d8e8b022e
rust: cpufreq: Ensure C ABI compatibility in all unsafe

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@kernel.org>
Link: https://github.com/Rust-for-Linux/linux/issues/1170
Signed-off-by: Abhinav Ananthu <abhinav.ogl@gmail.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
rust/kernel/cpufreq.rs