public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
To: Jiri Slaby <jirislaby@gmail.com>
Cc: akpm@linux-foundation.org, andi@firstfloor.org,
	rpjday@crashcourse.ca, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] VIDEO: console, use DIV_ROUND_UP
Date: Mon, 17 Aug 2009 11:08:53 +0300	[thread overview]
Message-ID: <20090817080853.GC2967@localdomain.by> (raw)
In-Reply-To: <4A890E33.2080302@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 691 bytes --]

On (08/17/09 10:00), Jiri Slaby wrote:
> 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;
> 
> ?
> 
Oops, silly me. Somehow I thought about
DIV_ROUND_UP((vc->vc_font.width + 7) , 8). My fault. Sorry.

> #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?
Right.

> 
> > Are you sure we really can use DIV_ROUND_UP?
> 
> Yeah, pretty sure.
> 
OK.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 315 bytes --]

  reply	other threads:[~2009-08-17  8:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-15 13:43 [PATCH] Make shr to divide by power of 2 (resend) Sergey Senozhatsky
2009-08-15 13:48 ` Jiri Slaby
2009-08-15 13:49   ` Robert P. J. Day
2009-08-15 14:12     ` Sergey Senozhatsky
2009-08-15 20:42       ` Jiri Slaby
2009-08-16  9:14         ` Sergey Senozhatsky
2009-08-17  7:15           ` Jiri Slaby
2009-08-17  7:31             ` Sergey Senozhatsky
2009-08-17  7:48               ` [PATCH 1/1] VIDEO: console, use DIV_ROUND_UP Jiri Slaby
2009-08-17  8:00                 ` Sergey Senozhatsky
2009-08-17  8:00                   ` Jiri Slaby
2009-08-17  8:08                     ` Sergey Senozhatsky [this message]
2009-08-17  8:11                       ` Jiri Slaby
2009-08-15 14:26     ` [PATCH] Make shr to divide by power of 2 (resend) Sergey Senozhatsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090817080853.GC2967@localdomain.by \
    --to=sergey.senozhatsky@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=jirislaby@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rpjday@crashcourse.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox