Messages in this thread | | | From | Linus Torvalds <> | Date | Wed, 14 Dec 2011 15:55:34 -0800 | Subject | Re: [PATCH] Fix order_base_2(0) |
| |
On Wed, Dec 14, 2011 at 3:40 AM, David Howells <dhowells@redhat.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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |