Commit 50c66d7b authored by Yuntao Wang's avatar Yuntao Wang Committed by Borislav Petkov (AMD)

x86/setup: Move duplicate boot_cpu_data definition out of the ifdeffery

Both the if and else blocks define an exact same boot_cpu_data variable, move
the duplicate variable definition out of the if/else block.

In addition, do some other minor cleanups.

  [ bp: Massage. ]
Signed-off-by: default avatarYuntao Wang <ytcoode@gmail.com>
Signed-off-by: default avatarBorislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20220601122914.820890-1-ytcoode@gmail.com
parent b7d1f15b
...@@ -395,7 +395,7 @@ int __init e820__update_table(struct e820_table *table) ...@@ -395,7 +395,7 @@ int __init e820__update_table(struct e820_table *table)
/* Continue building up new map based on this information: */ /* Continue building up new map based on this information: */
if (current_type != last_type || e820_nomerge(current_type)) { if (current_type != last_type || e820_nomerge(current_type)) {
if (last_type != 0) { if (last_type) {
new_entries[new_nr_entries].size = change_point[chg_idx]->addr - last_addr; new_entries[new_nr_entries].size = change_point[chg_idx]->addr - last_addr;
/* Move forward only if the new size was non-zero: */ /* Move forward only if the new size was non-zero: */
if (new_entries[new_nr_entries].size != 0) if (new_entries[new_nr_entries].size != 0)
...@@ -403,7 +403,7 @@ int __init e820__update_table(struct e820_table *table) ...@@ -403,7 +403,7 @@ int __init e820__update_table(struct e820_table *table)
if (++new_nr_entries >= max_nr_entries) if (++new_nr_entries >= max_nr_entries)
break; break;
} }
if (current_type != 0) { if (current_type) {
new_entries[new_nr_entries].addr = change_point[chg_idx]->addr; new_entries[new_nr_entries].addr = change_point[chg_idx]->addr;
new_entries[new_nr_entries].type = current_type; new_entries[new_nr_entries].type = current_type;
last_addr = change_point[chg_idx]->addr; last_addr = change_point[chg_idx]->addr;
......
...@@ -114,11 +114,6 @@ static struct resource bss_resource = { ...@@ -114,11 +114,6 @@ static struct resource bss_resource = {
#ifdef CONFIG_X86_32 #ifdef CONFIG_X86_32
/* CPU data as detected by the assembly code in head_32.S */ /* CPU data as detected by the assembly code in head_32.S */
struct cpuinfo_x86 new_cpu_data; struct cpuinfo_x86 new_cpu_data;
/* Common CPU data for all CPUs */
struct cpuinfo_x86 boot_cpu_data __read_mostly;
EXPORT_SYMBOL(boot_cpu_data);
unsigned int def_to_bigsmp; unsigned int def_to_bigsmp;
struct apm_info apm_info; struct apm_info apm_info;
...@@ -132,11 +127,10 @@ EXPORT_SYMBOL(ist_info); ...@@ -132,11 +127,10 @@ EXPORT_SYMBOL(ist_info);
struct ist_info ist_info; struct ist_info ist_info;
#endif #endif
#else
struct cpuinfo_x86 boot_cpu_data __read_mostly;
EXPORT_SYMBOL(boot_cpu_data);
#endif #endif
struct cpuinfo_x86 boot_cpu_data __read_mostly;
EXPORT_SYMBOL(boot_cpu_data);
#if !defined(CONFIG_X86_PAE) || defined(CONFIG_X86_64) #if !defined(CONFIG_X86_PAE) || defined(CONFIG_X86_64)
__visible unsigned long mmu_cr4_features __ro_after_init; __visible unsigned long mmu_cr4_features __ro_after_init;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment