From 08b46d5dd869ea631d7c1c15535c930c8ea462e0 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Sat, 28 Jan 2017 17:29:08 +0100 Subject: x86/boot/e820: Clean up the E820 table size define names We've got a number of defines related to the E820 table and its size: E820MAP E820NR E820_X_MAX E820MAX The first two denote byte offsets into the zeropage (struct boot_params), and can are not used in the kernel and can be removed. The E820_*_MAX values have an inconsistent structure and it's unclear in any case what they mean. 'X' presuably goes for extended - but it's not very expressive altogether. Change these over to: E820_MAX_ENTRIES_ZEROPAGE E820_MAX_ENTRIES ... which are self-explanatory names. No change in functionality. Cc: Alex Thorlton Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Brian Gerst Cc: Dan Williams Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Huang, Ying Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Linus Torvalds Cc: Paul Jackson Cc: Peter Zijlstra Cc: Rafael J. Wysocki Cc: Tejun Heo Cc: Thomas Gleixner Cc: Wei Yang Cc: Yinghai Lu Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar --- arch/x86/kernel/crash.c | 2 +- arch/x86/kernel/e820.c | 8 ++++---- arch/x86/kernel/kexec-bzimage64.c | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'arch/x86/kernel') diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c index 5feba9a21130..22217ece26c8 100644 --- a/arch/x86/kernel/crash.c +++ b/arch/x86/kernel/crash.c @@ -509,7 +509,7 @@ static int add_e820_entry(struct boot_params *params, struct e820_entry *entry) unsigned int nr_e820_entries; nr_e820_entries = params->e820_entries; - if (nr_e820_entries >= E820MAX) + if (nr_e820_entries >= E820_MAX_ENTRIES_ZEROPAGE) return 1; memcpy(¶ms->e820_table[nr_e820_entries], entry, diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c index 90dcd240a389..055ac2484729 100644 --- a/arch/x86/kernel/e820.c +++ b/arch/x86/kernel/e820.c @@ -261,10 +261,10 @@ static int __init cpcompare(const void *a, const void *b) int __init e820__update_table(struct e820_entry *biosmap, int max_nr_map, u32 *pnr_map) { - static struct change_member change_point_list[2*E820_X_MAX] __initdata; - static struct change_member *change_point[2*E820_X_MAX] __initdata; - static struct e820_entry *overlap_list[E820_X_MAX] __initdata; - static struct e820_entry new_bios[E820_X_MAX] __initdata; + static struct change_member change_point_list[2*E820_MAX_ENTRIES] __initdata; + static struct change_member *change_point[2*E820_MAX_ENTRIES] __initdata; + static struct e820_entry *overlap_list[E820_MAX_ENTRIES] __initdata; + static struct e820_entry new_bios[E820_MAX_ENTRIES] __initdata; enum e820_type current_type, last_type; unsigned long long last_addr; int chgidx; diff --git a/arch/x86/kernel/kexec-bzimage64.c b/arch/x86/kernel/kexec-bzimage64.c index 3e43a7d3b191..9d7fd5e6689a 100644 --- a/arch/x86/kernel/kexec-bzimage64.c +++ b/arch/x86/kernel/kexec-bzimage64.c @@ -102,9 +102,9 @@ static int setup_e820_entries(struct boot_params *params) nr_e820_entries = e820_table_firmware->nr_entries; - /* TODO: Pass entries more than E820MAX in bootparams setup data */ - if (nr_e820_entries > E820MAX) - nr_e820_entries = E820MAX; + /* TODO: Pass entries more than E820_MAX_ENTRIES_ZEROPAGE in bootparams setup data */ + if (nr_e820_entries > E820_MAX_ENTRIES_ZEROPAGE) + nr_e820_entries = E820_MAX_ENTRIES_ZEROPAGE; params->e820_entries = nr_e820_entries; memcpy(¶ms->e820_table, &e820_table_firmware->entries, nr_e820_entries*sizeof(struct e820_entry)); -- cgit v1.2.3