Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Srinivasan Shanmugam and committed by
Alex Deucher
bf2ad4fb 499839ec

+1 -1
+1 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c
··· 90 90 return NULL; 91 91 92 92 fence = container_of(f, struct amdgpu_amdkfd_fence, base); 93 - if (fence && f->ops == &amdkfd_fence_ops) 93 + if (f->ops == &amdkfd_fence_ops) 94 94 return fence; 95 95 96 96 return NULL;