summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2017-08-30 16:43:41 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-09-07 23:09:53 -0400
commitde0ce3e017decadd3a5049477f17ba770ddf074c (patch)
tree5f0d7fc7a9a0bae17093b891651b0a4c620a6369 /drivers/gpu/nvgpu/common
parent5e2c0c5c96d68aed9f6e2de857d49a61990ae55f (diff)
gpu: nvgpu: Cast int to u8 explicitly
In the Linux VM code the kind attribute is assigned to a u8 from an int. The code is safe due to the checks in place, however, coverity does not like this so explicitly cast to u8 before assigning kind to kind_v. Coverity ID: 2567919 Bug 200291879 Change-Id: I3860faa99da8ac1a24bd0c3d77c7fbc72207614a Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1548712 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common')
-rw-r--r--drivers/gpu/nvgpu/common/linux/vm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/vm.c b/drivers/gpu/nvgpu/common/linux/vm.c
index 0ace5abe..f2a38f7c 100644
--- a/drivers/gpu/nvgpu/common/linux/vm.c
+++ b/drivers/gpu/nvgpu/common/linux/vm.c
@@ -243,7 +243,7 @@ u64 nvgpu_vm_map(struct vm_gk20a *vm,
243 err = -EINVAL; 243 err = -EINVAL;
244 goto clean_up; 244 goto clean_up;
245 } else { 245 } else {
246 bfr.kind_v = kind; 246 bfr.kind_v = (u8)kind;
247 } 247 }
248 bfr.size = dmabuf->size; 248 bfr.size = dmabuf->size;
249 sgl = bfr.sgt->sgl; 249 sgl = bfr.sgt->sgl;