diff mbox

[net-next-2.6,(TAKE,2)] ipv6: Use __fls() instead of fls() in __ipv6_addr_diff().

Message ID 201003291600.o2TG05VI032167@94.43.138.210.xn.2iij.net
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

YOSHIFUJI Hideaki / 吉藤英明 March 29, 2010, 4 p.m. UTC
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>
---
 include/net/ipv6.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

David Miller March 31, 2010, 6:40 a.m. UTC | #1
From: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Date: Tue, 30 Mar 2010 01:00:05 +0900

> 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>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index e72fb10..033ddd4 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -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));
 	}
 
 	/*