From: Hamza Mahfooz <hamza.mahfooz@xxxxxxx> If we build the kernel without CONFIG_DRM_AMD_SECURE_DISPLAY set, we get the following compile warning: drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_crc.c: In function ‘amdgpu_dm_crtc_configure_crc_source’: drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_crc.c:204:13: warning: unused variable ‘i’ [-Wunused-variable] 204 | int i, ret = 0; | ^ So, guard variable i around CONFIG_DRM_AMD_SECURE_DISPLAY. Fixes: 98f02f4c7050 ("SWDEV-351660 - dc: Implement multiple secure display") Reviewed-by: HaoPing Liu <HaoPing.Liu@xxxxxxx> Acked-by: Jasdeep Dhillon <jdhillon@xxxxxxx> Signed-off-by: Hamza Mahfooz <hamza.mahfooz@xxxxxxx> --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c index 733041a55ed1..8bf33fa4abd9 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c @@ -198,10 +198,13 @@ int amdgpu_dm_crtc_configure_crc_source(struct drm_crtc *crtc, struct dm_crtc_state *dm_crtc_state, enum amdgpu_dm_pipe_crc_source source) { +#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY) + int i; +#endif struct amdgpu_device *adev = drm_to_adev(crtc->dev); struct dc_stream_state *stream_state = dm_crtc_state->stream; bool enable = amdgpu_dm_is_valid_crc_source(source); - int i, ret = 0; + int ret = 0; /* Configuration will be deferred to stream enable. */ if (!stream_state) -- 2.34.1