From patchwork Sat Oct 29 15:56:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: KaiLong Wang X-Patchwork-Id: 12737 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1414584wru; Sat, 29 Oct 2022 09:14:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6JPnyb79ruYwc/f/oxP+NShsnUzTeUhFpBZxMeAo8ki9MlkKHrWg9/FSWWTaa9rZPDVBXR X-Received: by 2002:a65:480c:0:b0:458:88cd:f48 with SMTP id h12-20020a65480c000000b0045888cd0f48mr4373352pgs.529.1667060075784; Sat, 29 Oct 2022 09:14:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667060075; cv=none; d=google.com; s=arc-20160816; b=i0wwqUwz2zIUivVdNdbyh21obSy4xUgbHvUs8HbBcu9oDCjlPsIS+wqkrPWmABaaIH G/mxw8IieOdJy/mBdE5epBowkiIcdv/u7vLWbYxTbr4z7hImSiw4HMzR5h0oY3xm5x4G rBsyEP5ZMDLwOqRuVEyzWJpwn+dnRCwfl+P+ZNV7ty/BBKHE8gPuHpJk4xSKh72gSBkt DamvcClrQ0UyBtygiQTTP5BugVBPgO6hC/ptwqgyUeFDemDJxokCXFh1/5rSx1UXeiii uYxo8ZrYo6NwJmt//viiJAEZxz0ScAoxr1nSZdyO9V4qHNJJ0blG8D0qv2tivuhZcoF+ UgBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:mime-version :content-transfer-encoding:subject:cc:to:from:date; bh=1T8kgiMz5Les5T7XwMa0JLDwy/J4TPC7FhN1AhJUoRA=; b=cALUugMiRKCyhf56gb0sZLq3ycN0yzYKKkdyL9/b5NIBQAeGw9KEkFU9q1mwcfHzr0 b4m8UcUfRzAkWqtpWeiKvUvM4KDioMHmhiHgcH3wShgloD68C566OdnXO4ueVb/QD/YB xjtCaqf9sojCUdRDaGbv3VXoFqhjSHYPPRUoVMlcN2IxwfsdCLbMnC9JPCQUC8D+SkJf 6ALGyzldmAXXAlrFZl8HuXaf2ob/FcRLbLvOoHDiW8Pl3uBbAMfhAu8oqjj9PVT1qD5M /PqG4KNVmTgj5XpTfzxGnN+f6RJs7ezRcD7InO0+/6yNfvgI09HJoiJVE3XM28FONBOV j//w== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fy3-20020a17090b020300b00200a43d4d58si2201387pjb.80.2022.10.29.09.14.22; Sat, 29 Oct 2022 09:14:35 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229711AbiJ2QBA (ORCPT + 99 others); Sat, 29 Oct 2022 12:01:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229491AbiJ2QA7 (ORCPT ); Sat, 29 Oct 2022 12:00:59 -0400 Received: from jari.cn (unknown [218.92.28.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D88F12CCB5 for ; Sat, 29 Oct 2022 09:00:44 -0700 (PDT) Received: by ajax-webmail-localhost.localdomain (Coremail) ; Sat, 29 Oct 2022 23:56:03 +0800 (GMT+08:00) X-Originating-IP: [182.148.13.81] Date: Sat, 29 Oct 2022 23:56:03 +0800 (GMT+08:00) X-CM-HeaderCharset: UTF-8 From: wangkailong@jari.cn To: harry.wentland@amd.com, daniel@ffwll.ch, sunpeng.li@amd.com, Rodrigo.Siqueira@amd.com, alexander.deucher@amd.com, christian.koenig@amd.com, airlied@gmail.com, jun.lei@amd.com, Alvin.Lee2@amd.com, Nevenko.Stupar@amd.com, samson.tam@amd.com Cc: rdunlap@infradead.org, David.Galiffi@amd.com, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH] drm/amd/display: replace ternary operator with max() X-Priority: 3 X-Mailer: Coremail Webmail Server Version XT6.0.1 build 20210329(c53f3fee) Copyright (c) 2002-2022 www.mailtech.cn mispb-4e503810-ca60-4ec8-a188-7102c18937cf-zhkzyfz.cn MIME-Version: 1.0 Message-ID: <20f55cfc.42.1842475135f.Coremail.wangkailong@jari.cn> X-Coremail-Locale: zh_CN X-CM-TRANSID: AQAAfwB3jOITTV1jjuIAAA--.21W X-CM-SenderInfo: 5zdqwypdlo00nj6mt2flof0/1tbiAQAOB2FEYx0BKAAHs9 X-Coremail-Antispam: 1Ur529EdanIXcx71UUUUU7IcSsGvfJ3iIAIbVAYjsxI4VWxJw CS07vEb4IE77IF4wCS07vE1I0E4x80FVAKz4kxMIAIbVAFxVCaYxvI4VCIwcAKzIAtYxBI daVFxhVjvjDU= X-Spam-Status: No, score=2.2 required=5.0 tests=BAYES_00,RCVD_IN_PBL,RDNS_NONE, T_SPF_HELO_PERMERROR,T_SPF_PERMERROR,XPRIO autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748036273054901805?= X-GMAIL-MSGID: =?utf-8?q?1748039185789079078?= Fix the following coccicheck warning: drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c:887:49-50: WARNING opportunity for max() drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c:978:42-43: WARNING opportunity for max() Signed-off-by: KaiLong Wang --- drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c b/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c index b6cd10f3181c..5fdbbdca97e0 100644 --- a/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c +++ b/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c @@ -884,7 +884,7 @@ static bool subvp_drr_schedulable(struct dc *dc, struct dc_state *context, struc stretched_drr_us = drr_frame_us + mall_region_us + SUBVP_DRR_MARGIN_US; drr_stretched_vblank_us = (drr_timing->v_total - drr_timing->v_addressable) * drr_timing->h_total / (double)(drr_timing->pix_clk_100hz * 100) * 1000000 + (stretched_drr_us - drr_frame_us); - max_vblank_mallregion = drr_stretched_vblank_us > mall_region_us ? drr_stretched_vblank_us : mall_region_us; + max_vblank_mallregion = max(drr_stretched_vblank_us, mall_region_us); /* We consider SubVP + DRR schedulable if the stretched frame duration of the DRR display (i.e. the * highest refresh rate + margin that can support UCLK P-State switch) passes the static analysis @@ -975,7 +975,7 @@ static bool subvp_vblank_schedulable(struct dc *dc, struct dc_state *context) (double)(vblank_timing->pix_clk_100hz * 100) * 1000000; subvp_active_us = main_timing->v_addressable * main_timing->h_total / (double)(main_timing->pix_clk_100hz * 100) * 1000000; - max_vblank_mallregion = vblank_blank_us > mall_region_us ? vblank_blank_us : mall_region_us; + max_vblank_mallregion = max(vblank_blank_us, mall_region_us); // Schedulable if VACTIVE region of the SubVP pipe can fit the MALL prefetch, VBLANK frame time, // and the max of (VBLANK blanking time, MALL region)