Re: [PATCH 1/2] rust: sync: atomic: Remove bound `T: Sync` for `Atomci::from_ptr()`

From: Gary Guo

Date: Tue Jan 20 2026 - 08:09:54 EST


On Tue Jan 20, 2026 at 11:52 AM GMT, Boqun Feng wrote:
> Originally, `Atomic::from_ptr()` requires `T` being a `Sync` because I
> thought having the ability to do `from_ptr()` meant multiplle
> `&Atomic<T>`s shared by different threads, which was identical (or
> similar) to multiple `&T`s shared by different threads. Hence `T` was
> required to be `Sync`. However this is not true, since `&Atomic<T>` is
> not the same at `&T`. Moreover, having this bound makes `Atomic::<*mut
> T>::from_ptr()` impossible, which is definitely not intended. Therefore
> remove the `T: Sync` bound.
>
> Fixes: 29c32c405e53 ("rust: sync: atomic: Add generic atomics")
> Signed-off-by: Boqun Feng <boqun.feng@xxxxxxxxx>

Title has "Atomci" instead of "Atomic"

Reviewed-by: Gary Guo <gary@xxxxxxxxxxx>

> ---
> rust/kernel/sync/atomic.rs | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)