Skip to content

Commit f01afd1

Browse files
arndbalexdeucher
authored andcommitted
drm/amd/display: Fix unused variable warning
Some of the newly added code is hidden inside of #ifdef blocks, but one variable is unused when debugfs is disabled: drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:8370:8: error: unused variable 'configure_crc' [-Werror,-Wunused-variable] Change the #ifdef to an if(IS_ENABLED()) check to fix the warning and avoid adding more #ifdefs. Fixes: c920888 ("drm/amd/display: Expose new CRC window property") Reviewed-by: Wayne Lin <Wayne.Lin@amd.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent e689f71 commit f01afd1

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8378,8 +8378,7 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)
83788378
acrtc->dm_irq_params.stream = dm_new_crtc_state->stream;
83798379
manage_dm_interrupts(adev, acrtc, true);
83808380
}
8381-
#ifdef CONFIG_DEBUG_FS
8382-
if (new_crtc_state->active &&
8381+
if (IS_ENABLED(CONFIG_DEBUG_FS) && new_crtc_state->active &&
83838382
amdgpu_dm_is_valid_crc_source(dm_new_crtc_state->crc_src)) {
83848383
/**
83858384
* Frontend may have changed so reapply the CRC capture
@@ -8400,7 +8399,6 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)
84008399
amdgpu_dm_crtc_configure_crc_source(
84018400
crtc, dm_new_crtc_state, dm_new_crtc_state->crc_src);
84028401
}
8403-
#endif
84048402
}
84058403

84068404
for_each_new_crtc_in_state(state, crtc, new_crtc_state, j)

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ static inline bool amdgpu_dm_is_valid_crc_source(enum amdgpu_dm_pipe_crc_source
4646
}
4747

4848
/* amdgpu_dm_crc.c */
49-
#ifdef CONFIG_DEBUG_FS
5049
bool amdgpu_dm_crc_window_is_default(struct dm_crtc_state *dm_crtc_state);
5150
bool amdgpu_dm_crc_window_changed(struct dm_crtc_state *dm_new_crtc_state,
5251
struct dm_crtc_state *dm_old_crtc_state);
5352
int amdgpu_dm_crtc_configure_crc_source(struct drm_crtc *crtc,
5453
struct dm_crtc_state *dm_crtc_state,
5554
enum amdgpu_dm_pipe_crc_source source);
55+
#ifdef CONFIG_DEBUG_FS
5656
int amdgpu_dm_crtc_set_crc_source(struct drm_crtc *crtc, const char *src_name);
5757
int amdgpu_dm_crtc_verify_crc_source(struct drm_crtc *crtc,
5858
const char *src_name,

0 commit comments

Comments
 (0)