aboutsummaryrefslogtreecommitdiff
path: root/hw/display/vga.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2017-06-22 13:04:16 +0200
committerMarc-André Lureau <marcandre.lureau@redhat.com>2017-08-31 12:29:07 +0200
commit2c23ce22c611a0cdddf9e7fdd3e8144da74744b5 (patch)
tree48e5afd3d430655db45dd7f06340c2e8484cdffe /hw/display/vga.c
parent935b3332f5df80f8adf7c6965ef799185eccc825 (diff)
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 <marcandre.lureau@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'hw/display/vga.c')
-rw-r--r--hw/display/vga.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/display/vga.c b/hw/display/vga.c
index 63421f9ee8..3433102ef3 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);