All of lore.kernel.org
 help / color / mirror / Atom feed
From: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
To: davem@davemloft.net
Cc: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>, netdev@vger.kernel.org
Subject: Re: [PATCH net-next-2.6] ipv6: Use __fls() instead of fls() in __ipv6_addr_diff().
Date: Tue, 30 Mar 2010 00:49:07 +0900	[thread overview]
Message-ID: <4BB0CBF3.805@linux-ipv6.org> (raw)
In-Reply-To: <201003260801.o2Q8134t023352@94.43.138.210.xn.2iij.net>

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));
>   	}
> 
>   	/*


  reply	other threads:[~2010-03-29 15:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2010-03-29 18:33   ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BB0CBF3.805@linux-ipv6.org \
    --to=yoshfuji@linux-ipv6.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.