summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2017-11-20 19:45:56 +0100
committerBin Meng <bmeng.cn@gmail.com>2017-11-30 13:50:17 +0800
commit39670c341f0598dd00e5124deb5b479bf674b949 (patch)
tree3bfb7a4df0858128984b4a1feaaef2479c0f9b8b /arch
parenta2c0eed4e0f31dd822379d98fb25c0d24123d92f (diff)
x86: don't compare pointers to 0
x86_vendor_name is defined as static const char *const x86_vendor_name[] So its elements should not be compared to 0. Remove superfluous paranthesis. Problem identified with Coccinelle. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/cpu/cpu.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c
index e13786efa59..1c42584e76f 100644
--- a/arch/x86/cpu/cpu.c
+++ b/arch/x86/cpu/cpu.c
@@ -143,8 +143,8 @@ const char *cpu_vendor_name(int vendor)
{
const char *name;
name = "<invalid cpu vendor>";
- if ((vendor < (ARRAY_SIZE(x86_vendor_name))) &&
- (x86_vendor_name[vendor] != 0))
+ if (vendor < ARRAY_SIZE(x86_vendor_name) &&
+ x86_vendor_name[vendor])
name = x86_vendor_name[vendor];
return name;