Skip to content

Commit bf2ad4f

Browse files
srishanmalexdeucher
authored andcommitted
drm/amdgpu: Drop 'fence' check in 'to_amdgpu_amdkfd_fence()'
Return value of container_of(...) can't be null, so null check is not required for 'fence'. Hence drop its NULL check. Fixes the below: drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c:93 to_amdgpu_amdkfd_fence() warn: can 'fence' even be NULL? Cc: Felix Kuehling <Felix.Kuehling@amd.com> Cc: Christian König <christian.koenig@amd.com> Cc: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com> Reviewed-by: Felix Kuehling <felix.kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 499839e commit bf2ad4f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ struct amdgpu_amdkfd_fence *to_amdgpu_amdkfd_fence(struct dma_fence *f)
9090
return NULL;
9191

9292
fence = container_of(f, struct amdgpu_amdkfd_fence, base);
93-
if (fence && f->ops == &amdkfd_fence_ops)
93+
if (f->ops == &amdkfd_fence_ops)
9494
return fence;
9595

9696
return NULL;

0 commit comments

Comments
 (0)