diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-31 10:55:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-31 10:55:16 -0400 |
commit | 8387c1a46376b8cfc5f4751b27a6c90f930992cf (patch) | |
tree | bdb1553b17a20fe2dcd928d5aec1d20789760e20 | |
parent | a2b7d2e97edcad0e95ae0d3c253d3f2f69254fa4 (diff) |
smpboot: fix cachesize comparison in smp_tune_scheduling()
Jarek Poplawski noted that boot_cpu_data.x86_cache_size is signed int
and can be < 0 too.
In fact we test for it. Except we assigned it to an unsigned value..
Cc: Jarek Poplawski <jarkao2@o2.pl>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Andi Kleen <ak@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | arch/i386/kernel/smpboot.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c index 08f07a74a9d3..88baed1e7e83 100644 --- a/arch/i386/kernel/smpboot.c +++ b/arch/i386/kernel/smpboot.c | |||
@@ -943,10 +943,9 @@ exit: | |||
943 | 943 | ||
944 | static void smp_tune_scheduling(void) | 944 | static void smp_tune_scheduling(void) |
945 | { | 945 | { |
946 | unsigned long cachesize; /* kB */ | ||
947 | |||
948 | if (cpu_khz) { | 946 | if (cpu_khz) { |
949 | cachesize = boot_cpu_data.x86_cache_size; | 947 | /* cache size in kB */ |
948 | long cachesize = boot_cpu_data.x86_cache_size; | ||
950 | 949 | ||
951 | if (cachesize > 0) | 950 | if (cachesize > 0) |
952 | max_cache_size = cachesize * 1024; | 951 | max_cache_size = cachesize * 1024; |