lkml.org 
[lkml]   [2009]   [Aug]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/1] VIDEO: console, use DIV_ROUND_UP
On 08/17/2009 10:00 AM, Sergey Senozhatsky wrote:
> So... In general, ((vc->vc_font.width + 7) >> 3) == DIV_ROUND_UP(vc->vc_font.width, 8) - 1;

?

#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))

DIV_ROUND_UP(vc->vc_font.width, 8) expands to:
(((vc->vc_font.width) + (8) - 1) / (8))
which is pretty printed:
(vc->vc_font.width + 7) / 8
and that's equivalent to:
(vc->vc_font.width + 7) >> 3

Correct?

> Are you sure we really can use DIV_ROUND_UP?

Yeah, pretty sure.


\
 
 \ /
  Last update: 2009-08-17 10:03    [W:0.035 / U:0.336 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site