@@ -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)
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@wanadoo.fr> --- 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(-)