rust: drm: gpuvm: rename UniqueRefGpuVm data accessors
Subsystems (4)
Alice Ryhl
maintainerPATCH 1/1 rust: drm: gpuvm: rename UniqueRefGpuVm data accessors
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.
--- rust/kernel/drm/gpuvm/mod.rs | 4 ++-- rust/kernel/drm/gpuvm/sm_ops.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-)
rust/kernel/drm/gpuvm/mod.rs +2 -2
@@ -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 () } }
rust/kernel/drm/gpuvm/sm_ops.rs +3 -3
@@ -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,
Signature · 1 line
Alice Ryhl <[email protected]>
Quoted 7 lines · Alice Ryhl
UniqueRefGpuVmcurrently names its shared and mutable data accessorsdata_ref()anddata(), unlikeGpuVmBo::data(&self)and standard Rust naming conventions. Thus, rename them todata(&self)anddata_mut(&mut self)for consistency.
Gary Guo
reviewerQuoted 70 lines · Alice Ryhl
UniqueRefGpuVmcurrently names its shared and mutable data accessorsdata_ref()anddata(), unlikeGpuVmBo::data(&self)and standard Rust naming conventions. Thus, rename them todata(&self)anddata_mut(&mut self)for consistency.Signed-off-by Alice Ryhl <[email protected]>--- rust/kernel/drm/gpuvm/mod.rs | 4 ++-- rust/kernel/drm/gpuvm/sm_ops.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-)rust/kernel/drm/gpuvm/mod.rs +2
-2@@ -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 () } }rust/kernel/drm/gpuvm/sm_ops.rs +3
-4@@ -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-cf6e0e59f266Best regards,
Quoted 7 lines · Alice Ryhl
UniqueRefGpuVmcurrently names its shared and mutable data accessorsdata_ref()anddata(), unlikeGpuVmBo::data(&self)and standard Rust naming conventions. Thus, rename them todata(&self)anddata_mut(&mut self)for consistency.
Quoted 4 lines
--- rust/kernel/drm/gpuvm/mod.rs | 4 ++-- rust/kernel/drm/gpuvm/sm_ops.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-)
Quoted 7 lines · Alice Ryhl
UniqueRefGpuVmcurrently names its shared and mutable data accessorsdata_ref()anddata(), unlikeGpuVmBo::data(&self)and standard Rust naming conventions. Thus, rename them todata(&self)anddata_mut(&mut self)for consistency.
Applied to drm-rust-next. Thanks!