From: Wang YanQing <udknight@gmail.com>
To: akpm@linux-foundation.org
Cc: yinghai@kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/3] x86: reserve_crashkernel: use memblock_is_region_reserved to simplify code
Date: Mon, 15 Apr 2013 16:06:21 +0800 [thread overview]
Message-ID: <20130415080621.GA1994@udknight> (raw)
Use memblock_is_region_reserved instead of memblock_find_in_range
to simplify the check codes, and gain a little speed benefit.
Signed-off-by: Wang YanQing <udknight@gmail.com>
---
arch/x86/kernel/setup.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 90d8cc9..9d60c85 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -577,11 +577,7 @@ static void __init reserve_crashkernel(void)
}
} else {
- unsigned long long start;
-
- start = memblock_find_in_range(crash_base,
- crash_base + crash_size, crash_size, 1<<20);
- if (start != crash_base) {
+ if (memblock_is_region_reserved(crash_base, crash_size)) {
pr_info("crashkernel reservation failed - memory is in use.\n");
return;
}
--
1.7.12.4.dirty
next reply other threads:[~2013-04-15 8:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-15 8:06 Wang YanQing [this message]
2013-04-15 20:47 ` Yinghai Lu
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=20130415080621.GA1994@udknight \
--to=udknight@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=yinghai@kernel.org \
/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
Powered by JetHome