diff options
author | Yinghai Lu <yhlu.kernel@gmail.com> | 2008-09-19 02:55:27 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-09-19 03:16:06 -0400 |
commit | 279b0bbba2bb647348ad90e183b3960aa99eccfd (patch) | |
tree | 1c605b206a48a4b81feea3ce5fce150eee88b1e8 /arch | |
parent | 5e51900be6c15488b80343d3c3e62d4d605ba9a9 (diff) |
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 <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/cpu/mtrr/main.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/x86/kernel/cpu/mtrr/main.c b/arch/x86/kernel/cpu/mtrr/main.c index b117d7f8a564..8a7c79234be6 100644 --- a/arch/x86/kernel/cpu/mtrr/main.c +++ b/arch/x86/kernel/cpu/mtrr/main.c | |||
@@ -1218,11 +1218,10 @@ static int __init mtrr_cleanup(unsigned address_bits) | |||
1218 | 1218 | ||
1219 | memset(range, 0, sizeof(range)); | 1219 | memset(range, 0, sizeof(range)); |
1220 | extra_remove_size = 0; | 1220 | extra_remove_size = 0; |
1221 | if (mtrr_tom2) { | 1221 | extra_remove_base = 1 << (32 - PAGE_SHIFT); |
1222 | extra_remove_base = 1 << (32 - PAGE_SHIFT); | 1222 | if (mtrr_tom2) |
1223 | extra_remove_size = | 1223 | extra_remove_size = |
1224 | (mtrr_tom2 >> PAGE_SHIFT) - extra_remove_base; | 1224 | (mtrr_tom2 >> PAGE_SHIFT) - extra_remove_base; |
1225 | } | ||
1226 | nr_range = x86_get_mtrr_mem_range(range, 0, extra_remove_base, | 1225 | nr_range = x86_get_mtrr_mem_range(range, 0, extra_remove_base, |
1227 | extra_remove_size); | 1226 | extra_remove_size); |
1228 | range_sums = sum_ranges(range, nr_range); | 1227 | range_sums = sum_ranges(range, nr_range); |