Skip to content

Commit 279b0bb

Browse files
yhluIngo Molnar
authored andcommitted
x86: fix arch/x86/kernel/cpu/mtrr/main.c warning
fix this warning reported by Andrew Morton: > arch/x86/kernel/cpu/mtrr/main.c: In function 'mtrr_bp_init': > arch/x86/kernel/cpu/mtrr/main.c:1170: warning: 'extra_remove_base' may be used uninitialized in this function the warning is bogus but the logic that prevents uninitialized use is a bit convoluted so simplify it all. Signed-off-by: Ingo Molnar <[email protected]>
1 parent 5e51900 commit 279b0bb

File tree

1 file changed

+2
-3
lines changed
  • arch/x86/kernel/cpu/mtrr

1 file changed

+2
-3
lines changed

arch/x86/kernel/cpu/mtrr/main.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1218,11 +1218,10 @@ static int __init mtrr_cleanup(unsigned address_bits)
12181218

12191219
memset(range, 0, sizeof(range));
12201220
extra_remove_size = 0;
1221-
if (mtrr_tom2) {
1222-
extra_remove_base = 1 << (32 - PAGE_SHIFT);
1221+
extra_remove_base = 1 << (32 - PAGE_SHIFT);
1222+
if (mtrr_tom2)
12231223
extra_remove_size =
12241224
(mtrr_tom2 >> PAGE_SHIFT) - extra_remove_base;
1225-
}
12261225
nr_range = x86_get_mtrr_mem_range(range, 0, extra_remove_base,
12271226
extra_remove_size);
12281227
range_sums = sum_ranges(range, nr_range);

0 commit comments

Comments
 (0)