* Re: [PATCH] rust: drm: gpuvm: rename UniqueRefGpuVm data accessors
2026-11-19 16:36 [PATCH] rust: drm: gpuvm: rename UniqueRefGpuVm data accessors Alice Ryhl
@ 2026-11-19 16:39 ` Danilo Krummrich
2026-11-19 16:56 ` Gary Guo
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Danilo Krummrich @ 2026-11-19 16:39 UTC (permalink / raw)
To: Alice Ryhl
Cc: Matthew Brost, Thomas Hellström, Miguel Ojeda, Boqun Feng,
Gary Guo, Björn Roy Baron, Benno Lossin, Andreas Hindborg,
Trevor Gross, Daniel Almeida, Tamir Duberstein,
Alexandre Courbot, Onur Özkan, Sami Tolvanen, dri-devel,
rust-for-linux, linux-kernel
On 11/19/26 5:36 PM, Alice Ryhl wrote:
> `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>
Acked-by: Danilo Krummrich <dakr@kernel.org>
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] rust: drm: gpuvm: rename UniqueRefGpuVm data accessors
2026-11-19 16:36 [PATCH] rust: drm: gpuvm: rename UniqueRefGpuVm data accessors Alice Ryhl
2026-11-19 16:39 ` Danilo Krummrich
@ 2026-11-19 16:56 ` Gary Guo
2026-11-19 23:20 ` Gary Guo
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Gary Guo @ 2026-11-19 16:56 UTC (permalink / raw)
To: Alice Ryhl, Danilo Krummrich, Matthew Brost,
Thomas Hellström, Miguel Ojeda, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg,
Trevor Gross, Daniel Almeida, Tamir Duberstein,
Alexandre Courbot, Onur Özkan
Cc: Sami Tolvanen, dri-devel, rust-for-linux, linux-kernel
On Thu Nov 19, 2026 at 4:36 PM GMT, Alice Ryhl wrote:
> `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,
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] rust: drm: gpuvm: rename UniqueRefGpuVm data accessors
2026-11-19 16:36 [PATCH] rust: drm: gpuvm: rename UniqueRefGpuVm data accessors Alice Ryhl
2026-11-19 16:39 ` Danilo Krummrich
2026-11-19 16:56 ` Gary Guo
@ 2026-11-19 23:20 ` Gary Guo
2026-11-20 1:25 ` Daniel Almeida
2026-11-21 14:12 ` Alice Ryhl
4 siblings, 0 replies; 6+ messages in thread
From: Gary Guo @ 2026-11-19 23:20 UTC (permalink / raw)
To: Alice Ryhl, Danilo Krummrich, Matthew Brost,
Thomas Hellström, Miguel Ojeda, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg,
Trevor Gross, Daniel Almeida, Tamir Duberstein,
Alexandre Courbot, Onur Özkan
Cc: Sami Tolvanen, dri-devel, rust-for-linux, linux-kernel
On Thu Nov 19, 2026 at 4:36 PM GMT, Alice Ryhl wrote:
> `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>
Reviewed-by: Gary Guo <gary@garyguo.net>
> ---
> rust/kernel/drm/gpuvm/mod.rs | 4 ++--
> rust/kernel/drm/gpuvm/sm_ops.rs | 6 +++---
> 2 files changed, 5 insertions(+), 5 deletions(-)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] rust: drm: gpuvm: rename UniqueRefGpuVm data accessors
2026-11-19 16:36 [PATCH] rust: drm: gpuvm: rename UniqueRefGpuVm data accessors Alice Ryhl
` (2 preceding siblings ...)
2026-11-19 23:20 ` Gary Guo
@ 2026-11-20 1:25 ` Daniel Almeida
2026-11-21 14:12 ` Alice Ryhl
4 siblings, 0 replies; 6+ messages in thread
From: Daniel Almeida @ 2026-11-20 1:25 UTC (permalink / raw)
To: Alice Ryhl
Cc: Danilo Krummrich, Matthew Brost, Thomas Hellström,
Miguel Ojeda, Boqun Feng, Gary Guo, Björn Roy Baron,
Benno Lossin, Andreas Hindborg, Trevor Gross, Tamir Duberstein,
Alexandre Courbot, Onur Özkan, Sami Tolvanen, dri-devel,
rust-for-linux, linux-kernel
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] rust: drm: gpuvm: rename UniqueRefGpuVm data accessors
2026-11-19 16:36 [PATCH] rust: drm: gpuvm: rename UniqueRefGpuVm data accessors Alice Ryhl
` (3 preceding siblings ...)
2026-11-20 1:25 ` Daniel Almeida
@ 2026-11-21 14:12 ` Alice Ryhl
4 siblings, 0 replies; 6+ messages in thread
From: Alice Ryhl @ 2026-11-21 14:12 UTC (permalink / raw)
To: Danilo Krummrich
Cc: Alice Ryhl, Matthew Brost, Thomas Hellström, Miguel Ojeda,
Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Trevor Gross, Daniel Almeida, Tamir Duberstein,
Alexandre Courbot, Onur Özkan, Sami Tolvanen, dri-devel,
rust-for-linux, linux-kernel
On Thu, Nov 19, 2026 at 04:36:54PM +0000, Alice Ryhl wrote:
> `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>
Applied to drm-rust-next. Thanks!
^ permalink raw reply [flat|nested] 6+ messages in thread