]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
console: use DIV_ROUND_UP
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Thu, 22 Jun 2017 11:04:16 +0000 (13:04 +0200)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Thu, 31 Aug 2017 10:29:07 +0000 (12:29 +0200)
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 <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
include/ui/console.h

index 7262bef6d334cadfb530f1bcbce2896d0fda6fa2..8024878baea0a5be95ac12c1183f1aa1ef782d41 100644 (file)
@@ -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)