Skip to contentSkip to conversation

lguest: cleanup for map_switcher()

PATCH Applied Xiao Guangrong 2 participants 2 messages Aug 5, 2009 – Aug 6, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lguest: cleanup for map_switcher()

We can use alloc_page() instead of get_zeroed_page() and virt_to_page()

---
 drivers/lguest/core.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
drivers/lguest/core.c +2 -3
index 1e2cb84..b639019 100644
@@ -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);
 	}
 
 	/*
Signature · 1 line
1.6.1.2
#1 lore raw
Quoted 1 line · Xiao Guangrong

We can use alloc_page() instead of get_zeroed_page() and virt_to_page()

Applied, thanks!
Rusty.