From: Heinrich Schuchardt Date: Mon, 20 Nov 2017 18:45:56 +0000 (+0100) Subject: x86: don't compare pointers to 0 X-Git-Tag: v2018.01-rc1~28^2~3 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=39670c341f0598dd00e5124deb5b479bf674b949;p=u-boot 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 Reviewed-by: Bin Meng --- 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 = ""; - 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;