On Fri, Feb 07, 2020 at 12:34:02PM +0100, Uwe Kleine-König wrote: > On 2/7/20 9:29 AM, Martin KaFai Lau wrote: > > I believe x == 1 needs an extra case since ilog2(0) won't work. > > > > Since this function (map creation) is not on the fast path, > > I currently opt for Linus's suggestion which its code is more > > self-explanatory. > > If you put my suggestion in a macro that is called for example > > ilog2_roundup() > > you might have both: easier code and self-explanation. This is, essentially, the same as the existing order_base_2(). Best regards, -- Luc