Skip to content

Commit

Permalink
ipv6: Use __fls() instead of fls() in __ipv6_addr_diff().
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
YOSHIFUJI Hideaki / 吉藤英明 authored and David S. Miller committed Mar 31, 2010
1 parent 2c73e1f commit d57b8fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/net/ipv6.h
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

/*
Expand Down

0 comments on commit d57b8fb

Please sign in to comment.