aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWANG Chao <[email protected]>2015-01-07 18:55:48 +0800
committerThomas Gleixner <[email protected]>2015-01-23 16:14:26 +0100
commit7389882c81474d635a208726edb22938645ff9ad (patch)
tree3a3acfb279ec0ba1fb07271da6e9c8f07b8032e7
parentec6f34e5b552fb0a52e6aae1a5afbbb1605cc6cc (diff)
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 <[email protected]> Cc: Matt Fleming <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Santosh Shilimkar <[email protected]> Cc: Bryan O'Donoghue <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
-rw-r--r--arch/x86/kernel/setup.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index ab4734e5411d..c4648adadd7d 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: