[PATCH] drm/mgag200/mgag200_mode.c: fix wrong do_div() usage

Nicolas Pitre nicolas.pitre at linaro.org
Wed Nov 4 12:25:58 PST 2015


do_div() is meant to be used with an unsigned dividend.

Signed-off-by: Nicolas Pitre <nico at linaro.org>

diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c
index c99d3fe128..1d4c480f5c 100644
--- a/drivers/gpu/drm/mgag200/mgag200_mode.c
+++ b/drivers/gpu/drm/mgag200/mgag200_mode.c
@@ -1564,7 +1564,7 @@ static uint32_t mga_vga_calculate_mode_bandwidth(struct drm_display_mode *mode,
 							int bits_per_pixel)
 {
 	uint32_t total_area, divisor;
-	int64_t active_area, pixels_per_second, bandwidth;
+	uint64_t active_area, pixels_per_second, bandwidth;
 	uint64_t bytes_per_pixel = (bits_per_pixel + 7) / 8;
 
 	divisor = 1024;


More information about the dri-devel mailing list