diff -uprN -X linux-2.6.19-vanilla/Documentation/dontdiff linux-2.6.19-vanilla/include/linux/power_of_2.h linux-2.6.19-changed/include/linux/power_of_2.h --- linux-2.6.19-vanilla/include/linux/power_of_2.h 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.19-changed/include/linux/power_of_2.h 2007-01-10 12:42:03.000000000 +0100 @@ -0,0 +1,20 @@ +static inline bool is_power_of_2(int i) +{ + return i > 0 && (i & (i - 1)) == 0; +} + +static inline int round_up_to_power_of_2(int i) +{ + while ((i & (i - 1)) != 0) + i += i & ~(i - 1); + + return i; +} + +static inline int round_down_to_power_of_2(int i) +{ + while (i & (i - 1)) + i &= (i - 1); + + return i; +}