Re: [PATCH 1/4] LOG2: Implement a general integer log2 facility in the kernel [try #4]

Christoph Lameter
2006-10-06T17:19:54Z

On Fri, 6 Oct 2006, Matthew Wilcox wrote:

> On Fri, Oct 06, 2006 at 02:34:14PM +0100, David Howells wrote:
> > +config ARCH_HAS_ILOG2_U32
> > + bool
> > + default n
>
> Why not "def_bool n"? Or indeed, since the default is n, why not just
> "bool"?

Why so complicated and why do it at all? We already have fls and ffs
amoung the bit operations and those map to cpu instructions on arches
that support these. fls can be used as a log 2 facilities. If you need
another name and further refine it then just add an inline function.