lkml.org 
[lkml]   [2008]   [Jul]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 0/5] x86 cleanup: convert round_up() to roundup()

* Yinghai Lu <yhlu.kernel@gmail.com> wrote:

> On Sat, Jul 26, 2008 at 6:39 AM, Ingo Molnar <mingo@elte.hu> wrote:
> >
> > * Joerg Roedel <joerg.roedel@amd.com> wrote:
> >
> >> The x86 architecture declares its own round_up macro. But there is a
> >> generic one in <linux/kernel.h> which can also be used. This patchset
> >> replaces the x86 round_up() macro with the generic roundup() one where
> >> possible. The patches have been compile-tested for 32 and 64 bit and
> >> boot-tested for 64 bit. If we can fix the other places too we can get
> >> rid of the x86 specific round_up() in the future.
> >
> > applied to tip/x86/cleanups - thanks Joerg!
> >
> these patches looks like some backward, aka wrong direction.
>
> #define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
>
> #define round_up(x, y) (((x) + (y) - 1) & ~((y) - 1))
> #define round_down(x, y) ((x) & ~((y) - 1))
>
> round_up looks more efficient.

hm, does it ever make a difference to the compiled output?

Ingo


\
 
 \ /
  Last update: 2008-07-29 09:19    [W:0.052 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site