]> git.karo-electronics.de Git - karo-tx-linux.git/commit
MPILIB: Provide count_leading/trailing_zeros() based on arch functions
authorDavid Howells <dhowells@redhat.com>
Thu, 13 Sep 2012 12:09:33 +0000 (13:09 +0100)
committerRusty Russell <rusty@rustcorp.com.au>
Fri, 28 Sep 2012 05:14:46 +0000 (14:44 +0930)
commitd5fef268e233cdbbb5990ea3bcbcf0a2a5aee5d3
treece5160a66ec033242249fcfb3995de1c548b5d0d
parent143be2d227d7c079bbfecc41767167f97c147939
MPILIB: Provide count_leading/trailing_zeros() based on arch functions

Provide count_leading/trailing_zeros() macros based on extant arch bit scanning
functions rather than reimplementing from scratch in MPILIB.

Whilst we're at it, turn count_foo_zeros(n, x) into n = count_foo_zeros(x).

Also move the definition to asm-generic as other people may be interested in
using it.

Signed-off-by: David Howells <dhowells@redhat.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Dmitry Kasatkin <dmitry.kasatkin@intel.com>
Cc: Arnd Bergmann <arnd@arndb.com>
include/asm-generic/bitops/count_zeros.h [new file with mode: 0644]
lib/mpi/longlong.h
lib/mpi/mpi-bit.c
lib/mpi/mpi-pow.c