--- a/include/linux/bitops.h~bitops-simplify-get_count_order_long +++ a/include/linux/bitops.h @@ -206,10 +206,7 @@ static inline int get_count_order_long(u { if (l == 0UL) return -1; - else if (l & (l - 1UL)) - return (int)fls_long(l); - else - return (int)fls_long(l) - 1; + return (int)fls_long(--l); } /**