summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/vgpu/gp10b
diff options
context:
space:
mode:
authorKonsta Holtta <kholtta@nvidia.com>2018-01-22 05:19:08 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2018-03-01 15:24:06 -0500
commitba8fa334f40223ad491ab61a6c072a276017787f (patch)
treeeb06807ed4fdee3a708f66949c6daf82f193a531 /drivers/gpu/nvgpu/vgpu/gp10b
parent5a35a95654d561fce09a3b9abf6b82bb7a29d74b (diff)
gpu: nvgpu: introduce explicit nvgpu_sgl type
The operations in struct nvgpu_sgt_ops have a scatter-gather list (sgl) argument which is a void pointer. Change the type signatures to take struct nvgpu_sgl * which is an opaque marker type that makes it more difficult to pass around wrong arguments, as anything goes for void *. Explicit types add also self-documentation to the code. For some added safety, some explicit type casts are now required in implementors of the nvgpu_sgt_ops interface when converting between the general nvgpu_sgl type and implementation-specific types. This is not purely a bad thing because the casts explain clearly where type conversions are happening. Jira NVGPU-30 Jira NVGPU-52 Jira NVGPU-305 Change-Id: Ic64eed6d2d39ca5786e62b172ddb7133af16817a Signed-off-by: Konsta Holtta <kholtta@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1643555 GVS: Gerrit_Virtual_Submit Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/vgpu/gp10b')
-rw-r--r--drivers/gpu/nvgpu/vgpu/gp10b/vgpu_mm_gp10b.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_mm_gp10b.c b/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_mm_gp10b.c
index cf9a28c7..ca517975 100644
--- a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_mm_gp10b.c
+++ b/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_mm_gp10b.c
@@ -76,7 +76,7 @@ u64 vgpu_gp10b_locked_gmmu_map(struct vm_gk20a *vm,
76 void *handle = NULL; 76 void *handle = NULL;
77 size_t oob_size; 77 size_t oob_size;
78 u8 prot; 78 u8 prot;
79 void *sgl; 79 struct nvgpu_sgl *sgl;
80 80
81 gk20a_dbg_fn(""); 81 gk20a_dbg_fn("");
82 82