From: Ivan Lipski Date: Fri, 31 May 2024 20:31:02 +0000 (-0400) Subject: drm/amd/display: Remove unreachable check X-Git-Tag: v6.11-rc1~141^2~18^2~117 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3c6ad7320b32fc5de1cd9a5b092dc1d5a3cd0348;p=thirdparty%2Flinux.git drm/amd/display: Remove unreachable check [WHY] Coverity analysis flagged this code as DEADCODE since the condition and return in the outer loop are never reached. All operations with the 'dwb_pipe' variable happen in the inner loop, that already contains the same check with the 'MAX_DWB_PIPES'. The later check condition cannot occur before the check condition in the inner loop, thus the later condition is unreacable. [HOW] Remove the unreachable condition. Acked-by: Zaeem Mohamed Signed-off-by: Ivan Lipski Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn20/dcn20_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn20/dcn20_resource.c index c78675f8be8af..b2d79c908ec2a 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dcn20/dcn20_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dcn20/dcn20_resource.c @@ -1666,8 +1666,6 @@ void dcn20_set_mcif_arb_params( if (dwb_pipe >= MAX_DWB_PIPES) return; } - if (dwb_pipe >= MAX_DWB_PIPES) - return; } } diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn30/dcn30_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn30/dcn30_resource.c index 0cb2cc56d9730..5040a4c6ed186 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dcn30/dcn30_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dcn30/dcn30_resource.c @@ -1419,10 +1419,7 @@ void dcn30_set_mcif_arb_params( if (dwb_pipe >= MAX_DWB_PIPES) return; } - if (dwb_pipe >= MAX_DWB_PIPES) - return; } - } static struct dc_cap_funcs cap_funcs = {