aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2017-11-02 12:26:43 +0100
committerAlex Deucher <alexander.deucher@amd.com>2017-11-02 13:44:41 -0400
commit1f3493faa8d73b0332d46ea79448b10b66fb1af0 (patch)
treefbc71d3e54f0c823a6032727a303a47ffe1fe8b6 /drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
parentdrm/amdgpu/display: remove unused REG_OFFSET macro (diff)
downloadlinux-dev-1f3493faa8d73b0332d46ea79448b10b66fb1af0.tar.xz
linux-dev-1f3493faa8d73b0332d46ea79448b10b66fb1af0.zip
drm/amdgpu/display: fix integer arithmetic problem
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. Reviewed-by: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c')
-rw-r--r--drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c2
1 files changed, 1 insertions, 1 deletions
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));