提交 ef296f56 编写于 作者: A Al Viro 提交者: David S. Miller

[IPV6]: __ipv6_addr_diff() annotations and cleanup.

Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 e69a4adc
...@@ -394,22 +394,15 @@ static inline int ipv6_addr_any(const struct in6_addr *a) ...@@ -394,22 +394,15 @@ static inline int ipv6_addr_any(const struct in6_addr *a)
*/ */
static inline int __ipv6_addr_diff(const void *token1, const void *token2, int addrlen) static inline int __ipv6_addr_diff(const void *token1, const void *token2, int addrlen)
{ {
const __u32 *a1 = token1, *a2 = token2; const __be32 *a1 = token1, *a2 = token2;
int i; int i;
addrlen >>= 2; addrlen >>= 2;
for (i = 0; i < addrlen; i++) { for (i = 0; i < addrlen; i++) {
__u32 xb = a1[i] ^ a2[i]; __be32 xb = a1[i] ^ a2[i];
if (xb) { if (xb)
int j = 31; return i * 32 + 32 - fls(ntohl(xb));
xb = ntohl(xb);
while ((xb & (1 << j)) == 0)
j--;
return (i * 32 + 31 - j);
}
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册