• A
    [PATCH] roundup_pow_of_two() 64-bit fix · 962749af
    Andrew Morton 提交于
    fls() takes an integer, so roundup_pow_of_two() is busted for ulongs larger
    than 2^32-1.
    
    Fix this by implementing and using fls_long().
    
    (Why does roundup_pow_of_two() return a long?)
    
    (Why is roundup_pow_of_two() __attribute_const__ whereas long_log2() is
    __attribute_pure__?)
    
    (Why does long_log2() suck so much?  Because we were missing fls_long()?)
    
    Cc: Roland Dreier <rdreier@cisco.com>
    Cc: "Chen, Kenneth W" <kenneth.w.chen@intel.com>
    Cc: John Hawkes <hawkes@sgi.com>
    Signed-off-by: NAndrew Morton <akpm@osdl.org>
    Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
    962749af
bitops.h 3.7 KB