ipv6: Use __fls() instead of fls() in __ipv6_addr_diff().
authorYOSHIFUJI Hideaki / 吉藤英明 <yoshfuji@linux-ipv6.org>
Mon, 29 Mar 2010 06:00:05 +0000 (06:00 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 31 Mar 2010 06:28:46 +0000 (23:28 -0700)
Because we have ensured that the argument is non-zero,
it is better to use __fls() and generate better code.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/ipv6.h

index e72fb10..033ddd4 100644 (file)
@@ -422,7 +422,7 @@ static inline int __ipv6_addr_diff(const void *token1, const void *token2, int a
        for (i = 0; i < addrlen; i++) {
                __be32 xb = a1[i] ^ a2[i];
                if (xb)
-                       return i * 32 + 32 - fls(ntohl(xb));
+                       return i * 32 + 31 - __fls(ntohl(xb));
        }
 
        /*