[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFxEszjub9-MJD0irFs8y3hzGe3Ph=7RqWfkJ-0jKFtCeA@mail.gmail.com>
Date: Wed, 14 Dec 2011 15:55:34 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: David Howells <dhowells@...hat.com>
Cc: akpm@...ux-foundation.org, linux-kernel@...r.kernel.org,
"Robert P. J. Day" <rpjday@...shcourse.ca>
Subject: Re: [PATCH] Fix order_base_2(0)
On Wed, Dec 14, 2011 at 3:40 AM, David Howells <dhowells@...hat.com> wrote:
> The order_base_2() function is either wrongly documented or wrongly
> implemented. In the preceding comment, it says that:
>
> ob2(0) = 0
Let's just remove that comment. That's just crazy math and makes no
sense. Why would anybody do ilog2() on zero and expect anything valid?
At least "-1" would make a tiny amount as sense as an error return or
"underflow" or whatever. But returning 0 is just wrong. That's
ilog2(1), not 0.
Does anybody actually *want* order_base_2(0)?
Linus
--
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