[2/2] drm/amdgpu: use exiting amdgput_ctx_total_num_entities function

Submitted by Wang, Kevin(Yang) on Aug. 13, 2019, 9:08 a.m.

Details

Message ID 20190813090745.9496-2-kevin1.wang@amd.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in AMD X.Org drivers

Not browsing as part of any series.

Commit Message

Wang, Kevin(Yang) Aug. 13, 2019, 9:08 a.m.
simplify driver code.

Signed-off-by: Kevin Wang <kevin1.wang@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
index 95d8201a738e..89c26bb0f05c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
@@ -290,10 +290,7 @@  static void amdgpu_ctx_do_release(struct kref *ref)
 
 	ctx = container_of(ref, struct amdgpu_ctx, refcount);
 
-	num_entities = 0;
-	for (i = 0; i < AMDGPU_HW_IP_NUM; i++)
-		num_entities += amdgpu_ctx_num_entities[i];
-
+	num_entities = amdgpu_ctx_total_num_entities();
 	for (i = 0; i < num_entities; i++)
 		drm_sched_entity_destroy(&ctx->entities[0][i].entity);
 

Comments

Am 13.08.19 um 11:08 schrieb Wang, Kevin(Yang):
> simplify driver code.
>
> Signed-off-by: Kevin Wang <kevin1.wang@amd.com>

Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 5 +----
>   1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> index 95d8201a738e..89c26bb0f05c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> @@ -290,10 +290,7 @@ static void amdgpu_ctx_do_release(struct kref *ref)
>   
>   	ctx = container_of(ref, struct amdgpu_ctx, refcount);
>   
> -	num_entities = 0;
> -	for (i = 0; i < AMDGPU_HW_IP_NUM; i++)
> -		num_entities += amdgpu_ctx_num_entities[i];
> -
> +	num_entities = amdgpu_ctx_total_num_entities();
>   	for (i = 0; i < num_entities; i++)
>   		drm_sched_entity_destroy(&ctx->entities[0][i].entity);
>