tile: fix bug where fls(0) was not returning 0
commit6115b7a54b2a3f0b6fc783715f606d3760962dc9
authorChris Metcalf <cmetcalf@tilera.com>
Fri, 25 May 2012 16:32:09 +0000 (25 12:32 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Jun 2012 07:13:00 +0000 (1 15:13 +0800)
treeca535872e161ffc6ad71c85a6af714c78a4c59d6
parent0d7755e450865b76b98e3fea2e166b0a2266972d
tile: fix bug where fls(0) was not returning 0

commit 9f1d62bed7f015d11b9164078b7fea433b474114 upstream.

This is because __builtin_clz(0) returns 64 for the "undefined" case
of 0, since the builtin just does a right-shift 32 and "clz" instruction.
So, use the alpha approach of casting to u32 and using __builtin_clzll().

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/tile/include/asm/bitops.h