diff options
author | Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> | 2009-08-05 17:42:37 +0800 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2009-08-13 10:26:11 +1000 |
commit | 01aca56f2d1456676fb68bcf3e056b84ef286ba4 (patch) | |
tree | a56dbe3eea3af1f56d6d7f38520c24d99b8c15a1 /drivers/lguest | |
parent | 73aa68ebe03dedbf91ed973fa240ca418ce6527a (diff) |
lguest: cleanup for map_switcher()
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>
Diffstat (limited to 'drivers/lguest')
-rw-r--r-- | drivers/lguest/core.c | 5 |
1 files changed, 2 insertions, 3 deletions
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); } /* |