You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use &raw [mut] place instead of addr_of[_mut]!(place) #1148
Since Rust 1.82.0, the raw_ref_op feature is stable. This means that in order to get a raw pointer to a place, one can write &raw place instead of having to use addr_of!(place).
A patch series addressing this issue should:
rewrite any usage of the addr_of[_mut]! macros to use the raw ref operators instead.
enable the raw_ref_op feature. The reason for this is that the kernel currently has a minimum Rust version of 1.78.0. So older compilers will need to have it enabled. Since it already is stable in a newer version this is OK.
add these macros to the disallowed-macros list in .clippy.toml to prevent further introductions of that macro.
This requires submitting a proper patch to the LKML and the Rust for Linux mailing list. Please recall to test your changes (including generating the documentation if changed, running the Rust doctests if changed, etc.), to use a proper title for the commit, to sign your commit under the Developer's Certificate of Origin and to add a Suggested-by: tag and a Link: tag to this issue. Please see https://docs.kernel.org/process/submitting-patches.html and https://rust-for-linux.com/contributing for details.
Please take this issue only if you are new to the kernel development process and you would like to use it as a test to submit your first patch to the kernel. Please do not take it if you do not plan to make other contributions to the kernel.
Hi @antonio-hickey,
I noticed that this issue is still open and that some addr_of! / addr_of_mut! usages remain in the current mainline.
It looks like the Rust KUnit changes mentioned in the earlier review have since landed.
I'm interested in helping finish the remaining conversions. Are you still working on this series, or would it be okay for me to pick up the remaining work?
Thanks!
Activity
antonio-hickey commentedon Mar 12, 2025
I'd like to take this one one on
antonio-hickey commentedon Mar 13, 2025
Sent patches: https://lore.kernel.org/all/010001958dfeacb5-9039aaab-6114-494a-9f1d-f13982091169-000000@email.amazonses.com/T/#t
rust: enable `raw_ref_op` feature
rust: clippy: disable `addr_of!` and `addr_of_mut` macros
rust: replace `addr_of[_mut]!` with `&raw [mut]`
rust: enable `raw_ref_op` feature
rust: block: refactor to use `&raw mut`
refactor to use `&raw mut`
refactor to use `&raw mut`
refactor to use `&raw mut`
refactor to use `&raw mut`
3 remaining items
refactor to use `&raw mut`
refactor to use `&raw mut`
refactor to use `&raw mut`
refactor to use `&raw mut`
refactor to use `&raw mut`
refactor to use `&raw mut`
replace `addr_of_mut!` with `&raw mut`
rust: pin-init: replace `addr_of_mut!` with `&raw mut`
rust: pin-init: replace `addr_of_mut!` with `&raw mut`
rust: pin-init: replace `addr_of_mut!` with `&raw mut`
rust: pin-init: replace `addr_of_mut!` with `&raw mut`
rust: pin-init: replace `addr_of_mut!` with `&raw mut`
replace `addr_of_mut!` with `&raw mut`
rust: pin-init: replace `addr_of_mut!` with `&raw mut`
asdfkwang commentedon Oct 13, 2026
Hi @antonio-hickey,
I noticed that this issue is still open and that some addr_of! / addr_of_mut! usages remain in the current mainline.
It looks like the Rust KUnit changes mentioned in the earlier review have since landed.
I'm interested in helping finish the remaining conversions. Are you still working on this series, or would it be okay for me to pick up the remaining work?
Thanks!