drm/amdgpu: simplify the bo reference on amdgpu_bo_update
authorHuang Rui <ray.huang@amd.com>
Wed, 4 Jul 2018 10:08:54 +0000 (18:08 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 18 Jul 2018 21:18:44 +0000 (16:18 -0500)
BO ptr already be initialized at definition, we needn't use the complicated
reference.

v2: fix typo at subject line

Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c

index 5d3d783..098dd1b 100644 (file)
@@ -1646,18 +1646,17 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev,
        uint64_t flags;
        int r;
 
-       if (clear || !bo_va->base.bo) {
+       if (clear || !bo) {
                mem = NULL;
                nodes = NULL;
                exclusive = NULL;
        } else {
                struct ttm_dma_tt *ttm;
 
-               mem = &bo_va->base.bo->tbo.mem;
+               mem = &bo->tbo.mem;
                nodes = mem->mm_node;
                if (mem->mem_type == TTM_PL_TT) {
-                       ttm = container_of(bo_va->base.bo->tbo.ttm,
-                                          struct ttm_dma_tt, ttm);
+                       ttm = container_of(bo->tbo.ttm, struct ttm_dma_tt, ttm);
                        pages_addr = ttm->dma_address;
                }
                exclusive = reservation_object_get_excl(bo->tbo.resv);