@@ -132,7 +132,7 @@ unsafe fn raw_get(this: *const Self) -> *mut bindings::hrtimer {
// SAFETY: The field projection to `timer` does not go out of bounds,
// because the caller of this function promises that `this` points to an
// allocation of at least the size of `Self`.
- unsafe { Opaque::raw_get(core::ptr::addr_of!((*this).timer)) }
+ unsafe { Opaque::raw_get(&raw const (*this).timer) }
}
/// Cancel an initialized and potentially running timer.
@@ -494,7 +494,7 @@ unsafe fn raw_get_timer(
this: *const Self,
) -> *const $crate::time::hrtimer::HrTimer<$timer_type> {
// SAFETY: The caller promises that the pointer is not dangling.
- unsafe { ::core::ptr::addr_of!((*this).$field) }
+ unsafe { &raw const (*this).$field }
}
#[inline]
Replacing all occurrences of `addr_of!(place)` with `&raw const place`. This will allow us to reduce macro complexity, and improve consistency with existing reference syntax as `&raw const` is similar to `&` making it fit more naturally with other existing code. Suggested-by: Benno Lossin <benno.lossin@proton.me> Link: https://github.com/Rust-for-Linux/linux/issues/1148 Signed-off-by: Antonio Hickey <contact@antoniohickey.com> --- rust/kernel/time/hrtimer.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)