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

From: Christoph Lameter
Date: Fri Oct 06 2006 - 13:20:28 EST


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.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/