mirror of
https://github.com/adulau/aha.git
synced 2024-12-27 19:26:25 +00:00
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>
This commit is contained in:
parent
fb100d78c0
commit
6c189d8312
1 changed files with 2 additions and 3 deletions
|
@ -67,12 +67,11 @@ static __init int map_switcher(void)
|
||||||
* so we make sure they're zeroed.
|
* so we make sure they're zeroed.
|
||||||
*/
|
*/
|
||||||
for (i = 0; i < TOTAL_SWITCHER_PAGES; i++) {
|
for (i = 0; i < TOTAL_SWITCHER_PAGES; i++) {
|
||||||
unsigned long addr = get_zeroed_page(GFP_KERNEL);
|
switcher_page[i] = alloc_page(GFP_KERNEL|__GFP_ZERO);
|
||||||
if (!addr) {
|
if (!switcher_page[i]) {
|
||||||
err = -ENOMEM;
|
err = -ENOMEM;
|
||||||
goto free_some_pages;
|
goto free_some_pages;
|
||||||
}
|
}
|
||||||
switcher_page[i] = virt_to_page(addr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue