On 2025-01-02 10:01, Kent Russell wrote:
container_of cannot return NULL, so it is unnecessary to check for
NULL after gem_to_amdgpu_bo, which just is a container_of call

Signed-off-by: Kent Russell <kent.russ...@amd.com>

Reviewed-by: Felix Kuehling <felix.kuehl...@amd.com>


---
  drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 6 ++----
  1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
index 7edccb675921..a1691ed717da 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
@@ -196,10 +196,8 @@ static void amdgpu_gem_object_free(struct drm_gem_object 
*gobj)
  {
        struct amdgpu_bo *aobj = gem_to_amdgpu_bo(gobj);
- if (aobj) {
-               amdgpu_hmm_unregister(aobj);
-               ttm_bo_put(&aobj->tbo);
-       }
+       amdgpu_hmm_unregister(aobj);
+       ttm_bo_put(&aobj->tbo);
  }
int amdgpu_gem_object_create(struct amdgpu_device *adev, unsigned long size,

Reply via email to