[PATCH 2/3] drm/amd/display: Simplify get_dmif_switch_time_us()

From: Christophe JAILLET
Date: Mon May 29 2023 - 03:19:19 EST


Thanks to the sanity check a few lines above:
if (!h_total || !v_total || !pix_clk_khz)

and the computation done afterwards on these non 0 values, we know that
'pixels_per_second', 'pixels_per_frame' and 'refresh_rate' are not 0

The code can be simplified accordingly.

Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
---
NOT compile tested. Because of some BROKEN in KConfig files.
---
drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c | 13 -------------
1 file changed, 13 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c b/drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c
index 091f0d68a045..eafe8561e55e 100644
--- a/drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c
+++ b/drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c
@@ -690,21 +690,8 @@ static uint32_t get_dmif_switch_time_us(
pixels_per_second = pix_clk_khz * 1000;
pixels_per_frame = h_total * v_total;

- if (!pixels_per_second || !pixels_per_frame) {
- /* avoid division by zero */
- ASSERT(pixels_per_frame);
- ASSERT(pixels_per_second);
- return single_frame_time_multiplier * min_single_frame_time_us;
- }
-
refresh_rate = pixels_per_second / pixels_per_frame;

- if (!refresh_rate) {
- /* avoid division by zero*/
- ASSERT(refresh_rate);
- return single_frame_time_multiplier * min_single_frame_time_us;
- }
-
frame_time = us_in_sec / refresh_rate;

if (frame_time < min_single_frame_time_us)
--
2.34.1