rust_binder: Update bitmaps to use kernel::impl_flags!
Get series with b4
b4 am [email protected] change-id 20260715-b4-rust_binder_impl_flags-e53b4ebca85dVersions newest first
- v3 Latest2 patches 0 repliesNew
- v22 patches 1 replySuperseded
- v13 patches 2 repliesSuperseded
Changes in v3 from the cover letter
- Rewrite commit messages to explain the motivation for the changes.
- Link to v2: https://lore.kernel.org/r/[email protected]
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | rust_binder: Update looper_flags bitmaps to use kernel::impl_flags!drivers/ | +37 | 0 replies | |
| 2/2 | rust_binder: Update transaction flags to use kernel::impl_flags!drivers/ drivers/ | +46 | 0 replies |
Reviews trailers per patch
All 2 patches have a Reviewed-by or Acked-by.
| Patch | Alice Ryhl |
|---|---|
| 1/2 | R-b |
| 2/2 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v3 0/2] rust_binder: Update bitmaps to use kernel::impl_flags!
In the current Rust Binder driver, internal state variables (thread looper states, deferred work, and transaction configurations) are represented as raw integers and manipulated using manual bitwise operations.
This approach lacks type safety. Because the compiler treats all integers identically, it is possible to pass a thread looper flag into a function expecting a transaction flag without triggering compile-time warnings. These cross-contamination errors compile cleanly but can cause runtime bugs or undefined behavior.
This patch series resolves this issue by migrating these raw integer bitmaps (defer_work, looper_flags, flags) to strongly-typed bitmasks using the kernel::impl_flags! macro. Functions now accept specific, distinct types rather than generic integers, preventing flags from being mixed up. This transition also replaces manual bitwise arithmetic with readable, safe methods.
Based on top of:
https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
---
Changes in v3:
- Rewrite commit messages to explain the motivation for the changes.
- Link to v2: https://lore.kernel.org/r/[email protected]
Changes in v2:
- Drop Patch 1 (defer_work) as it was merged into char-misc-testing.
- Rebase remaining two patches on latest char-misc-testing tree.
- Link to v1: https://lore.kernel.org/r/[email protected]
---
Jahnavi MN (2):
rust_binder: Update looper_flags bitmaps to use kernel::impl_flags!
rust_binder: Update transaction flags to use kernel::impl_flags!
drivers/android/binder/thread.rs | 68 ++++++++++++++++++++--------------- drivers/android/binder/transaction.rs | 58 ++++++++++++++++++++++-------- 2 files changed, 83 insertions(+), 43 deletions(-)
---
base-commit: 2cedf2272f1bb42471e646868ac572cc5752bd91
change-id: 20260715-b4-rust_binder_impl_flags-e53b4ebca85d
Best regards,
Signature · 1 line
Jahnavi MN <[email protected]>