summaryrefslogtreecommitdiffstats
path: root/drivers/lguest/core.c
diff options
context:
space:
mode:
authorXiao Guangrong <xiaoguangrong@cn.fujitsu.com>2009-08-05 17:42:37 +0800
committerRusty Russell <rusty@rustcorp.com.au>2009-09-23 22:26:47 +0930
commit6c189d8312246af776c2587c233d6afcf3714438 (patch)
tree4d1667bf0129d412c9101c48719a9f272880b45b /drivers/lguest/core.c
parentfb100d78c04ff6053047625d0368d0d4b1d9912a (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/core.c')
-rw-r--r--drivers/lguest/core.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/lguest/core.c b/drivers/lguest/core.c
index 1e2cb846b3c..8744d24ac6e 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);
}
/*