Skip to content

Commit 5b2d595

Browse files
fujitaojeda
authored andcommitted
rust: time: Fix compile error in impl_has_hr_timer macro
Fix a compile error in the `impl_has_hr_timer!` macro as follows: error[E0599]: no method named cast_mut found for raw pointer *mut Foo in the current scope The `container_of!` macro already returns a mutable pointer when used in a `*mut T` context so the `.cast_mut()` method is not available. [ We missed this one because there is no caller yet and it is a macro. - Miguel ] Fixes: 74d6a60 ("rust: retain pointer mut-ness in `container_of!`") Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com> Reviewed-by: Benno Lossin <lossin@kernel.org> Acked-by: Andreas Hindborg <a.hindborg@kernel.org> Link: https://lore.kernel.org/r/20250606020505.3186533-1-fujita.tomonori@gmail.com Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
1 parent 19272b3 commit 5b2d595

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rust/kernel/time/hrtimer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ macro_rules! impl_has_hr_timer {
517517
) -> *mut Self {
518518
// SAFETY: As per the safety requirement of this function, `ptr`
519519
// is pointing inside a `$timer_type`.
520-
unsafe { ::kernel::container_of!(ptr, $timer_type, $field).cast_mut() }
520+
unsafe { ::kernel::container_of!(ptr, $timer_type, $field) }
521521
}
522522
}
523523
}

0 commit comments

Comments
 (0)