]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
rust: opp: use c_* types via kernel prelude
authorAbhinav Ananthu <abhinav.ogl@gmail.com>
Fri, 20 Jun 2025 09:59:21 +0000 (15:29 +0530)
committerViresh Kumar <viresh.kumar@linaro.org>
Mon, 23 Jun 2025 04:22:45 +0000 (09:52 +0530)
Update OPP FFI callback signatures to use `c_int` from the `kernel::prelude`,
instead of accessing it via `kernel::ffi::c_int`.

Although these types are defined in a crate named `ffi`, they are re-exported
via the `kernel::prelude` and should be used from there. This aligns with the
Rust-for-Linux coding guidelines and ensures ABI correctness when interfacing
with C code.

Suggested-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Abhinav Ananthu <abhinav.ogl@gmail.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
rust/kernel/opp.rs

index a566fc3e7dcb87237c68eb7d174efa5658712ddb..846583da9a2fbfd3cfd1c30274be631349c5ba61 100644 (file)
@@ -514,9 +514,9 @@ impl<T: ConfigOps + Default> Config<T> {
         dev: *mut bindings::device,
         opp_table: *mut bindings::opp_table,
         opp: *mut bindings::dev_pm_opp,
-        _data: *mut kernel::ffi::c_void,
+        _data: *mut c_void,
         scaling_down: bool,
-    ) -> kernel::ffi::c_int {
+    ) -> c_int {
         from_result(|| {
             // SAFETY: 'dev' is guaranteed by the C code to be valid.
             let dev = unsafe { Device::get_device(dev) };
@@ -540,8 +540,8 @@ impl<T: ConfigOps + Default> Config<T> {
         old_opp: *mut bindings::dev_pm_opp,
         new_opp: *mut bindings::dev_pm_opp,
         regulators: *mut *mut bindings::regulator,
-        count: kernel::ffi::c_uint,
-    ) -> kernel::ffi::c_int {
+        count: c_uint,
+    ) -> c_int {
         from_result(|| {
             // SAFETY: 'dev' is guaranteed by the C code to be valid.
             let dev = unsafe { Device::get_device(dev) };