mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tip-bot for WANG Chao <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com,
	pure.logic@nexus-software.ie, matt.fleming@intel.com,
	chaowang@redhat.com, tglx@linutronix.de,
	santosh.shilimkar@ti.com, bp@suse.de, mingo@kernel.org
Subject: [tip:x86/mm] x86, setup: Let early_memremap() handle page alignment
Date: Fri, 23 Jan 2015 07:18:36 -0800	[thread overview]
Message-ID: <tip-7389882c81474d635a208726edb22938645ff9ad@git.kernel.org> (raw)
In-Reply-To: <1420628150-16872-1-git-send-email-chaowang@redhat.com>

Commit-ID:  7389882c81474d635a208726edb22938645ff9ad
Gitweb:     http://git.kernel.org/tip/7389882c81474d635a208726edb22938645ff9ad
Author:     WANG Chao <chaowang@redhat.com>
AuthorDate: Wed, 7 Jan 2015 18:55:48 +0800
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Fri, 23 Jan 2015 16:14:26 +0100

x86, setup: Let early_memremap() handle page alignment

early_memremap() takes care of page alignment and map size, so we can
just remap the required data size and get rid of the adjustments in
the setup code.

[tglx: Massaged changelog ]

Signed-off-by: WANG Chao <chaowang@redhat.com>
Cc: Matt Fleming <matt.fleming@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
Cc: Bryan O'Donoghue <pure.logic@nexus-software.ie>
Link: http://lkml.kernel.org/r/1420628150-16872-1-git-send-email-chaowang@redhat.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 arch/x86/kernel/setup.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index ab4734e..c4648ada 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -431,15 +431,13 @@ static void __init parse_setup_data(void)
 
 	pa_data = boot_params.hdr.setup_data;
 	while (pa_data) {
-		u32 data_len, map_len, data_type;
+		u32 data_len, data_type;
 
-		map_len = max(PAGE_SIZE - (pa_data & ~PAGE_MASK),
-			      (u64)sizeof(struct setup_data));
-		data = early_memremap(pa_data, map_len);
+		data = early_memremap(pa_data, sizeof(*data));
 		data_len = data->len + sizeof(struct setup_data);
 		data_type = data->type;
 		pa_next = data->next;
-		early_iounmap(data, map_len);
+		early_iounmap(data, sizeof(*data));
 
 		switch (data_type) {
 		case SETUP_E820_EXT:

      parent reply	other threads:[~2015-01-23 15:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-07 10:55 [PATCH 1/2] x86: early_memremap exact size of struct setup_data WANG Chao
2015-01-07 10:55 ` [PATCH 2/2] x86: add macro for_each_setup_data() WANG Chao
2015-01-23 14:24   ` Thomas Gleixner
2015-01-23 15:18 ` tip-bot for WANG Chao [this message]

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=tip-7389882c81474d635a208726edb22938645ff9ad@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=bp@suse.de \
    --cc=chaowang@redhat.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=matt.fleming@intel.com \
    --cc=mingo@kernel.org \
    --cc=pure.logic@nexus-software.ie \
    --cc=santosh.shilimkar@ti.com \
    --cc=tglx@linutronix.de \
    /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