Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp1099217rwb; Sat, 14 Jan 2023 14:11:39 -0800 (PST) X-Google-Smtp-Source: AMrXdXuOQ4t/mBNicwcoYte0mtTnE7FiB5lVgszZzZpzWO/NBRvxT1mCheR1ycPlmH/orZ7SYCtB X-Received: by 2002:a17:907:6026:b0:84d:445b:8aa6 with SMTP id fs38-20020a170907602600b0084d445b8aa6mr17726497ejc.70.1673734299605; Sat, 14 Jan 2023 14:11:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673734299; cv=none; d=google.com; s=arc-20160816; b=yc7eXU1GV487bKHzxhXg9DwHwnsqAOCA0h2V8IpVzHCkoIG6/ZdmQmtJ0QRnz+83mG Ez2vePbmy0u5jfBfJ1dXyMUjhjNvv74kr+rclfBfjDgm924jeRwMi2oSgVK699hm5gKZ L78Kro+Z0CECakrQyqVifvKB/Yg+ZDEieksSJ0FvonZ0ThIdQ57gM6TSD+nq6NB9UFQM 4A8LpTx2fMH8VO/T4HhFunCkzo9gIJTVuuL3McopKv8eIm+NCuRSUpk9kV4hEZicZV1o 46x4j6AVMqBfY7PCYXgK+1MurQlSuAeMGTnNSjdHiPCnS7HC9kK9JbSGIwUFrOQX9+EI aSLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=qjBCFLx6sZGUjyLNkcHb3fYHT71IY9aLwmNwOgoUzq0=; b=yuH6eO9t/gog/kzK3hPm7fYfg7wXY/DoW6U1AM3t+fRGsMSjge3kg16YWyaaLwpkwD g9kRVt0hZ3LWnyQwiUeRF5S/Mlj+Uw2jEqmni58LUBDd95OeR57wwrtZh3Yy0pw3JZNN V2i0a9+ojQBKUIv0dJyBQNTAMoQfDAJ0pYCDG/rKwhePYRQODgD31v0I9rPIORfVEGp/ ZEvln6BMO60WJqXvrrKhJXYx6vq5wdwhsUQHUlkKe2MWwbyvTcVZCQ91FRD6C7VnjtsS +1I/iEfGSm055mnH8SQNgKyxehnNxNnXjoEGZS6vkXCQtqJ7vtl9i0SwRipcaMpZluik HWhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=c1tg4ZH5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oq19-20020a170906cc9300b007c4f6c37193si20887506ejb.223.2023.01.14.14.11.27; Sat, 14 Jan 2023 14:11:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=c1tg4ZH5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230507AbjANVVV (ORCPT + 52 others); Sat, 14 Jan 2023 16:21:21 -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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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( dst_y_prefetch_equ = dml_floor(4.0 * (dst_y_prefetch_equ + 0.125), 1) / 4.0; - 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); // Limit to prevent overflow in DST_Y_PREFETCH register *DestinationLinesForPrefetch = dml_min(*DestinationLinesForPrefetch, 63.75); -- 2.34.1