Re: [PATCH v7 5/9] rust: sync: atomic: Add atomic {cmp,}xchg operations

"Benno Lossin" <[email protected]> Mon, 14 Jul 2025 12:56:01 +0200
Newsgroups dev.linux.lists.lkmm,org.kernel.vger.linux-arch,org.kernel.vger.linux-kernel,org.kernel.vger.rust-for-linux
Message-ID <[email protected]>
On Mon Jul 14, 2025 at 7:36 AM CEST, Boqun Feng wrote:
> xchg() and cmpxchg() are basic operations on atomic. Provide these based
> on C APIs.
>
> Note that cmpxchg() use the similar function signature as
> compare_exchange() in Rust std: returning a `Result`, `Ok(old)` means
> the operation succeeds and `Err(old)` means the operation fails.
>
> Reviewed-by: Alice Ryhl <[email protected]>
> Signed-off-by: Boqun Feng <[email protected]>

Looks good except for the naming disputes :) So

Reviewed-by: Benno Lossin <[email protected]>

---
Cheers,
Benno

> ---
>  rust/kernel/sync/atomic/generic.rs | 181 ++++++++++++++++++++++++++++-
>  1 file changed, 180 insertions(+), 1 deletion(-)