Skip to contentSkip to conversation

drm/amd/display: fix unused variable warning

PATCH In review Arnd Bergmann 2 participants 2 messages Jan 25, 2021

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

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

From: Arnd Bergmann <[email protected]>

After all users of the 'dm' warnings got hidden in an #ifdef, the compiler started warning about it being unused:

drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:5380:33: error: unused variable 'dm' [-Werror,-Wunused-variable]

Add another such #ifdef.

Fixes 98ab5f3513f9 ("drm/amd/display: Fix deadlock during gpu reset v3")
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -0
index a90dc4d31c32..37bf2dd87e1e 100644
@@ -5377,7 +5377,9 @@ 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);
+#if defined(CONFIG_DRM_AMD_DC_DCN)
 	struct amdgpu_display_manager *dm = &adev->dm;
+#endif
 	int rc = 0;
 
 	if (enable) {
Signature · 6 lines
2.29.2

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

After all users of the 'dm' warnings got hidden in an #ifdef, the compiler started warning about it being unused:

drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:5380:33: error: unused variable 'dm' [-Werror,-Wunused-variable]

Add another such #ifdef.

Fixes 98ab5f3513f9 ("drm/amd/display: Fix deadlock during gpu reset v3")

Harry

Quoted 10 lines
---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
index a90dc4d31c32..37bf2dd87e1e 100644

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static inline int dm_set_vblank(struct drm_crtc *crtc, bool enable) · line 5385

Quoted 9 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -0
@@ -5377,7 +5377,9 @@ 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);
+#if defined(CONFIG_DRM_AMD_DC_DCN)
  	struct amdgpu_display_manager *dm = &adev->dm;
+#endif
  	int rc = 0;
 
  	if (enable) {

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