From: Harry Wentland <harry.wentland@amd.com>
To: Alex Deucher <alexdeucher@gmail.com>, Zhongjun Tan <hbut_tan@163.com>
Cc: "Leo (Sunpeng) Li" <sunpeng.li@amd.com>,
"Siqueira, Rodrigo" <Rodrigo.Siqueira@amd.com>,
"Deucher, Alexander" <alexander.deucher@amd.com>,
Christian Koenig <christian.koenig@amd.com>,
xinhui pan <Xinhui.Pan@amd.com>, Dave Airlie <airlied@linux.ie>,
Daniel Vetter <daniel@ffwll.ch>,
Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>,
cai.huoqing@linux.dev, Zhongjun Tan <tanzhongjun@coolpad.com>,
Maling list - DRI developers <dri-devel@lists.freedesktop.org>,
amd-gfx list <amd-gfx@lists.freedesktop.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drm/amd/display: Fix unsigned expression compared with zero
Date: Thu, 7 Jul 2022 16:38:10 -0400 [thread overview]
Message-ID: <51186366-a040-f99d-f43b-bb6ac771f20d@amd.com> (raw)
In-Reply-To: <CADnq5_NpXcua54cSeSGaG2X_afcvoGswKgSb=Gysr5gpoT0AHw@mail.gmail.com>
On 2022-07-07 14:22, Alex Deucher wrote:
> On Wed, Jul 6, 2022 at 3:41 AM Zhongjun Tan <hbut_tan@163.com> wrote:
>>
>> From: Zhongjun Tan <tanzhongjun@coolpad.com>
>>
>> Fix unsigned expression compared with zero
>>
>> Signed-off-by: Zhongjun Tan <tanzhongjun@coolpad.com>
>> ---
>> .../gpu/drm/amd/display/dc/dml/dcn20/display_rq_dlg_calc_20.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_rq_dlg_calc_20.c b/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_rq_dlg_calc_20.c
>> index 548cdef8a8ad..21e4af38b8c1 100644
>> --- a/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_rq_dlg_calc_20.c
>> +++ b/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_rq_dlg_calc_20.c
>> @@ -244,8 +244,8 @@ static void handle_det_buf_split(struct display_mode_lib *mode_lib,
>> bool req128_c = false;
>> bool surf_linear = (pipe_src_param->sw_mode == dm_sw_linear);
>> bool surf_vert = (pipe_src_param->source_scan == dm_vert);
>> - unsigned int log2_swath_height_l = 0;
>> - unsigned int log2_swath_height_c = 0;
>> + int log2_swath_height_l = 0;
>> + int log2_swath_height_c = 0;
>
> @Wentland, Harry Can you comment on the required range needed for
> these integers? Maybe it would be better to just drop the comparisons
> with 0.
>
I'm not sure I see the problem we're trying to fix.
An unsigned int can be 0, so a x != 0 or x > 0 check
is still a valid check.
Harry
> Alex
>
>> unsigned int detile_buf_size_in_bytes = mode_lib->ip.det_buffer_size_kbytes * 1024;
>>
>> full_swath_bytes_packed_l = rq_param->misc.rq_l.full_swath_bytes;
>> --
>> 2.29.0
>>
next prev parent reply other threads:[~2022-07-07 20:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-06 6:39 Zhongjun Tan
2022-07-07 18:22 ` Alex Deucher
2022-07-07 20:38 ` Harry Wentland [this message]
2022-07-07 20:45 ` Alex Deucher
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=51186366-a040-f99d-f43b-bb6ac771f20d@amd.com \
--to=harry.wentland@amd.com \
--cc=Rodrigo.Siqueira@amd.com \
--cc=Xinhui.Pan@amd.com \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=alexdeucher@gmail.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=bas@basnieuwenhuizen.nl \
--cc=cai.huoqing@linux.dev \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=hbut_tan@163.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sunpeng.li@amd.com \
--cc=tanzhongjun@coolpad.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®