staging: comedi: mite: use ilog2()
authorIan Abbott <abbotti@mev.co.uk>
Fri, 14 Sep 2012 16:34:23 +0000 (17:34 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 17 Sep 2012 12:09:07 +0000 (05:09 -0700)
commitd6f015b6ad035d465d0ab30e9a441e5e8d18d4b7
tree32e1fc2bd5e5a378d5f30e3312750ac8bba2f195
parent7d24e1ac00173a5a271bf1353d4216836dab55e6
staging: comedi: mite: use ilog2()

The static inline functions `MITE_IODWBSR_1_WSIZE_bits()` and `CR_RL()`
in "mite.h" work out a base-2 logarithm using a `while` loop.  Change
them to use `ilog2()`.  Also change `CR_RL()` to clamp the maximum value
instead of printing an error.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/mite.h