aboutsummaryrefslogtreecommitdiff
path: root/ui/spice-display.c
diff options
context:
space:
mode:
authorLaurent Vivier <lvivier@redhat.com>2016-05-31 18:35:58 +0200
committerMichael Tokarev <mjt@tls.msk.ru>2016-06-07 18:19:25 +0300
commit5d61cafd0b1c77e154a9777c07b675f840d7fbd7 (patch)
treeef01ac6d2b3529cfad6d4474da5afb79d6fa41d8 /ui/spice-display.c
parentb988a650b16a074bc3727fcb20591f50e29ceca9 (diff)
downloadqemu-5d61cafd0b1c77e154a9777c07b675f840d7fbd7.zip
qemu-5d61cafd0b1c77e154a9777c07b675f840d7fbd7.tar.gz
qemu-5d61cafd0b1c77e154a9777c07b675f840d7fbd7.tar.bz2
SPICE: Use DIV_ROUND_UP
Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d). This patch is the result of coccinelle script scripts/coccinelle/round.cocci CC: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Laurent Vivier <lvivier@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'ui/spice-display.c')
-rw-r--r--ui/spice-display.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ui/spice-display.c b/ui/spice-display.c
index 0553c5e..34095fb 100644
--- a/ui/spice-display.c
+++ b/ui/spice-display.c
@@ -197,7 +197,7 @@ static void qemu_spice_create_one_update(SimpleSpiceDisplay *ssd,
static void qemu_spice_create_update(SimpleSpiceDisplay *ssd)
{
static const int blksize = 32;
- int blocks = (surface_width(ssd->ds) + blksize - 1) / blksize;
+ int blocks = DIV_ROUND_UP(surface_width(ssd->ds), blksize);
int dirty_top[blocks];
int y, yoff1, yoff2, x, xoff, blk, bw;
int bpp = surface_bytes_per_pixel(ssd->ds);