From: Marc-André Lureau Date: Thu, 22 Jun 2017 11:04:16 +0000 (+0200) Subject: vga: use DIV_ROUND_UP X-Git-Tag: v2.11.0-rc0~141^2~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2c23ce22c611a0cdddf9e7fdd3e8144da74744b5;p=thirdparty%2Fqemu.git vga: use DIV_ROUND_UP I used the clang-tidy qemu-round check to generate the fix: https://github.com/elmarco/clang-tools-extra Signed-off-by: Marc-André Lureau Reviewed-by: Richard Henderson --- diff --git a/hw/display/vga.c b/hw/display/vga.c index 63421f9ee85..3433102ef3b 100644 --- a/hw/display/vga.c +++ b/hw/display/vga.c @@ -1621,7 +1621,7 @@ static void vga_draw_graphic(VGACommonState *s, int full_update) s->line_compare, sr(s, VGA_SEQ_CLOCK_MODE)); #endif addr1 = (s->start_addr * 4); - bwidth = (width * bits + 7) / 8; + bwidth = DIV_ROUND_UP(width * bits, 8); y_start = -1; d = surface_data(surface); linesize = surface_stride(surface);