Skip to content

Commit

Permalink
x86, setup: Let early_memremap() handle page alignment
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
WANG Chao authored and Thomas Gleixner committed Jan 23, 2015
1 parent ec6f34e commit 7389882
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions arch/x86/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 7389882

Please sign in to comment.