lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1400541748.14238.58.camel@joe-AO725>
Date:	Mon, 19 May 2014 16:22:28 -0700
From:	Joe Perches <joe@...ches.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Fabian Frederick <fabf@...net.be>,
	linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH V2 mmots] fs/hfsplus/wrapper.c: replace shift loop by fls

On Mon, 2014-05-19 at 16:09 -0700, Andrew Morton wrote:
> On Fri, 16 May 2014 22:38:15 +0200 Fabian Frederick <fabf@...net.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 but n can be
either u64 or u64 and ilog2 is compile-time
optimized when n is constant.

blocksize is a non-const u32 here.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ