mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
Use VIR_DIV_UP macro where possible
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
789bdd7dea
commit
d772a70faa
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user