From: Linus Torvalds Date: Thu, 31 May 2007 14:55:16 +0000 (-0700) Subject: smpboot: fix cachesize comparison in smp_tune_scheduling() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=8387c1a46376b8cfc5f4751b27a6c90f930992cf;p=openwrt%2Fstaging%2Fblogic.git 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 Cc: Ingo Molnar Cc: Nick Piggin Cc: Andi Kleen Cc: Andrew Morton Signed-off-by: Linus Torvalds --- 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: static void smp_tune_scheduling(void) { - unsigned long cachesize; /* kB */ - if (cpu_khz) { - cachesize = boot_cpu_data.x86_cache_size; + /* cache size in kB */ + long cachesize = boot_cpu_data.x86_cache_size; if (cachesize > 0) max_cache_size = cachesize * 1024;