The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Joe Perches <joe@perches.com>
Cc: Fabian Frederick <fabf@skynet.be>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH V2 mmots] fs/hfsplus/wrapper.c: replace shift loop by fls
Date: Mon, 19 May 2014 16:40:37 -0700	[thread overview]
Message-ID: <20140519164037.ec6438686bd29efeebffa610@linux-foundation.org> (raw)
In-Reply-To: <1400541748.14238.58.camel@joe-AO725>

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.

What we want at this callsite is "integer log 2".  So use it.

  reply	other threads:[~2014-05-19 23:40 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 [this message]
2014-05-19 23:50       ` Joe Perches
2014-05-20  5:02         ` Fabian Frederick
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=20140519164037.ec6438686bd29efeebffa610@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=fabf@skynet.be \
    --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