From: Pavel Machek Date: Mon, 28 Apr 2008 09:13:35 +0000 (-0700) Subject: mm/page_alloc.c: remove hand-coded get_order() X-Git-Tag: v2.6.26-rc1~927 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2309f9e6fe3f1de661eab9613f7903ab4420c753;p=linux-2.6 mm/page_alloc.c: remove hand-coded get_order() Remove hand-coded get_order() from page_alloc.c. Signed-off-by: Pavel Machek Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/page_alloc.c b/mm/page_alloc.c index d3358efdf4..d1cf4f05dc 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -4345,9 +4345,7 @@ void *__init alloc_large_system_hash(const char *tablename, else if (hashdist) table = __vmalloc(size, GFP_ATOMIC, PAGE_KERNEL); else { - unsigned long order; - for (order = 0; ((1UL << order) << PAGE_SHIFT) < size; order++) - ; + unsigned long order = get_order(size); table = (void*) __get_free_pages(GFP_ATOMIC, order); /* * If bucketsize is not a power-of-two, we may free