]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amd/display: Remove unreachable check
authorIvan Lipski <ivlipski@amd.com>
Fri, 31 May 2024 20:31:02 +0000 (16:31 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 14 Jun 2024 20:17:13 +0000 (16:17 -0400)
[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 <zaeem.mohamed@amd.com>
Signed-off-by: Ivan Lipski <ivlipski@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/resource/dcn20/dcn20_resource.c
drivers/gpu/drm/amd/display/dc/resource/dcn30/dcn30_resource.c

index c78675f8be8af7e164ab3584c4d836ea35d1473d..b2d79c908ec2ade3324a5de776b28f81e45310ef 100644 (file)
@@ -1666,8 +1666,6 @@ void dcn20_set_mcif_arb_params(
                        if (dwb_pipe >= MAX_DWB_PIPES)
                                return;
                }
-               if (dwb_pipe >= MAX_DWB_PIPES)
-                       return;
        }
 }
 
index 0cb2cc56d97309e47f87af4d36e9e91b7db301e5..5040a4c6ed186269e76ceb448c8005e33e9ff4b0 100644 (file)
@@ -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 = {