public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] lguest: cleanup for map_switcher()
@ 2009-08-05  9:42 Xiao Guangrong
  2009-08-06 12:08 ` Rusty Russell
  0 siblings, 1 reply; 2+ messages in thread
From: Xiao Guangrong @ 2009-08-05  9:42 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Rusty Russell, Matias Zabaljauregui, Johannes Weiner,
	Atsushi SAKAI, Ingo Molnar, LKML, lguest

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

Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
---
 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 1e2cb84..b639019 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);
 	}
 
 	/*
-- 
1.6.1.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] lguest: cleanup for map_switcher()
  2009-08-05  9:42 [PATCH] lguest: cleanup for map_switcher() Xiao Guangrong
@ 2009-08-06 12:08 ` Rusty Russell
  0 siblings, 0 replies; 2+ messages in thread
From: Rusty Russell @ 2009-08-06 12:08 UTC (permalink / raw)
  To: Xiao Guangrong
  Cc: Andrew Morton, Matias Zabaljauregui, Johannes Weiner,
	Atsushi SAKAI, Ingo Molnar, LKML, lguest

On Wed, 5 Aug 2009 07:12:37 pm Xiao Guangrong wrote:
> We can use alloc_page() instead of get_zeroed_page() and virt_to_page()

Applied, thanks!
Rusty.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-08-06 12:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-05  9:42 [PATCH] lguest: cleanup for map_switcher() Xiao Guangrong
2009-08-06 12:08 ` Rusty Russell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox