[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <4A79540D.6060207@cn.fujitsu.com>
Date: Wed, 05 Aug 2009 17:42:37 +0800
From: Xiao Guangrong <xiaoguangrong@...fujitsu.com>
To: Andrew Morton <akpm@...ux-foundation.org>
CC: Rusty Russell <rusty@...tcorp.com.au>,
Matias Zabaljauregui <zabaljauregui@...il.com>,
Johannes Weiner <hannes@...urebad.de>,
Atsushi SAKAI <sakaia@...fujitsu.com>,
Ingo Molnar <mingo@...e.hu>,
LKML <linux-kernel@...r.kernel.org>, lguest@...abs.org
Subject: [PATCH] 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@...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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists