Thread (2 messages) 2 messages, 2 authors, 21d ago

Re: [PATCH v7] rust: aref: make `AlwaysRefCounted::inc_ref` an associated function

From: Viresh Kumar <viresh.kumar@linaro.org>
Date: 2026-06-29 04:39:38
Also in: dri-devel, driver-core, linux-block, linux-fsdevel, linux-mm, linux-pci, linux-pm, linux-pwm, lkml, rust-for-linux

On 28-06-26, 18:07, Trevor Chan wrote:
quoted hunk ↗ jump to hunk
diff --git a/rust/kernel/opp.rs b/rust/kernel/opp.rs
index 62e44676125d..84802f22b652 100644
--- a/rust/kernel/opp.rs
+++ b/rust/kernel/opp.rs
@@ -1043,9 +1043,9 @@ unsafe impl Sync for OPP {}
 /// SAFETY: The type invariants guarantee that [`OPP`] is always refcounted.
 unsafe impl AlwaysRefCounted for OPP {
     #[inline]
-    fn inc_ref(&self) {
+    fn inc_ref(obj: &Self) {
         // SAFETY: The existence of a shared reference means that the refcount is nonzero.
-        unsafe { bindings::dev_pm_opp_get(self.0.get()) };
+        unsafe { bindings::dev_pm_opp_get(obj.0.get()) };
     }
 
     #[inline]
For OPP:

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

-- 
viresh
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help