]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
lguest: cleanup for map_switcher()
authorXiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Wed, 5 Aug 2009 09:42:37 +0000 (17:42 +0800)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 23 Sep 2009 12:56:47 +0000 (22:26 +0930)
We can use alloc_page() instead of get_zeroed_page() and virt_to_page()

Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
drivers/lguest/core.c

index 1e2cb846b3c9d7b593d3dd6e5b588a1f3f227991..8744d24ac6e639213e4366cc7dd12d06ec039a4e 100644 (file)
@@ -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);
        }
 
        /*