lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 7 Jul 2022 16:38:10 -0400
From:   Harry Wentland <harry.wentland@....com>
To:     Alex Deucher <alexdeucher@...il.com>,
        Zhongjun Tan <hbut_tan@....com>
Cc:     "Leo (Sunpeng) Li" <sunpeng.li@....com>,
        "Siqueira, Rodrigo" <Rodrigo.Siqueira@....com>,
        "Deucher, Alexander" <alexander.deucher@....com>,
        Christian Koenig <christian.koenig@....com>,
        xinhui pan <Xinhui.Pan@....com>,
        Dave Airlie <airlied@...ux.ie>,
        Daniel Vetter <daniel@...ll.ch>,
        Bas Nieuwenhuizen <bas@...nieuwenhuizen.nl>,
        cai.huoqing@...ux.dev, Zhongjun Tan <tanzhongjun@...lpad.com>,
        Maling list - DRI developers 
        <dri-devel@...ts.freedesktop.org>,
        amd-gfx list <amd-gfx@...ts.freedesktop.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] drm/amd/display: Fix unsigned expression compared with
 zero



On 2022-07-07 14:22, Alex Deucher wrote:
> On Wed, Jul 6, 2022 at 3:41 AM Zhongjun Tan <hbut_tan@....com> wrote:
>>
>> From: Zhongjun Tan <tanzhongjun@...lpad.com>
>>
>> Fix unsigned expression compared with zero
>>
>> Signed-off-by: Zhongjun Tan <tanzhongjun@...lpad.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
>>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ