diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2017-11-20 21:45:56 +0300 |
---|---|---|
committer | Bin Meng <bmeng.cn@gmail.com> | 2017-11-30 08:50:17 +0300 |
commit | 39670c341f0598dd00e5124deb5b479bf674b949 (patch) | |
tree | 3bfb7a4df0858128984b4a1feaaef2479c0f9b8b | |
parent | a2c0eed4e0f31dd822379d98fb25c0d24123d92f (diff) | |
download | u-boot-39670c341f0598dd00e5124deb5b479bf674b949.tar.xz |
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>
-rw-r--r-- | arch/x86/cpu/cpu.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c index e13786efa5..1c42584e76 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; |