From 70896b6334122e270da1c7d26010ccf174ae1777 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Sat, 10 Sep 2016 20:34:03 +1000 Subject: [PATCH] mm-vmalloc-fix-align-value-calculation-error-v2-fix locate get_count_order_long() next to get_count_order() Cc: zijun_hu Signed-off-by: Andrew Morton --- include/linux/bitops.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/include/linux/bitops.h b/include/linux/bitops.h index 93a07d1827c6..b11c480041ef 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h @@ -75,6 +75,22 @@ static inline int get_count_order(unsigned int count) return order; } +/** + * get_count_order_long - get order after rounding @l up to power of 2 + * @l: parameter + * + * it is same as get_count_order() but with long type parameter + */ +static inline int get_count_order_long(unsigned long l) +{ + if (l == 0UL) + return -1; + else if (l & (l - 1UL)) + return (int)fls_long(l); + else + return (int)fls_long(l) - 1; +} + static __always_inline unsigned long hweight_long(unsigned long w) { return sizeof(w) == 4 ? hweight32(w) : hweight64(w); @@ -191,22 +207,6 @@ static inline unsigned fls_long(unsigned long l) return fls64(l); } -/** - * get_count_order_long - get order after rounding @l up to power of 2 - * @l: parameter - * - * it is same as get_count_order() but with long type parameter - */ -static inline int get_count_order_long(unsigned long l) -{ - if (l == 0UL) - return -1; - else if (l & (l - 1UL)) - return (int)fls_long(l); - else - return (int)fls_long(l) - 1; -} - /** * __ffs64 - find first set bit in a 64 bit word * @word: The 64 bit word -- 2.34.1