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

Deucher, Alexander Alexander.Deucher at amd.com
Wed Feb 24 14:08:58 UTC 2021

[AMD Official Use Only - Internal Distribution Only]

Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
From: Wei Yongjun <weiyongjun1 at huawei.com>
Sent: Wednesday, February 24, 2021 4:49 AM
To: Hulk Robot <hulkci at huawei.com>; Wentland, Harry <Harry.Wentland at amd.com>; Li, Sun peng (Leo) <Sunpeng.Li at amd.com>; Deucher, Alexander <Alexander.Deucher at amd.com>; Koenig, Christian <Christian.Koenig at amd.com>; David Airlie <airlied at linux.ie>; Daniel Vetter <daniel at ffwll.ch>; Kazlauskas, Nicholas <Nicholas.Kazlauskas at amd.com>; Siqueira, Rodrigo <Rodrigo.Siqueira at amd.com>; Pillai, Aurabindo <Aurabindo.Pillai at amd.com>; Wang, Chao-kai (Stylon) <Stylon.Wang at amd.com>; Lakha, Bhawanpreet <Bhawanpreet.Lakha at amd.com>; Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>; Simon Ser <contact at emersion.fr>; Zhuo, Qingqing <Qingqing.Zhuo at amd.com>
Cc: Wei Yongjun <weiyongjun1 at huawei.com>; amd-gfx at lists.freedesktop.org <amd-gfx at lists.freedesktop.org>; dri-devel at lists.freedesktop.org <dri-devel at lists.freedesktop.org>; linux-kernel at vger.kernel.org <linux-kernel at vger.kernel.org>
Subject: [PATCH -next] drm/amd/display: Fix unused variable warning

GCC reports the following warning with W=1:

 warning: unused variable 'dm' [-Wunused-variable]
 5439 |  struct amdgpu_display_manager *dm = &adev->dm;
      |                                 ^~

This variable only used when CONFIG_DRM_AMD_DC_DCN is set, this
commit fix the warning.

Reported-by: Hulk Robot <hulkci at huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1 at huawei.com>
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 e24a13fd2730..bda8d5f4e56a 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -5436,8 +5436,8 @@ static inline int dm_set_vblank(struct drm_crtc *crtc, bool enable)
         struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc);
         struct amdgpu_device *adev = drm_to_adev(crtc->dev);
         struct dm_crtc_state *acrtc_state = to_dm_crtc_state(crtc->state);
-       struct amdgpu_display_manager *dm = &adev->dm;
 #if defined(CONFIG_DRM_AMD_DC_DCN)
+       struct amdgpu_display_manager *dm = &adev->dm;
         unsigned long flags;
         int rc = 0;

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20210224/8d3f129d/attachment-0001.htm>

More information about the amd-gfx mailing list