[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0eb751e9-5b52-a513-e597-25e9542b754d@amd.com>
Date: Thu, 2 Nov 2017 10:02:28 -0400
From: Harry Wentland <harry.wentland@....com>
To: Arnd Bergmann <arnd@...db.de>,
Alex Deucher <alexander.deucher@....com>,
Christian König <christian.koenig@....com>
Cc: David Airlie <airlied@...ux.ie>, Tony Cheng <tony.cheng@....com>,
Dmytro Laktyushkin <Dmytro.Laktyushkin@....com>,
Joshua Aberback <Joshua.Aberback@....com>,
"Leo (Sunpeng) Li" <sunpeng.li@....com>,
amd-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/3] drm/amdgpu/display: fix integer arithmetic problem
On 2017-11-02 07:26 AM, Arnd Bergmann wrote:
> gcc warns about an ambiguous integer calculation:
>
> drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c: In function 'calculate_bandwidth':
> drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c:534:5: error: this decimal constant is unsigned only in ISO C90 [-Werror]
> data->lb_line_pitch = bw_ceil2(bw_mul(bw_div(bw_frc_to_fixed(2401171875, 100000000), bw_int_to_fixed(3)), bw_ceil2(data->source_width_in_lb, bw_int_to_fixed(8))), bw_int_to_fixed(48));
> ^~~~
>
> Marking the constant as explicitly unsigned makes it work fine everywhere
> without warnings.
>
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
Thanks for these fixes.
Series is
Reviewed-by: Harry Wentland <harry.wentland@....com>
Harry
> ---
> drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
> index 15cbfc400633..4f8a95368ffc 100644
> --- a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
> +++ b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
> @@ -531,7 +531,7 @@ static void calculate_bandwidth(
> }
> switch (data->lb_bpc[i]) {
> case 8:
> - data->lb_line_pitch = bw_ceil2(bw_mul(bw_div(bw_frc_to_fixed(2401171875, 100000000), bw_int_to_fixed(3)), bw_ceil2(data->source_width_in_lb, bw_int_to_fixed(8))), bw_int_to_fixed(48));
> + data->lb_line_pitch = bw_ceil2(bw_mul(bw_div(bw_frc_to_fixed(2401171875ul, 100000000), bw_int_to_fixed(3)), bw_ceil2(data->source_width_in_lb, bw_int_to_fixed(8))), bw_int_to_fixed(48));
> break;
> case 10:
> data->lb_line_pitch = bw_ceil2(bw_mul(bw_div(bw_frc_to_fixed(300234375, 10000000), bw_int_to_fixed(3)), bw_ceil2(data->source_width_in_lb, bw_int_to_fixed(8))), bw_int_to_fixed(48));
>
Powered by blists - more mailing lists