Commit d57b8fb8 authored by YOSHIFUJI Hideaki / 吉藤英明's avatar YOSHIFUJI Hideaki / 吉藤英明 Committed by David S. Miller

ipv6: Use __fls() instead of fls() in __ipv6_addr_diff().

Because we have ensured that the argument is non-zero,
it is better to use __fls() and generate better code.
Signed-off-by: default avatarYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2c73e1fe
...@@ -422,7 +422,7 @@ static inline int __ipv6_addr_diff(const void *token1, const void *token2, int a ...@@ -422,7 +422,7 @@ static inline int __ipv6_addr_diff(const void *token1, const void *token2, int a
for (i = 0; i < addrlen; i++) { for (i = 0; i < addrlen; i++) {
__be32 xb = a1[i] ^ a2[i]; __be32 xb = a1[i] ^ a2[i];
if (xb) if (xb)
return i * 32 + 32 - fls(ntohl(xb)); return i * 32 + 31 - __fls(ntohl(xb));
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment