[PATCH] drm/amd/display: Fix unused variable warning

Harry Wentland harry.wentland at amd.com
Wed Jan 20 22:34:07 UTC 2021


On 2021-01-20 12:23 p.m., Bhawanpreet Lakha wrote:
> [Why]
> The dm struct is only being used if DCN config is defined and this
> causes a unused variable warning if DCN option is not set.
> 
> [How]
> Remove the compile flag so the variable is used (there also seems to be
> a duplicate guard due to a bad rebase) so remove the outer guard to fix
> the warning.
> 
> Fixes this warning
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c: In function 'dm_set_vblank':
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c:5380:33: warning: unused variable 'dm' [-Wunused-variable]
> 
> Fixes: e177af8a43da ("drm/amd/display: Fix deadlock during gpu reset v3")
> Cc: Alex Deucher <alexander.deucher at amd.com>
> Cc: Nicholas Kazlauskas <Nicholas.Kazlauskas at amd.com>
> Cc: Stephen Rothwell <sfr at canb.auug.org.au
> Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha at amd.com>

Reviewed-by: Harry Wentland <harry.wentland at amd.com>

Harry

> ---
>   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 --
>   1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index 83ec92a69cba..7c188c8eaeb1 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -5472,7 +5472,6 @@ static inline int dm_set_vblank(struct drm_crtc *crtc, bool enable)
>   	if (!dc_interrupt_set(adev->dm.dc, irq_source, enable))
>   		return -EBUSY;
>   
> -#if defined(CONFIG_DRM_AMD_DC_DCN)
>   	if (amdgpu_in_reset(adev))
>   		return 0;
>   
> @@ -5492,7 +5491,6 @@ static inline int dm_set_vblank(struct drm_crtc *crtc, bool enable)
>   
>   	mutex_unlock(&dm->dc_lock);
>   
> -#endif
>   	return 0;
>   }
>   
> 


More information about the amd-gfx mailing list