mm-vmalloc-fix-align-value-calculation-error-v2-fix-fix
authorAndrew Morton <akpm@linux-foundation.org>
Sat, 10 Sep 2016 10:34:03 +0000 (20:34 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Sat, 10 Sep 2016 10:34:03 +0000 (20:34 +1000)
move get_count_order[_long] definitions to pick up fls_long()

Cc: zijun_hu <zijun_hu@htc.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/bitops.h

index b11c480041efb7f7fc0130eb604d99e99b7de5f0..6f202c8fe4a6956d328aeb7513e574f3b426a676 100644 (file)
@@ -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
This page took 0.028199 seconds and 5 git commands to generate.