mm-vmalloc-fix-align-value-calculation-error-fix
authorAndrew Morton <akpm@linux-foundation.org>
Sat, 10 Sep 2016 10:34:02 +0000 (20:34 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Sat, 10 Sep 2016 10:34:02 +0000 (20:34 +1000)
s/get_order_long()/get_count_order_long()/ to match get_count_order()

Cc: David Rientjes <rientjes@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Tejun Heo <tj@kernel.org>
Cc: zijun_hu <zijun_hu@htc.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/bitops.h
mm/vmalloc.c

index c18448de2c574531cb34868800b488b20228ef77..711d12dcda2f8aa682f17c4f8ed6f18fc324117a 100644 (file)
@@ -75,6 +75,23 @@ 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
+ *
+ * The same as get_count_order() but accepts a long type parameter
+ * or 0 is returned if @l == 0UL
+ */
+static inline int get_count_order_long(unsigned long l)
+{
+       if (l == 0UL)
+               return 0;
+       else if (l & (l - 1UL))
+               return fls_long(l);
+       else
+               return fls_long(l) - 1;
+}
+
 static __always_inline unsigned long hweight_long(unsigned long w)
 {
        return sizeof(w) == 4 ? hweight32(w) : hweight64(w);
@@ -191,23 +208,6 @@ static inline unsigned fls_long(unsigned long l)
        return fls64(l);
 }
 
-/**
- * get_order_long - get order after rounding @l up to power of 2
- * @l: parameter
- *
- * it is same as get_count_order() but long type parameter
- * or 0 is returned if @l == 0UL
- */
-static inline int get_order_long(unsigned long l)
-{
-       if (l == 0UL)
-               return 0;
-       else if (l & (l - 1UL))
-               return fls_long(l);
-       else
-               return fls_long(l) - 1;
-}
-
 /**
  * __ffs64 - find first set bit in a 64 bit word
  * @word: The 64 bit word
index 7d717f3eb2884bdaf1dc7bdbe9868a87e4255e6b..08032de13ebefde27b9dccecc15c290cb620f36f 100644 (file)
@@ -1360,7 +1360,7 @@ static struct vm_struct *__get_vm_area_node(unsigned long size,
 
        BUG_ON(in_interrupt());
        if (flags & VM_IOREMAP)
-               align = 1ul << clamp_t(int, get_order_long(size),
+               align = 1ul << clamp_t(int, get_count_order_long(size),
                                       PAGE_SHIFT, IOREMAP_MAX_ORDER);
 
        size = PAGE_ALIGN(size);
This page took 0.026636 seconds and 5 git commands to generate.