diff options
| author | Gustavo A. R. Silva <garsilva@embeddedor.com> | 2018-02-13 13:22:08 -0600 | 
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-02-22 15:42:24 +0100 | 
| commit | 231d0c70be748bba8982b6bda3daa613bf5c8a29 (patch) | |
| tree | 224ee7cf7244d1a1ff14de5a44c00779b8253680 /arch/x86/kernel/cpu/common.c | |
| parent | 7d7ebee6ce113fff252f1b923fbbbad83b1221b8 (diff) | |
x86/cpu: Change type of x86_cache_size variable to unsigned int
commit 24dbc6000f4b9b0ef5a9daecb161f1907733765a upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/x86/kernel/cpu/common.c')
| -rw-r--r-- | arch/x86/kernel/cpu/common.c | 2 | 
1 files changed, 1 insertions, 1 deletions
| diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 74dcb2127fd8..651b7afed4da 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -1160,7 +1160,7 @@ static void identify_cpu(struct cpuinfo_x86 *c)  	int i;  	c->loops_per_jiffy = loops_per_jiffy; -	c->x86_cache_size = -1; +	c->x86_cache_size = 0;  	c->x86_vendor = X86_VENDOR_UNKNOWN;  	c->x86_model = c->x86_stepping = 0;	/* So far unknown... */  	c->x86_vendor_id[0] = '\0'; /* Unset */ | 
