From: Alice Ryhl <aliceryhl@google.com>
To: "Danilo Krummrich" <dakr@kernel.org>,
"Matthew Brost" <matthew.brost@intel.com>,
"Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
"Miguel Ojeda" <ojeda@kernel.org>,
"Boqun Feng" <boqun@kernel.org>, "Gary Guo" <gary@garyguo.net>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <lossin@kernel.org>,
"Andreas Hindborg" <a.hindborg@kernel.org>,
"Trevor Gross" <tmgross@umich.edu>,
"Daniel Almeida" <daniel.almeida@collabora.com>,
"Tamir Duberstein" <tamird@kernel.org>,
"Alexandre Courbot" <acourbot@nvidia.com>,
"Onur Özkan" <work@onurozkan.dev>
Cc: Sami Tolvanen <samitolvanen@google.com>,
dri-devel@lists.freedesktop.org, rust-for-linux@vger.kernel.org,
linux-kernel@vger.kernel.org, Alice Ryhl <aliceryhl@google.com>
Subject: [PATCH] rust: drm: gpuvm: rename UniqueRefGpuVm data accessors
Date: Thu, 19 Nov 2026 16:36:54 +0000 [thread overview]
Message-ID: <20261119-gpuvm-data-rename-v1-1-8eb773435fde@google.com> (raw)
`UniqueRefGpuVm` currently names its shared and mutable data accessors
`data_ref()` and `data()`, unlike `GpuVmBo::data(&self)` and standard
Rust naming conventions. Thus, rename them to `data(&self)` and
`data_mut(&mut self)` for consistency.
Link: https://lore.kernel.org/r/20261118111653.448550-1-aliceryhl@google.com
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
rust/kernel/drm/gpuvm/mod.rs | 4 ++--
rust/kernel/drm/gpuvm/sm_ops.rs | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/rust/kernel/drm/gpuvm/mod.rs b/rust/kernel/drm/gpuvm/mod.rs
index d9d43d719761..23e73da865fb 100644
--- a/rust/kernel/drm/gpuvm/mod.rs
+++ b/rust/kernel/drm/gpuvm/mod.rs
@@ -311,14 +311,14 @@ fn sm_step_remap<'op, 'ctx>(
impl<T: DriverGpuVm> UniqueRefGpuVm<T> {
/// Access the data owned by this `UniqueRefGpuVm` immutably.
#[inline]
- pub fn data_ref(&self) -> &T {
+ pub fn data(&self) -> &T {
// SAFETY: By the type invariants we may access `data`.
unsafe { &*self.0.data.get() }
}
/// Access the data owned by this `UniqueRefGpuVm` mutably.
#[inline]
- pub fn data(&mut self) -> &mut T {
+ pub fn data_mut(&mut self) -> &mut T {
// SAFETY: By the type invariants we may access `data`.
unsafe { &mut *self.0.data.get() }
}
diff --git a/rust/kernel/drm/gpuvm/sm_ops.rs b/rust/kernel/drm/gpuvm/sm_ops.rs
index 742c151b2540..9f3fe7c954fb 100644
--- a/rust/kernel/drm/gpuvm/sm_ops.rs
+++ b/rust/kernel/drm/gpuvm/sm_ops.rs
@@ -381,7 +381,7 @@ impl<T: DriverGpuVm> GpuVm<T> {
match p
.sm_data
.gpuvm
- .data()
+ .data_mut()
.sm_step_map(op, p.sm_data.user_context)
{
Ok(OpMapped { .. }) => 0,
@@ -402,7 +402,7 @@ impl<T: DriverGpuVm> GpuVm<T> {
op: unsafe { &(*op).__bindgen_anon_1.unmap },
_invariant: PhantomData,
};
- match p.gpuvm.data().sm_step_unmap(op, p.user_context) {
+ match p.gpuvm.data_mut().sm_step_unmap(op, p.user_context) {
Ok(OpUnmapped { .. }) => 0,
Err(err) => err.to_errno(),
}
@@ -421,7 +421,7 @@ impl<T: DriverGpuVm> GpuVm<T> {
op: unsafe { &(*op).__bindgen_anon_1.remap },
_invariant: PhantomData,
};
- match p.gpuvm.data().sm_step_remap(op, p.user_context) {
+ match p.gpuvm.data_mut().sm_step_remap(op, p.user_context) {
Ok(OpRemapped { .. }) => 0,
Err(err) => err.to_errno(),
}
---
base-commit: e55a991e09e3b44f0b0d8206bb523dc57c086341
change-id: 20261119-gpuvm-data-rename-cf6e0e59f266
Best regards,
--
Alice Ryhl <aliceryhl@google.com>
next reply other threads:[~2026-11-19 16:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 16:36 Alice Ryhl [this message]
2026-11-19 16:39 ` Danilo Krummrich
2026-11-19 16:56 ` Gary Guo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261119-gpuvm-data-rename-v1-1-8eb773435fde@google.com \
--to=aliceryhl@google.com \
--cc=a.hindborg@kernel.org \
--cc=acourbot@nvidia.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun@kernel.org \
--cc=dakr@kernel.org \
--cc=daniel.almeida@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gary@garyguo.net \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=matthew.brost@intel.com \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=samitolvanen@google.com \
--cc=tamird@kernel.org \
--cc=thomas.hellstrom@linux.intel.com \
--cc=tmgross@umich.edu \
--cc=work@onurozkan.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®