diff --git a/rust/bindgen_parameters b/rust/bindgen_parameters index 5059cc74cb3c..6003d5127676 100644 --- a/rust/bindgen_parameters +++ b/rust/bindgen_parameters @@ -27,6 +27,8 @@ --opaque-type spinlock # enums that appear in indirect function calls should specify a cfi type +--newtype-enum hrtimer_restart +--with-attribute-custom-enum=hrtimer_restart='#[cfi_encoding="15hrtimer_restart"]' --newtype-enum irqreturn --with-attribute-custom-enum=irqreturn='#[cfi_encoding="9irqreturn"]' --newtype-enum lru_status diff --git a/rust/kernel/time/hrtimer.rs b/rust/kernel/time/hrtimer.rs index 2d7f1131a813..07344ed5fbd5 100644 --- a/rust/kernel/time/hrtimer.rs +++ b/rust/kernel/time/hrtimer.rs @@ -834,14 +834,14 @@ unsafe fn start(this: *const Self, expires: ::Ex #[repr(u32)] pub enum HrTimerRestart { /// Timer should not be restarted. - NoRestart = bindings::hrtimer_restart_HRTIMER_NORESTART, + NoRestart = bindings::hrtimer_restart::HRTIMER_NORESTART.0, /// Timer should be restarted. - Restart = bindings::hrtimer_restart_HRTIMER_RESTART, + Restart = bindings::hrtimer_restart::HRTIMER_RESTART.0, } impl HrTimerRestart { fn into_c(self) -> bindings::hrtimer_restart { - self as bindings::hrtimer_restart + bindings::hrtimer_restart(self as c_uint) } }