Re: [PATCH v7] rust: aref: make `AlwaysRefCounted::inc_ref` an associated function
Viresh Kumar <[email protected]>
| Newsgroups | org.kernel.vger.linux-pwm,dev.linux.lists.driver-core,org.freedesktop.lists.dri-devel,org.kernel.vger.linux-block,org.kernel.vger.linux-fsdevel,org.kernel.vger.linux-kernel,org.kernel.vger.linux-pci,org.kernel.vger.linux-pm,org.kernel.vger.linux-security-module,org.kernel.vger.rust-for-linux,org.kvack.linux-mm |
|---|---|
| Message-ID | <xak7wil2w2wdnmkfh4e4ijhlgnudzuh5y3ltlo72454e52tocv@434kdjz2eupv> |
On 28-06-26, 18:07, Trevor Chan wrote:
> 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 <[email protected]>
--
viresh