[PATCH v3 0/3] rust: atomic: add `fetch_sub` and update docs
From: Andreas Hindborg
Date: Fri Feb 20 2026 - 03:06:51 EST
Add `fetch_sub` and improve documentation and safety comments of of
`fetch_add`.
Signed-off-by: Andreas Hindborg <a.hindborg@xxxxxxxxxx>
---
Changes in v3:
- Remove a spurious line feed.
- Add a patch to update a safety comment for `fetch_add`.
- Update safety comment in `fetch_sub` implementation.
- Link to v2: https://msgid.link/20260219-atomic-sub-v2-0-8bd99cadf26d@xxxxxxxxxx
Changes in v2:
- Update example to be more clear.
- Add a patch that updates documentation for `fetch_add`.
- Link to v1: https://lore.kernel.org/r/20260128-atomic-sub-v1-1-f8c6abcbb067@xxxxxxxxxx
---
Andreas Hindborg (3):
rust: atomic: add fetch_sub
rust: atomic: update documentation for `fetch_add`
rust: atomic: update a safety comment in impl of `fetch_add`
rust/kernel/sync/atomic.rs | 53 ++++++++++++++++++++++++++++++++-----
rust/kernel/sync/atomic/internal.rs | 7 ++++-
2 files changed, 53 insertions(+), 7 deletions(-)
---
base-commit: 63804fed149a6750ffd28610c5c1c98cce6bd377
change-id: 20260128-atomic-sub-2ff15962df12
Best regards,
--
Andreas Hindborg <a.hindborg@xxxxxxxxxx>