Thread (12 messages) 12 messages, 4 authors, 2026-02-27
STALE124d

[RFC PATCH 4/7] drivers: android: binder: Replace `impl_has_work!` with `#[derive(HasField)]`

From: Boqun Feng <hidden>
Date: 2026-01-28 23:40:43
Also in: lkml, rcu
Subsystem: android drivers, the rest · Maintainers: Greg Kroah-Hartman, Arve Hjønnevåg, Todd Kjos, Christian Brauner, Carlos Llamas, Alice Ryhl, Linus Torvalds

`#[derive(HasField)]` offers less code and better ergonomic for defining
a struct with a Work in it. Hence replace the current usage of
`impl_has_work!()`.

Signed-off-by: Boqun Feng <redacted>
---
 drivers/android/binder/process.rs | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/android/binder/process.rs b/drivers/android/binder/process.rs
index 132055b4790f..2a2510e3a0cb 100644
--- a/drivers/android/binder/process.rs
+++ b/drivers/android/binder/process.rs
@@ -423,6 +423,7 @@ fn new() -> Self {
 /// Strictly speaking, there can be multiple of these per process. There is one for each binder fd
 /// that a process has opened, so processes using several binder contexts have several `Process`
 /// objects. This ensures that the contexts are fully separated.
+#[derive(HasField)]
 #[pin_data]
 pub(crate) struct Process {
     pub(crate) ctx: Arc<Context>,
@@ -451,6 +452,7 @@ pub(crate) struct Process {
 
     // Work node for deferred work item.
     #[pin]
+    #[field]
     defer_work: Work<Process>,
 
     // Links for process list in Context.
@@ -460,10 +462,6 @@ pub(crate) struct Process {
     pub(crate) stats: BinderStats,
 }
 
-kernel::impl_has_work! {
-    impl HasWork<Process> for Process { self.defer_work }
-}
-
 kernel::list::impl_list_arc_safe! {
     impl ListArcSafe<0> for Process { untracked; }
 }
-- 
2.50.1 (Apple Git-155)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help