Skip to content
  • Andrew Morton's avatar
    [PATCH] roundup_pow_of_two() 64-bit fix · 962749af
    Andrew Morton authored
    
    
    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: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    962749af