Skip to content

Commit

Permalink
lguest: cleanup for map_switcher()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Xiao Guangrong authored and Rusty Russell committed Sep 23, 2009
1 parent fb100d7 commit 6c189d8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/lguest/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/*
Expand Down

0 comments on commit 6c189d8

Please sign in to comment.