* [PATCH net-next-2.6] ipv6: Use __fls() instead of fls() in __ipv6_addr_diff().
@ 2010-03-26 8:01 YOSHIFUJI Hideaki
2010-03-29 15:49 ` YOSHIFUJI Hideaki
0 siblings, 1 reply; 3+ messages in thread
From: YOSHIFUJI Hideaki @ 2010-03-26 8:01 UTC (permalink / raw)
To: davem; +Cc: yoshfuji, netdev
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(-)
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index e72fb10..619ab34 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 + 32 - __fls(ntohl(xb));
}
/*
--
1.5.6.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next-2.6] ipv6: Use __fls() instead of fls() in __ipv6_addr_diff().
2010-03-26 8:01 [PATCH net-next-2.6] ipv6: Use __fls() instead of fls() in __ipv6_addr_diff() YOSHIFUJI Hideaki
@ 2010-03-29 15:49 ` YOSHIFUJI Hideaki
2010-03-29 18:33 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: YOSHIFUJI Hideaki @ 2010-03-29 15:49 UTC (permalink / raw)
To: davem; +Cc: YOSHIFUJI Hideaki, netdev
Sorry, I withdraw this because this is incorrect;
__fls() returns fls() - 1.
--yoshfuji
(2010/03/26 17:01), YOSHIFUJI Hideaki wrote:
> 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(-)
>
> diff --git a/include/net/ipv6.h b/include/net/ipv6.h
> index e72fb10..619ab34 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 + 32 - __fls(ntohl(xb));
> }
>
> /*
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next-2.6] ipv6: Use __fls() instead of fls() in __ipv6_addr_diff().
2010-03-29 15:49 ` YOSHIFUJI Hideaki
@ 2010-03-29 18:33 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2010-03-29 18:33 UTC (permalink / raw)
To: yoshfuji; +Cc: netdev
From: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Date: Tue, 30 Mar 2010 00:49:07 +0900
> Sorry, I withdraw this because this is incorrect;
> __fls() returns fls() - 1.
Ok.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-03-29 18:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-26 8:01 [PATCH net-next-2.6] ipv6: Use __fls() instead of fls() in __ipv6_addr_diff() YOSHIFUJI Hideaki
2010-03-29 15:49 ` YOSHIFUJI Hideaki
2010-03-29 18:33 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).