lkml.org 
[lkml]   [2010]   [Jan]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 24/38] move round_up/down to kernel.h
    On Fri, 22 Jan 2010, Yinghai Lu wrote:

    > +#define __round_mask(x,y) ((__typeof__(x))((y)-1))
    > +#define round_up(x,y) ((((x)-1) | __round_mask(x,y))+1)
    > +#define round_down(x,y) ((x) & ~__round_mask(x,y))

    s/round/round_power2/


    > #define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f))
    > #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
    > #define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))

    Also some uppercase/lowercase mess.



    \
     
     \ /
      Last update: 2010-01-22 15:55    [W:4.174 / U:0.060 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site