Skip to contentSkip to conversation

rust: task: remove use of `addr_of!` macro

PATCH Benno Lossin 1 participant 1 message Mar 23, 2025 Rust

lore
Share & tools
lore

Benno Lossin

author Reviewed-by
#0 lore raw
Quoted 11 lines · Antonio Hickey

The use of addr_of! here is unnecessary since its immediately dereferenced. The main benefit of addr_of! is to avoid intermediate field loads without immediate dereferencing, so there's no benefit in using it here.

We can achieve the same behavior by directly accessing the group_leader and pid fields, which is more idiomatic.

---
Cheers,
Benno

Quoted 3 lines
---
 rust/kernel/task.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)