From de0ce3e017decadd3a5049477f17ba770ddf074c Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Wed, 30 Aug 2017 13:43:41 -0700 Subject: 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 Reviewed-on: https://git-master.nvidia.com/r/1548712 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/linux/vm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/gpu') 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, err = -EINVAL; goto clean_up; } else { - bfr.kind_v = kind; + bfr.kind_v = (u8)kind; } bfr.size = dmabuf->size; sgl = bfr.sgt->sgl; -- cgit v1.2.2