Skip to content

Commit 22679d8

Browse files
Herculoxzvireshk
authored andcommitted
rust: opp: use c_* types via kernel prelude
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>
1 parent e04c78d commit 22679d8

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

rust/kernel/opp.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -514,9 +514,9 @@ impl<T: ConfigOps + Default> Config<T> {
514514
dev: *mut bindings::device,
515515
opp_table: *mut bindings::opp_table,
516516
opp: *mut bindings::dev_pm_opp,
517-
_data: *mut kernel::ffi::c_void,
517+
_data: *mut c_void,
518518
scaling_down: bool,
519-
) -> kernel::ffi::c_int {
519+
) -> c_int {
520520
from_result(|| {
521521
// SAFETY: 'dev' is guaranteed by the C code to be valid.
522522
let dev = unsafe { Device::get_device(dev) };
@@ -540,8 +540,8 @@ impl<T: ConfigOps + Default> Config<T> {
540540
old_opp: *mut bindings::dev_pm_opp,
541541
new_opp: *mut bindings::dev_pm_opp,
542542
regulators: *mut *mut bindings::regulator,
543-
count: kernel::ffi::c_uint,
544-
) -> kernel::ffi::c_int {
543+
count: c_uint,
544+
) -> c_int {
545545
from_result(|| {
546546
// SAFETY: 'dev' is guaranteed by the C code to be valid.
547547
let dev = unsafe { Device::get_device(dev) };

0 commit comments

Comments
 (0)