Skip to content

Commit fde789e

Browse files
matt-auldChristianKoenigAMD
authored andcommitted
drm/i915/ttm: fix sparse warning
Sparse complains with: drivers/gpu/drm/i915/gem/i915_gem_ttm.c:1066:21: sparse: expected restricted vm_fault_t [assigned] [usertype] ret drivers/gpu/drm/i915/gem/i915_gem_ttm.c:1066:21: sparse: got int Fixes: 516198d ("drm/i915: audit bo->resource usage v3") Reported-by: kernel test robot <[email protected]> Signed-off-by: Matthew Auld <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Nirmoy Das <[email protected]> Acked-by: Christian König <[email protected]> Signed-off-by: Christian König <[email protected]>
1 parent ec6ec9c commit fde789e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/gpu/drm/i915/gem/i915_gem_ttm.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,11 +1067,12 @@ static vm_fault_t vm_fault_ttm(struct vm_fault *vmf)
10671067
.interruptible = true,
10681068
.no_wait_gpu = true, /* should be idle already */
10691069
};
1070+
int err;
10701071

10711072
GEM_BUG_ON(!bo->ttm || !(bo->ttm->page_flags & TTM_TT_FLAG_SWAPPED));
10721073

1073-
ret = ttm_bo_validate(bo, i915_ttm_sys_placement(), &ctx);
1074-
if (ret) {
1074+
err = ttm_bo_validate(bo, i915_ttm_sys_placement(), &ctx);
1075+
if (err) {
10751076
dma_resv_unlock(bo->base.resv);
10761077
return VM_FAULT_SIGBUS;
10771078
}

0 commit comments

Comments
 (0)