mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yu Jiaoliang <yujiaoliang@vivo.com>
To: Harry Wentland <harry.wentland@amd.com>,
	Leo Li <sunpeng.li@amd.com>,
	Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>,
	Xinhui Pan <Xinhui.Pan@amd.com>, David Airlie <airlied@gmail.com>,
	Daniel Vetter <daniel@ffwll.ch>,
	Hamza Mahfooz <hamza.mahfooz@amd.com>,
	Alex Hung <alex.hung@amd.com>,
	Dillon Varone <dillon.varone@amd.com>,
	amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Cc: opensource.kernel@vivo.com
Subject: [PATCH v1 3/6] drm/amd/display: Use max/min macro
Date: Thu, 22 Aug 2024 14:57:20 +0800	[thread overview]
Message-ID: <20240822065723.1336181-4-yujiaoliang@vivo.com> (raw)
In-Reply-To: <20240822065723.1336181-1-yujiaoliang@vivo.com>

 Use the macro instead of ternary operator.

Signed-off-by: Yu Jiaoliang <yujiaoliang@vivo.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
index b38340c690c6..5d40f61261ad 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
@@ -797,9 +797,9 @@ static struct rect intersect_rec(const struct rect *r0, const struct rect *r1)
 	int r0_y_end = r0->y + r0->height;
 	int r1_y_end = r1->y + r1->height;
 
-	rec.x = r0->x > r1->x ? r0->x : r1->x;
+	rec.x = max(r0->x, r1->x);
 	rec.width = r0_x_end > r1_x_end ? r1_x_end - rec.x : r0_x_end - rec.x;
-	rec.y = r0->y > r1->y ? r0->y : r1->y;
+	rec.y = max(r0->y, r1->y);
 	rec.height = r0_y_end > r1_y_end ? r1_y_end - rec.y : r0_y_end - rec.y;
 
 	/* in case that there is no intersection */
-- 
2.34.1


  parent reply	other threads:[~2024-08-22  6:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-22  6:57 [PATCH v1 0/6] " Yu Jiaoliang
2024-08-22  6:57 ` [PATCH v1 1/6] " Yu Jiaoliang
2024-08-22  6:57 ` [PATCH v1 2/6] " Yu Jiaoliang
2024-08-22  6:57 ` Yu Jiaoliang [this message]
2024-08-22  6:57 ` [PATCH v1 4/6] " Yu Jiaoliang
2024-08-22  6:57 ` [PATCH v1 5/6] " Yu Jiaoliang
2024-08-22  6:57 ` [PATCH v1 6/6] " Yu Jiaoliang
2024-08-22  9:45 ` [PATCH v1 0/6] " 于佼良
2024-08-22 18:34 ` Alex Deucher
  -- strict thread matches above, loose matches on Subject: below --
2024-08-22  6:54 Yu Jiaoliang
2024-08-22  6:54 ` [PATCH v1 3/6] " Yu Jiaoliang
2024-08-22  6:51 [PATCH v1 0/6] " Yu Jiaoliang
2024-08-22  6:51 ` [PATCH v1 3/6] " Yu Jiaoliang
2024-08-22  6:29 [PATCH v1 0/6] " Yu Jiaoliang
2024-08-22  6:29 ` [PATCH v1 3/6] " Yu Jiaoliang

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=20240822065723.1336181-4-yujiaoliang@vivo.com \
    --to=yujiaoliang@vivo.com \
    --cc=Rodrigo.Siqueira@amd.com \
    --cc=Xinhui.Pan@amd.com \
    --cc=airlied@gmail.com \
    --cc=alex.hung@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=daniel@ffwll.ch \
    --cc=dillon.varone@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hamza.mahfooz@amd.com \
    --cc=harry.wentland@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=opensource.kernel@vivo.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®