[PATCH] [2/13] Make get_order(0) return 0

From: Andi Kleen
Date: Fri Mar 07 2008 - 04:11:21 EST



This is needed for some followup patches. Some old drivers
(like xd.c) pass 0 to get_order and the compat wrapper for
the mask allocator doesn't like the resulting underflow.

Signed-off-by: Andi Kleen <ak@xxxxxxx>

---
include/asm-generic/page.h | 3 +++
1 file changed, 3 insertions(+)

Index: linux/include/asm-generic/page.h
===================================================================
--- linux.orig/include/asm-generic/page.h
+++ linux/include/asm-generic/page.h
@@ -11,6 +11,9 @@ static __inline__ __attribute_const__ in
{
int order;

+ if (size == 0)
+ return 0;
+
size = (size - 1) >> (PAGE_SHIFT - 1);
order = -1;
do {
--
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/