Skip to content

Commit 2a57124

Browse files
antonio-hickeyojeda
authored andcommitted
rust: block: refactor to use &raw mut
Replace all occurrences (one) of `addr_of_mut!(place)` with `&raw mut place`. This will allow us to reduce macro complexity, and improve consistency with existing reference syntax as `&raw mut` is similar to `&mut` making it fit more naturally with other existing code. Suggested-by: Benno Lossin <[email protected]> Link: #1148 Signed-off-by: Antonio Hickey <[email protected]> Acked-by: Andreas Hindborg <[email protected]> Reviewed-by: Benno Lossin <[email protected]> Reviewed-by: Boqun Feng <[email protected]> Link: https://lore.kernel.org/r/[email protected] [ Reworded slightly. - Miguel ] Signed-off-by: Miguel Ojeda <[email protected]>
1 parent e1dfaa3 commit 2a57124

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rust/kernel/block/mq/request.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use crate::{
1212
};
1313
use core::{
1414
marker::PhantomData,
15-
ptr::{addr_of_mut, NonNull},
15+
ptr::NonNull,
1616
sync::atomic::{AtomicU64, Ordering},
1717
};
1818

@@ -187,7 +187,7 @@ impl RequestDataWrapper {
187187
pub(crate) unsafe fn refcount_ptr(this: *mut Self) -> *mut AtomicU64 {
188188
// SAFETY: Because of the safety requirements of this function, the
189189
// field projection is safe.
190-
unsafe { addr_of_mut!((*this).refcount) }
190+
unsafe { &raw mut (*this).refcount }
191191
}
192192
}
193193

0 commit comments

Comments
 (0)