[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 2 Feb 2017 12:49:05 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Ard Biesheuvel <ard.biesheuvel@...aro.org>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Laura Abbott <labbott@...oraproject.org>,
Will Deacon <will.deacon@....com>,
Stephen Boyd <sboyd@...eaurora.org>,
Gregory Clement <gregory.clement@...e-electrons.com>,
james.greenhalgh@....com, Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Markus Trippelsdorf <markus@...ppelsdorf.de>,
Andrew Morton <akpm@...ux-foundation.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
Joe Perches <joe@...ches.com>
Subject: Re: [PATCH] log2: make order_base_2() behave correctly on const input
value zero
On Thu, Feb 2, 2017 at 9:04 AM, Ard Biesheuvel
<ard.biesheuvel@...aro.org> wrote:
>
> So update order_base_2() to adhere to its own documented interface.
Ok, looks like you screwed up the types according to the build server.
Making the return type "unsigned long" is slightly excessive. If you
need an unsigned long to describe the log2 of a number in the kernel,
you're playing with numbers that are *way* too big.
The old code used "ilog2()", which returns an int.
Which is plenty big enough of a type.
Linus
Powered by blists - more mailing lists