Re: [tip:x86/asm] bitops: Optimise get_order()

From: Stephen Rothwell
Date: Wed Feb 29 2012 - 19:31:14 EST


On Wed, 29 Feb 2012 15:29:04 -0500 Paul Gortmaker <paul.gortmaker@xxxxxxxxxxxxx> wrote:
>
> On Mon, Feb 20, 2012 at 6:20 PM, tip-bot for David Howells
> <dhowells@xxxxxxxxxx> wrote:
> > Commit-ID: Âd66acc39c7cee323733c8503b9de1821a56dff7e
> > Gitweb: Â Â http://git.kernel.org/tip/d66acc39c7cee323733c8503b9de1821a56dff7e
> > Author: Â Â David Howells <dhowells@xxxxxxxxxx>
> > AuthorDate: Mon, 20 Feb 2012 22:39:29 +0000
> > Committer: ÂH. Peter Anvin <hpa@xxxxxxxxx>
> > CommitDate: Mon, 20 Feb 2012 14:47:02 -0800
> >
> > bitops: Optimise get_order()
>
> This is causing build failures on non-x86 in linux next according to git bisect.

Presumably it needs to include linux/bitops.h (and see below).

> > +static inline __attribute_const__
> > +int __get_order(unsigned long size)
> > +{
> > + Â Â Â int order;
> > +
> > + Â Â Â size--;
> > + Â Â Â size >>= PAGE_SHIFT;
> > +#if BITS_PER_LONG == 32
> > + Â Â Â order = fls(size);
> > +#else
> > + Â Â Â order = fls64(size);
> > +#endif

linux/bitops.h has fls_long() that does this size test and calls the right thing.

--
Cheers,
Stephen Rothwell sfr@xxxxxxxxxxxxxxxx

Attachment: pgp00000.pgp
Description: PGP signature