mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 01:04:41 +01:00
drm/gpuvm: use const for drm_gpuva_op_* ptrs
These methods just read the values stored in the op pointers without modifying them, so it is appropriate to use const ptrs here. This allows us to avoid const -> mut pointer casts in Rust. Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Alice Ryhl <aliceryhl@google.com> Link: https://patch.msgid.link/20260108-gpuvm-rust-v2-3-dbd014005a0b@google.com Signed-off-by: Danilo Krummrich <dakr@kernel.org>
This commit is contained in:
parent
9bf4ca1e69
commit
adca0ad927
2 changed files with 7 additions and 7 deletions
|
|
@ -2268,7 +2268,7 @@ EXPORT_SYMBOL_GPL(drm_gpuvm_interval_empty);
|
|||
void
|
||||
drm_gpuva_map(struct drm_gpuvm *gpuvm,
|
||||
struct drm_gpuva *va,
|
||||
struct drm_gpuva_op_map *op)
|
||||
const struct drm_gpuva_op_map *op)
|
||||
{
|
||||
drm_gpuva_init_from_op(va, op);
|
||||
drm_gpuva_insert(gpuvm, va);
|
||||
|
|
@ -2288,7 +2288,7 @@ EXPORT_SYMBOL_GPL(drm_gpuva_map);
|
|||
void
|
||||
drm_gpuva_remap(struct drm_gpuva *prev,
|
||||
struct drm_gpuva *next,
|
||||
struct drm_gpuva_op_remap *op)
|
||||
const struct drm_gpuva_op_remap *op)
|
||||
{
|
||||
struct drm_gpuva *va = op->unmap->va;
|
||||
struct drm_gpuvm *gpuvm = va->vm;
|
||||
|
|
@ -2315,7 +2315,7 @@ EXPORT_SYMBOL_GPL(drm_gpuva_remap);
|
|||
* Removes the &drm_gpuva associated with the &drm_gpuva_op_unmap.
|
||||
*/
|
||||
void
|
||||
drm_gpuva_unmap(struct drm_gpuva_op_unmap *op)
|
||||
drm_gpuva_unmap(const struct drm_gpuva_op_unmap *op)
|
||||
{
|
||||
drm_gpuva_remove(op->va);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1121,7 +1121,7 @@ void drm_gpuva_ops_free(struct drm_gpuvm *gpuvm,
|
|||
struct drm_gpuva_ops *ops);
|
||||
|
||||
static inline void drm_gpuva_init_from_op(struct drm_gpuva *va,
|
||||
struct drm_gpuva_op_map *op)
|
||||
const struct drm_gpuva_op_map *op)
|
||||
{
|
||||
va->va.addr = op->va.addr;
|
||||
va->va.range = op->va.range;
|
||||
|
|
@ -1265,13 +1265,13 @@ int drm_gpuvm_sm_unmap_exec_lock(struct drm_gpuvm *gpuvm, struct drm_exec *exec,
|
|||
|
||||
void drm_gpuva_map(struct drm_gpuvm *gpuvm,
|
||||
struct drm_gpuva *va,
|
||||
struct drm_gpuva_op_map *op);
|
||||
const struct drm_gpuva_op_map *op);
|
||||
|
||||
void drm_gpuva_remap(struct drm_gpuva *prev,
|
||||
struct drm_gpuva *next,
|
||||
struct drm_gpuva_op_remap *op);
|
||||
const struct drm_gpuva_op_remap *op);
|
||||
|
||||
void drm_gpuva_unmap(struct drm_gpuva_op_unmap *op);
|
||||
void drm_gpuva_unmap(const struct drm_gpuva_op_unmap *op);
|
||||
|
||||
/**
|
||||
* drm_gpuva_op_remap_to_unmap_range() - Helper to get the start and range of
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue