qxl: refactor rounding up to a nearest power of 2

We already have pow2floor, mirror it and use instead of a function with
similar results (same in used domain), to clarify our intent.

Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Radim Krčmář 2015-02-17 17:30:52 +01:00 committed by Gerd Hoffmann
parent 876d516311
commit bb7443f6d6
3 changed files with 22 additions and 18 deletions

View file

@ -418,6 +418,9 @@ static inline bool is_power_of_2(uint64_t value)
/* round down to the nearest power of 2*/
int64_t pow2floor(int64_t value);
/* round up to the nearest power of 2 (0 if overflow) */
uint64_t pow2ceil(uint64_t value);
#include "qemu/module.h"
/*