Skip to contentSkip to conversation

drm/amd/display: hide an unused variable

PATCH Applied Arnd Bergmann 3 participants 3 messages Sep 18, 2019 – Sep 19, 2019

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

PATCH 1/1 drm/amd/display: hide an unused variable

Without CONFIG_DEBUG_FS, we get a warning for an unused variable:

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

Hide the variable in an #ifdef like its only users.

Fixes 14b2584636c6 ("drm/amd/display: add functionality to grab DPRX CRC entries.")
---
 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 e1b09bb432bd..74252f57bafb 100644
@@ -6017,7 +6017,9 @@ static void amdgpu_dm_enable_crtc_interrupts(struct drm_device *dev,
 	struct drm_crtc *crtc;
 	struct drm_crtc_state *old_crtc_state, *new_crtc_state;
 	int i;
+#ifdef CONFIG_DEBUG_FS
 	enum amdgpu_dm_pipe_crc_source source;
+#endif
 
 	for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state,
 				      new_crtc_state, i) {
Signature · 1 line
2.20.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Arnd Bergmann

Without CONFIG_DEBUG_FS, we get a warning for an unused variable:

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

Hide the variable in an #ifdef like its only users.

Fixes 14b2584636c6 ("drm/amd/display: add functionality to grab DPRX CRC entries.")

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 e1b09bb432bd..74252f57bafb 100644

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static void amdgpu_dm_enable_crtc_interrupts(struct drm_device *dev, · line 6025

Quoted 9 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -0
@@ -6017,7 +6017,9 @@ static void amdgpu_dm_enable_crtc_interrupts(struct drm_device *dev,
 	struct drm_crtc *crtc;
 	struct drm_crtc_state *old_crtc_state, *new_crtc_state;
 	int i;
+#ifdef CONFIG_DEBUG_FS
 	enum amdgpu_dm_pipe_crc_source source;
+#endif
 
 	for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state,
 				      new_crtc_state, i) {

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

Applied
#2 lore raw
Quoted 5 lines · Harry Wentland
Quoted 3 lines · Arnd Bergmann

Without CONFIG_DEBUG_FS, we get a warning for an unused variable:

Quoted 9 lines
Quoted 6 lines

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

Hide the variable in an #ifdef like its only users.

Fixes 14b2584636c6 ("drm/amd/display: add functionality to grab DPRX CRC entries.")

Applied. thanks!

Alex

Quoted 18 lines

Harry

Quoted 16 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 +2 -0
index e1b09bb432bd..74252f57bafb 100644
@@ -6017,7 +6017,9 @@ static void amdgpu_dm_enable_crtc_interrupts(struct drm_device *dev,
      struct drm_crtc *crtc;
      struct drm_crtc_state *old_crtc_state, *new_crtc_state;
      int i;
+#ifdef CONFIG_DEBUG_FS
      enum amdgpu_dm_pipe_crc_source source;
+#endif
 
Quoted 7 lines

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static void amdgpu_dm_enable_crtc_interrupts(struct drm_device *dev, · line 6025

Quoted 3 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
      for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state,
                                    new_crtc_state, i) {

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

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