[PATCH v2 0/2] rust: atomic: add `fetch_sub` and update docs

From: Andreas Hindborg

Date: Thu Feb 19 2026 - 07:21:39 EST


Add `fetch_sub` and improve documentation of `fetch_add`.

Signed-off-by: Andreas Hindborg <a.hindborg@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 (2):
rust: atomic: add fetch_sub
rust: atomic: update documentation for `fetch_add`

rust/kernel/sync/atomic.rs | 52 +++++++++++++++++++++++++++++++++----
rust/kernel/sync/atomic/internal.rs | 5 ++++
2 files changed, 52 insertions(+), 5 deletions(-)
---
base-commit: 63804fed149a6750ffd28610c5c1c98cce6bd377
change-id: 20260128-atomic-sub-2ff15962df12

Best regards,
--
Andreas Hindborg <a.hindborg@xxxxxxxxxx>