From nobody Mon Sep 15 06:22:54 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 90669C46467 for ; Sat, 14 Jan 2023 21:21:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230235AbjANVVW (ORCPT ); Sat, 14 Jan 2023 16:21:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230441AbjANVVT (ORCPT ); Sat, 14 Jan 2023 16:21:19 -0500 Received: from msg-4.mailo.com (msg-4.mailo.com [213.182.54.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C52555A2 for ; Sat, 14 Jan 2023 13:21:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1673731271; bh=wolWjCpEf1H3OIKgIMygLfimJEpe1hYUkjsFG3xvaSQ=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:In-Reply-To; b=c1tg4ZH5I0+IfBjxxi2KZAd7mkqw7NSo5wE9tI0G1AS0AvfH64X7qB/kbxE9TJ1zN wBYBPlleHVCre9oKfvtshgaiSFJAn9+y/y1t1h1Kc+aeVdTqJeFIyXlRj48sGz3Uvu 8KKExwiaRXcrnqNZvNQ87rVryO8Sj7fZo66RC2cM= Received: by b-6.in.mailobj.net [192.168.90.16] with ESMTP via ip-206.mailobj.net [213.182.55.206] Sat, 14 Jan 2023 22:21:11 +0100 (CET) X-EA-Auth: QPUqpE0hegBYiohcI3WBO46zBlZZafd7KjhOMaLKR2qPNKImrg+0H8TDInokhH06BXgI+ThOMBoLtvl3iKaVoyK+5PYKXj8y Date: Sun, 15 Jan 2023 02:51:06 +0530 From: Deepak R Varma To: Harry Wentland , Leo Li , Rodrigo Siqueira , Alex Deucher , Christian =?iso-8859-1?Q?K=F6nig?= , "Pan, Xinhui" , David Airlie , Daniel Vetter , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Saurabh Singh Sengar , Praveen Kumar Subject: [PATCH 3/4] drm/amd/display: dcn21: Use min()/max() helper macros Message-ID: <3ef364025902b76f9aa388069026b6eace353827.1673730293.git.drv@mailo.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 --- .../gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c= b/drivers/gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c index 1d84ae50311d..41fb5fddd85d 100644 --- a/drivers/gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c +++ b/drivers/gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c @@ -838,10 +838,7 @@ static bool CalculatePrefetchSchedule( =20 dst_y_prefetch_equ =3D dml_floor(4.0 * (dst_y_prefetch_equ + 0.125), 1) /= 4.0; =20 - if (dst_y_prefetch_oto < dst_y_prefetch_equ) - *DestinationLinesForPrefetch =3D dst_y_prefetch_oto; - else - *DestinationLinesForPrefetch =3D dst_y_prefetch_equ; + *DestinationLinesForPrefetch =3D min(dst_y_prefetch_oto, dst_y_prefetch_e= qu); =20 // Limit to prevent overflow in DST_Y_PREFETCH register *DestinationLinesForPrefetch =3D dml_min(*DestinationLinesForPrefetch, 63= .75); --=20 2.34.1