From d1a0945f8412ab52ad523397d82be61ba835ae27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Thu, 22 Jun 2017 13:04:16 +0200 Subject: console: use DIV_ROUND_UP MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I used the clang-tidy qemu-round check to generate the fix: https://github.com/elmarco/clang-tools-extra Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- include/ui/console.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/ui/console.h b/include/ui/console.h index 7262bef6d3..8024878bae 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -328,7 +328,7 @@ static inline int surface_bits_per_pixel(DisplaySurface *s) static inline int surface_bytes_per_pixel(DisplaySurface *s) { int bits = PIXMAN_FORMAT_BPP(s->format); - return (bits + 7) / 8; + return DIV_ROUND_UP(bits, 8); } static inline pixman_format_code_t surface_format(DisplaySurface *s) -- cgit v1.2.1