Re: [PATCH] Fix get_order() [try #2]

From: H. Peter Anvin
Date: Tue Mar 06 2007 - 13:39:26 EST


David Howells wrote:
From: David Howells <dhowells@xxxxxxxxxx>

Provide an ilog2_up() that rounds its result up (ilog2() rounds down).

Fix get_order() to use ilog2_up() not ilog2() to get the correct rounding.

Adjust the documentation surrounding ilog2() and co. to indicate what rounding
they perform.

Fix roundup_pow_of_two(1) to give 1, not 0.

Eh? roundup_pow_of_two(1) should be 0; 2^0 = 1.

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