mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Wang YanQing <udknight@gmail.com>
To: akpm@linux-foundation.org
Cc: yinghai@kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/3] x86:aperture_64: code pattern clean
Date: Mon, 15 Apr 2013 16:07:20 +0800	[thread overview]
Message-ID: <20130415080720.GB1994@udknight> (raw)


This patch don't change code function,
it just do prepare for import the
memblock_alloc_in_range to do the code pattern
which looks like below in one function:

memblock_find_in_range()
follow by
memblock_reserve()

Signed-off-by: Wang YanQing <udknight@gmail.com>
---
 arch/x86/kernel/aperture_64.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/aperture_64.c b/arch/x86/kernel/aperture_64.c
index d5fd66f..1523e75 100644
--- a/arch/x86/kernel/aperture_64.c
+++ b/arch/x86/kernel/aperture_64.c
@@ -85,9 +85,9 @@ static u32 __init allocate_aperture(void)
 	 * memory. Unfortunately we cannot move it up because that would
 	 * make the IOMMU useless.
 	 */
-	addr = memblock_find_in_range(GART_MIN_ADDR, GART_MAX_ADDR,
+	addr = memblock_find_in_range(GART_MIN_ADDR, GART_MAX_ADDR - aper_size,
 				      aper_size, aper_size);
-	if (!addr || addr + aper_size > GART_MAX_ADDR) {
+	if (!addr) {
 		printk(KERN_ERR
 			"Cannot allocate aperture memory hole (%lx,%uK)\n",
 				addr, aper_size>>10);
-- 
1.7.12.4.dirty

             reply	other threads:[~2013-04-15  8:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-15  8:07 Wang YanQing [this message]
2013-04-15 21:08 ` 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=20130415080720.GB1994@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

all inboxes | Powered by JetHome®