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: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
2c73e1fe94
commit
d57b8fb8a8
@@ -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));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user