mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: [PATCH v5 04/17] rust: task: remove use of `addr_of!` macro
@ 2025-03-23 10:32 Benno Lossin
  0 siblings, 0 replies; 3+ messages in thread
From: Benno Lossin @ 2025-03-23 10:32 UTC (permalink / raw)
  To: Antonio Hickey, Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
	Björn Roy Baron, Andreas Hindborg, Alice Ryhl, Trevor Gross,
	Danilo Krummrich
  Cc: rust-for-linux, linux-kernel

On Thu Mar 20, 2025 at 3:07 AM CET, Antonio Hickey wrote:
> 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.
>
> 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>

Reviewed-by: Benno Lossin <benno.lossin@proton.me>

---
Cheers,
Benno

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


^ permalink raw reply	[flat|nested] 3+ messages in thread
[parent not found: <20250320020740.1631171-1-contact@antoniohickey.com>]

end of thread, other threads:[~2025-03-23 19:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-23 10:32 [PATCH v5 04/17] rust: task: remove use of `addr_of!` macro Benno Lossin
     [not found] <20250320020740.1631171-1-contact@antoniohickey.com>
2025-03-20  2:07 ` Antonio Hickey
2025-03-23 19:23   ` Miguel Ojeda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®