bitops.h: move out get_count_order[_long]() from __KERNEL__ scope
authorzijun_hu <zijun_hu@htc.com>
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 out get_count_order[_long]() definitions from scope limited by macro
__KERNEL__

it not only make both functions available in wider region regardless of
whether __KERNEL__ is defined but also keep original region for
get_count_order() before the recent commit c513b4cd2fe9
("mm-vmalloc-fix-align-value-calculation-error-v2-fix-fix")

Link: http://lkml.kernel.org/r/57B2C4CE.80303@zoho.com
Signed-off-by: zijun_hu <zijun_hu@htc.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/bitops.h

index 6f202c8fe4a6956d328aeb7513e574f3b426a676..a83c822c35c2424095b512dd04f95609cadfdaa0 100644 (file)
@@ -181,6 +181,32 @@ static inline unsigned fls_long(unsigned long l)
        return fls64(l);
 }
 
+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;
+}
+
 /**
  * __ffs64 - find first set bit in a 64 bit word
  * @word: The 64 bit word
@@ -233,32 +259,6 @@ 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.026118 seconds and 5 git commands to generate.