Skip to contentSkip to conversation

drm/amd/display: Fix unused variable warning

PATCH In review Wei Yongjun 2 participants 2 messages Feb 24, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd/display: Fix unused variable warning

GCC reports the following warning with W=1:

drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:5439:33:
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.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
index e24a13fd2730..bda8d5f4e56a 100644
@@ -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;
 #endif
 	int rc = 0;

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

maintainer Reviewed-by on v1 1/1
#1 lore raw

[AMD Official Use Only - Internal Distribution Only]

________________________________
From: Wei Yongjun <[email protected]>
Sent: Wednesday, February 24, 2021 4:49 AM
To: Hulk Robot <[email protected]>; Wentland, Harry <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; David Airlie <[email protected]>; Daniel Vetter <[email protected]>; Kazlauskas, Nicholas <[email protected]>; Siqueira, Rodrigo <[email protected]>; Pillai, Aurabindo <[email protected]>; Wang, Chao-kai (Stylon) <[email protected]>; Lakha, Bhawanpreet <[email protected]>; Bas Nieuwenhuizen <[email protected]>; Simon Ser <[email protected]>; Zhuo, Qingqing <[email protected]>
Cc: Wei Yongjun <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>
Subject: [PATCH -next] drm/amd/display: Fix unused variable warning

GCC reports the following warning with W=1:

drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:5439:33:
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.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
index e24a13fd2730..bda8d5f4e56a 100644
@@ -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;
 #endif
         int rc = 0;

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel