Skip to content

Commit

Permalink
console: use DIV_ROUND_UP
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
elmarco committed Aug 31, 2017
1 parent 69db8df commit d1a0945
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/ui/console.h
Expand Up @@ -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)
Expand Down

0 comments on commit d1a0945

Please sign in to comment.