From: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>,
Matias Zabaljauregui <zabaljauregui@gmail.com>,
Johannes Weiner <hannes@saeurebad.de>,
Atsushi SAKAI <sakaia@jp.fujitsu.com>,
Ingo Molnar <mingo@elte.hu>, LKML <linux-kernel@vger.kernel.org>,
lguest@ozlabs.org
Subject: [PATCH] lguest: cleanup for map_switcher()
Date: Wed, 05 Aug 2009 17:42:37 +0800 [thread overview]
Message-ID: <4A79540D.6060207@cn.fujitsu.com> (raw)
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
next reply other threads:[~2009-08-05 9:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-05 9:42 Xiao Guangrong [this message]
2009-08-06 12:08 ` [PATCH] lguest: cleanup for map_switcher() Rusty Russell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A79540D.6060207@cn.fujitsu.com \
--to=xiaoguangrong@cn.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=hannes@saeurebad.de \
--cc=lguest@ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rusty@rustcorp.com.au \
--cc=sakaia@jp.fujitsu.com \
--cc=zabaljauregui@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox