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()
Date: Sat, 29 Oct 2022 23:56:03 +0800 (GMT+08:00) [thread overview]
Message-ID: <20f55cfc.42.1842475135f.Coremail.wangkailong@jari.cn> (raw)
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 <wangkailong@jari.cn>
---
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)
--
2.25.1
next reply other threads:[~2022-10-29 16:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-29 15:56 wangkailong [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-10-29 15:19 wangkailong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20f55cfc.42.1842475135f.Coremail.wangkailong@jari.cn \
--to=wangkailong@jari.cn \
--cc=Alvin.Lee2@amd.com \
--cc=David.Galiffi@amd.com \
--cc=Nevenko.Stupar@amd.com \
--cc=Rodrigo.Siqueira@amd.com \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=harry.wentland@amd.com \
--cc=jun.lei@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rdunlap@infradead.org \
--cc=samson.tam@amd.com \
--cc=sunpeng.li@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®