[PATCH v2 09/10] drm/amdgpu: remove unnecessary variables

Felix Kuehling felix.kuehling at amd.com
Thu Dec 9 16:15:10 UTC 2021


Am 2021-12-09 um 10:47 a.m. schrieb Isabella Basso:
> This fixes the warnings below, and also drops the display_count
> variable, as it's unused.
>
>  In function 'svm_range_map_to_gpu':
>  warning: variable 'bo_va' set but not used [-Wunused-but-set-variable]
>  1172 |         struct amdgpu_bo_va bo_va;
>       |                             ^~~~~
>  ...
>  In function 'dcn201_update_clocks':
>  warning: variable 'enter_display_off' set but not used [-Wunused-but-set-variable]
>  132 |         bool enter_display_off = false;
>      |              ^~~~~~~~~~~~~~~~~
>
> Changes since v1:
> - As suggested by Rodrigo Siqueira:
>   1. Drop display_count variable.
> - As suggested by Felix Kuehling:
>   1. Remove block surrounding amdgpu_xgmi_same_hive.
>
> Signed-off-by: Isabella Basso <isabbasso at riseup.net>

The kfd_svm.c portion is

Reviewed-by: Felix Kuehling <Felix.Kuehling at amd.com>

Thank you!


> ---
>  drivers/gpu/drm/amd/amdkfd/kfd_svm.c                       | 4 ----
>  .../gpu/drm/amd/display/dc/clk_mgr/dcn201/dcn201_clk_mgr.c | 7 +------
>  2 files changed, 1 insertion(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
> index 82cb45e30197..835f202dc23d 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
> @@ -1169,7 +1169,6 @@ svm_range_map_to_gpu(struct amdgpu_device *adev, struct amdgpu_vm *vm,
>  		     unsigned long npages, bool readonly, dma_addr_t *dma_addr,
>  		     struct amdgpu_device *bo_adev, struct dma_fence **fence)
>  {
> -	struct amdgpu_bo_va bo_va;
>  	bool table_freed = false;
>  	uint64_t pte_flags;
>  	unsigned long last_start;
> @@ -1182,9 +1181,6 @@ svm_range_map_to_gpu(struct amdgpu_device *adev, struct amdgpu_vm *vm,
>  	pr_debug("svms 0x%p [0x%lx 0x%lx] readonly %d\n", prange->svms,
>  		 last_start, last_start + npages - 1, readonly);
>  
> -	if (prange->svm_bo && prange->ttm_res)
> -		bo_va.is_xgmi = amdgpu_xgmi_same_hive(adev, bo_adev);
> -
>  	for (i = offset; i < offset + npages; i++) {
>  		last_domain = dma_addr[i] & SVM_RANGE_VRAM_DOMAIN;
>  		dma_addr[i] &= ~SVM_RANGE_VRAM_DOMAIN;
> diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn201/dcn201_clk_mgr.c b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn201/dcn201_clk_mgr.c
> index 8c20a0fb1e4f..fbdd0a92d146 100644
> --- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn201/dcn201_clk_mgr.c
> +++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn201/dcn201_clk_mgr.c
> @@ -90,10 +90,8 @@ static void dcn201_update_clocks(struct clk_mgr *clk_mgr_base,
>  	struct clk_mgr_internal *clk_mgr = TO_CLK_MGR_INTERNAL(clk_mgr_base);
>  	struct dc_clocks *new_clocks = &context->bw_ctx.bw.dcn.clk;
>  	struct dc *dc = clk_mgr_base->ctx->dc;
> -	int display_count;
>  	bool update_dppclk = false;
>  	bool update_dispclk = false;
> -	bool enter_display_off = false;
>  	bool dpp_clock_lowered = false;
>  	bool force_reset = false;
>  	bool p_state_change_support;
> @@ -109,10 +107,7 @@ static void dcn201_update_clocks(struct clk_mgr *clk_mgr_base,
>  		dcn2_read_clocks_from_hw_dentist(clk_mgr_base);
>  	}
>  
> -	display_count = clk_mgr_helper_get_active_display_cnt(dc, context);
> -
> -	if (display_count == 0)
> -		enter_display_off = true;
> +	clk_mgr_helper_get_active_display_cnt(dc, context);
>  
>  	if (should_set_clock(safe_to_lower, new_clocks->phyclk_khz, clk_mgr_base->clks.phyclk_khz))
>  		clk_mgr_base->clks.phyclk_khz = new_clocks->phyclk_khz;


More information about the amd-gfx mailing list