From: Xiao Guangrong Date: Wed, 5 Aug 2009 09:42:37 +0000 (+0800) Subject: lguest: cleanup for map_switcher() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=6c189d8312246af776c2587c233d6afcf3714438;p=linux-beck.git lguest: cleanup for map_switcher() We can use alloc_page() instead of get_zeroed_page() and virt_to_page() Signed-off-by: Xiao Guangrong Signed-off-by: Rusty Russell --- diff --git a/drivers/lguest/core.c b/drivers/lguest/core.c index 1e2cb846b3c9..8744d24ac6e6 100644 --- a/drivers/lguest/core.c +++ b/drivers/lguest/core.c @@ -67,12 +67,11 @@ static __init int map_switcher(void) * so we make sure they're zeroed. */ for (i = 0; i < TOTAL_SWITCHER_PAGES; i++) { - unsigned long addr = get_zeroed_page(GFP_KERNEL); - if (!addr) { + switcher_page[i] = alloc_page(GFP_KERNEL|__GFP_ZERO); + if (!switcher_page[i]) { err = -ENOMEM; goto free_some_pages; } - switcher_page[i] = virt_to_page(addr); } /*