The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Fabian Frederick <fabf@skynet.be>
To: Joe Perches <joe@perches.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH V2 mmots] fs/hfsplus/wrapper.c: replace shift loop by fls
Date: Tue, 20 May 2014 07:02:43 +0200	[thread overview]
Message-ID: <20140520070243.6fdb8ec2bbcc105fed0ae7ea@skynet.be> (raw)
In-Reply-To: <1400543405.19786.4.camel@joe-AO725>

On Mon, 19 May 2014 16:50:05 -0700
Joe Perches <joe@perches.com> wrote:

> On Mon, 2014-05-19 at 16:40 -0700, Andrew Morton wrote:
> > On Mon, 19 May 2014 16:22:28 -0700 Joe Perches <joe@perches.com> wrote:
> > 
> > > On Mon, 2014-05-19 at 16:09 -0700, Andrew Morton wrote:
> > > > On Fri, 16 May 2014 22:38:15 +0200 Fabian Frederick <fabf@skynet.be> wrote:
> > > > > Replace while blocksize;shift by fls -1
> > > []
> > > > fls() always makes my brain hurt.  ilog() is nicer?
> > > Maybe take an aspirin?
> > > ilog2(n) is effectively fls(n) - 1
> > Precisely.  ilog2() means "integer log 2".  Whereas fls() is some weird
> > low-level bit-scanning thing.
> 
> <shrug>  find-last[bit]-set is pretty obvious to me.
> ilog2(n) makes me think just a little more.
> 
> > What we want at this callsite is "integer log 2".  So use it.
> 
> Same thing.  Same ratio of use too.
> 
> $ git grep -w fls | wc -l
> 457
> $ git grep -w ilog2 | wc -l
> 391
and the winner is ? :)
> 
> 

  reply	other threads:[~2014-05-20  5:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-16 20:38 [PATCH V2 mmots] fs/hfsplus/wrapper.c: replace shift loop by fls Fabian Frederick
2014-05-19 23:09 ` Andrew Morton
2014-05-19 23:22   ` Joe Perches
2014-05-19 23:40     ` Andrew Morton
2014-05-19 23:50       ` Joe Perches
2014-05-20  5:02         ` Fabian Frederick [this message]
2014-05-20  5:10           ` Joe Perches

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=20140520070243.6fdb8ec2bbcc105fed0ae7ea@skynet.be \
    --to=fabf@skynet.be \
    --cc=akpm@linux-foundation.org \
    --cc=joe@perches.com \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox