From c859510b4d03030f5c4f4b6b6bd7e77d45902f2e 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-fix move get_count_order[_long] definitions to pick up fls_long() Cc: zijun_hu Signed-off-by: Andrew Morton --- include/linux/bitops.h | 52 +++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/include/linux/bitops.h b/include/linux/bitops.h index b11c480041ef..6f202c8fe4a6 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h @@ -65,32 +65,6 @@ static inline int get_bitmask_order(unsigned int count) return order; /* We could be slightly more clever with -1 here... */ } -static inline int get_count_order(unsigned int count) -{ - int order; - - order = fls(count) - 1; - if (count & (count - 1)) - order++; - 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); @@ -259,6 +233,32 @@ static inline unsigned long __ffs64(u64 word) }) #endif +static inline int get_count_order(unsigned int count) +{ + int order; + + order = fls(count) - 1; + if (count & (count - 1)) + order++; + 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; +} + #ifndef find_last_bit /** * find_last_bit - find the last set bit in a memory region -- 2.34.1