[parisc-linux] backport bitops.h stuff

James Bottomley James.Bottomley@steeleye.com
01 Aug 2003 10:59:02 -0500


On Fri, 2003-08-01 at 10:28, Joel Soete wrote:
> Can somebody help me to ci inot 2.4 this patch which backport ffs() needed
> for new devmapper ;)

Actually, this patch looks decidedly non-optimal.

See include/linux/bitops.h:generic_ffs for how it should be done on
architectures that don't have any machine instruction help.  That's only
four if statements and no loop.

I see we already have the loop thing in 2.5, but should we consider
simply using the generic operations there as well?

even for __ffs, which is just a slight optimisation over ffs, using
generic_ffs would probably be faster

James