From bb7443f6d6f09411ea10f06e6cb0d416bd1ccebd Mon Sep 17 00:00:00 2001 From: Radim Krčmář Date: Tue, 17 Feb 2015 17:30:52 +0100 Subject: qxl: refactor rounding up to a nearest power of 2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ář Signed-off-by: Gerd Hoffmann --- include/qemu-common.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/qemu-common.h') diff --git a/include/qemu-common.h b/include/qemu-common.h index 644b46dcdd..1b5cffb403 100644 --- a/include/qemu-common.h +++ b/include/qemu-common.h @@ -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" /* -- cgit 1.4.1