Use VIR_DIV_UP macro where possible

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
Martin Kletzander 2015-08-24 15:54:26 +02:00
parent 789bdd7dea
commit d772a70faa
2 changed files with 2 additions and 2 deletions

View File

@ -279,7 +279,7 @@ int virNetClientStreamQueuePacket(virNetClientStreamPtr st,
goto end;
}
pieces = (length + size - 1) / size;
pieces = VIR_DIV_UP(length, size);
for (piece = 0; piece < pieces; piece++) {
if (size > length - offset)
size = length - offset;

View File

@ -71,7 +71,7 @@ virBitmapNewQuiet(size_t size)
if (SIZE_MAX - VIR_BITMAP_BITS_PER_UNIT < size || size == 0)
return NULL;
sz = (size + VIR_BITMAP_BITS_PER_UNIT - 1) / VIR_BITMAP_BITS_PER_UNIT;
sz = VIR_DIV_UP(size, VIR_BITMAP_BITS_PER_UNIT);
if (VIR_ALLOC_QUIET(bitmap) < 0)
return NULL;