Re: [PATCH] Fix get_order()

From: David Howells
Date: Tue Mar 06 2007 - 13:22:26 EST


H. Peter Anvin <hpa@xxxxxxxxx> wrote:

> if (size <= (1UL << page_shift))
> return 0;
> else
> return __ilog2_u32(size-1)+1-page_shift;

I think you're right. That'll also defend against the result of __ilog2_u32()
being less than page_shift-1.

I think I can dispense with the page_shift argument. IIRC __get_order() was
overridden by some arch, but isn't now.

David
-
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/