]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
x86: don't compare pointers to 0
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Mon, 20 Nov 2017 18:45:56 +0000 (19:45 +0100)
committerBin Meng <bmeng.cn@gmail.com>
Thu, 30 Nov 2017 05:50:17 +0000 (13:50 +0800)
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>
arch/x86/cpu/cpu.c

index e13786efa590018e2a8b9357d12caad66095a4d6..1c42584e76f89178ea7232c695f9a03ffd87de99 100644 (file)
@@ -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;