diff options
author | Gustavo A. R. Silva <garsilva@embeddedor.com> | 2018-02-13 13:22:08 -0600 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2018-02-15 01:15:53 +0100 |
commit | 24dbc6000f4b9b0ef5a9daecb161f1907733765a (patch) | |
tree | 52877d24a97802248319ff3525ea151510e3f529 /arch/x86/kernel/cpu/microcode | |
parent | 9de29eac8d2189424d81c0d840cd0469aa3d41c8 (diff) | |
download | lwn-24dbc6000f4b9b0ef5a9daecb161f1907733765a.tar.gz lwn-24dbc6000f4b9b0ef5a9daecb161f1907733765a.zip |
x86/cpu: Change type of x86_cache_size variable to unsigned int
Currently, x86_cache_size is of type int, which makes no sense as we
will never have a valid cache size equal or less than 0. So instead of
initializing this variable to -1, it can perfectly be initialized to 0
and use it as an unsigned variable instead.
Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Addresses-Coverity-ID: 1464429
Link: http://lkml.kernel.org/r/20180213192208.GA26414@embeddedor.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/kernel/cpu/microcode')
-rw-r--r-- | arch/x86/kernel/cpu/microcode/intel.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/microcode/intel.c index b94279bb5c04..a15db2b4e0d6 100644 --- a/arch/x86/kernel/cpu/microcode/intel.c +++ b/arch/x86/kernel/cpu/microcode/intel.c @@ -982,7 +982,7 @@ static struct microcode_ops microcode_intel_ops = { static int __init calc_llc_size_per_core(struct cpuinfo_x86 *c) { - u64 llc_size = c->x86_cache_size * 1024; + u64 llc_size = c->x86_cache_size * 1024ULL; do_div(llc_size, c->x86_max_cores); |