[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <m2jyzo26y1.fsf@posteo.net>
Date: Mon, 17 Nov 2025 12:13:15 +0000
From: Charalampos Mitrodimas <charmitro@...teo.net>
To: Onur Özkan <work@...rozkan.dev>
Cc: rust-for-linux@...r.kernel.org, ojeda@...nel.org,
alex.gaynor@...il.com, boqun.feng@...il.com, gary@...yguo.net,
bjorn3_gh@...tonmail.com, lossin@...nel.org, a.hindborg@...nel.org,
aliceryhl@...gle.com, tmgross@...ch.edu, dakr@...nel.org,
yutaro.ono.418@...il.com, borys.tyran@...tonmail.com,
daniel@...lak.dev, tamird@...il.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1] rbtree: reduce unsafe blocks on pointer derefs
Onur Özkan <work@...rozkan.dev> writes:
> Refactors parts of the get() and cursor_lower_bound()
> traversal logic to minimize the scope of unsafe blocks
> and avoid duplicating same safety comments.
>
> One of the removed comments was also misleading:
>
> // SAFETY: `node` is a non-null node...
> Ordering::Equal => return Some(unsafe { &(*this).value }),
>
> as `node` should have been `this`.
>
> No functional changes intended; this is purely a safety
> improvement that reduces the amount of unsafe blocks
> while keeping all invariants intact.
>
> Signed-off-by: Onur Özkan <work@...rozkan.dev>
> ---
> rust/kernel/rbtree.rs | 27 +++++++++++++++------------
> 1 file changed, 15 insertions(+), 12 deletions(-)
>
This is a nice change to have if it reaches the general consensus.
Acked-By: Charalampos Mitrodimas <charmitro@...teo.net>
--
C. Mitrodimas
Powered by blists - more mailing lists