mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-28 21:03:54 -06:00
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:
parent
876d516311
commit
bb7443f6d6
3 changed files with 22 additions and 18 deletions
|
@ -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"
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue