@@ -626,10 +626,7 @@ static bool CalculatePrefetchSchedule(
dst_y_prefetch_oto = Tpre_oto / LineTime;
- if (dst_y_prefetch_oto < dst_y_prefetch_equ)
- *DestinationLinesForPrefetch = dst_y_prefetch_oto;
- else
- *DestinationLinesForPrefetch = dst_y_prefetch_equ;
+ *DestinationLinesForPrefetch = min(dst_y_prefetch_oto, dst_y_prefetch_equ);
*DestinationLinesForPrefetch = dml_floor(4.0 * (*DestinationLinesForPrefetch + 0.125), 1)
/ 4;
@@ -686,10 +686,7 @@ static bool CalculatePrefetchSchedule(
dst_y_prefetch_oto = Tpre_oto / LineTime;
- if (dst_y_prefetch_oto < dst_y_prefetch_equ)
- *DestinationLinesForPrefetch = dst_y_prefetch_oto;
- else
- *DestinationLinesForPrefetch = dst_y_prefetch_equ;
+ *DestinationLinesForPrefetch = min(dst_y_prefetch_oto, dst_y_prefetch_equ);
*DestinationLinesForPrefetch = dml_floor(4.0 * (*DestinationLinesForPrefetch + 0.125), 1)
/ 4;
Use the standard min() / max() helper macros instead of direct variable comparison using if/else blocks or ternary operator. Change identified using minmax.cocci Coccinelle semantic patch. Signed-off-by: Deepak R Varma <drv@mailo.com> --- .../gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c | 5 +---- .../gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20v2.c | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-)