From: Christian König Date: Tue, 11 Aug 2015 14:35:54 +0000 (+0200) Subject: drm/amdgpu: fix UVD return code checking X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=4127a59e0b3f914ae8d9843d521a07e117db045a;p=linux-beck.git drm/amdgpu: fix UVD return code checking Signed-off-by: Christian König Reviewed-by: Alex Deucher Tested-and-Reviewed-by: Leo Liu --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c index b56cace92fc6..e7336a95fe59 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c @@ -514,8 +514,8 @@ static int amdgpu_uvd_cs_msg(struct amdgpu_uvd_cs_ctx *ctx, struct amdgpu_device *adev = ctx->parser->adev; int32_t *msg, msg_type, handle; void *ptr; - - int i, r; + long r; + int i; if (offset & 0x3F) { DRM_ERROR("UVD messages must be 64 byte aligned!\n"); @@ -524,14 +524,14 @@ static int amdgpu_uvd_cs_msg(struct amdgpu_uvd_cs_ctx *ctx, r = reservation_object_wait_timeout_rcu(bo->tbo.resv, true, false, MAX_SCHEDULE_TIMEOUT); - if (r) { - DRM_ERROR("Failed waiting for UVD message (%d)!\n", r); + if (r < 0) { + DRM_ERROR("Failed waiting for UVD message (%ld)!\n", r); return r; } r = amdgpu_bo_kmap(bo, &ptr); if (r) { - DRM_ERROR("Failed mapping the UVD message (%d)!\n", r); + DRM_ERROR("Failed mapping the UVD message (%ld)!\n", r); return r; }