diff options
author | Yuntao Wang <ytcoode@gmail.com> | 2022-06-01 14:29:14 +0200 |
---|---|---|
committer | Borislav Petkov (AMD) <bp@alien8.de> | 2023-01-11 12:45:16 +0100 |
commit | 50c66d7b049ddec095644a005bfe0b28e22c4b02 (patch) | |
tree | bdcca06e05f70c44371be6e440135adca31d8783 /arch/x86/kernel/e820.c | |
parent | x86/boot/e820: Fix typo in e820.c comment (diff) | |
download | linux-50c66d7b049ddec095644a005bfe0b28e22c4b02.tar.xz linux-50c66d7b049ddec095644a005bfe0b28e22c4b02.zip |
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: Yuntao Wang <ytcoode@gmail.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20220601122914.820890-1-ytcoode@gmail.com
Diffstat (limited to 'arch/x86/kernel/e820.c')
-rw-r--r-- | arch/x86/kernel/e820.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c index 0614a79c4619..fb8cf953380d 100644 --- a/arch/x86/kernel/e820.c +++ b/arch/x86/kernel/e820.c @@ -395,7 +395,7 @@ int __init e820__update_table(struct e820_table *table) /* Continue building up new map based on this information: */ 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; /* Move forward only if the new size was non-zero: */ if (new_entries[new_nr_entries].size != 0) @@ -403,7 +403,7 @@ int __init e820__update_table(struct e820_table *table) if (++new_nr_entries >= max_nr_entries) break; } - if (current_type != 0) { + if (current_type) { new_entries[new_nr_entries].addr = change_point[chg_idx]->addr; new_entries[new_nr_entries].type = current_type; last_addr = change_point[chg_idx]->addr; |