[openib-general] Re: [git patch review 2/7] IB/mthca: correct log2 calculation

Michael S. Tsirkin mst at mellanox.co.il
Sat Dec 17 13:30:30 PST 2005


Quoting r. Andrew Morton <akpm at osdl.org>:
> Subject: Re: [git patch review 2/7] IB/mthca: correct log2 calculation
> 
> Roland Dreier <rolandd at cisco.com> wrote:
> >
> > Fix thinko in rd_atomic calculation: ffs(x) - 1 does not find the next
> > power of 2 -- it should be fls(x - 1).
> 
> Please use round_up_pow_of_two().

Yes, but we want the bit number. roundup_pow_of_two does a shift.

-- 
MST



More information about the general mailing list