All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2 1/1] x86: don't compare pointers to 0
@ 2017-11-20 18:45 Heinrich Schuchardt
  2017-11-21  6:11 ` Bin Meng
  0 siblings, 1 reply; 3+ messages in thread
From: Heinrich Schuchardt @ 2017-11-20 18:45 UTC (permalink / raw
  To: u-boot

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>
---
v2
	remove further parathesis
---
 arch/x86/cpu/cpu.c | 4 ++--
 1 file 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;
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH v2 1/1] x86: don't compare pointers to 0
  2017-11-20 18:45 [U-Boot] [PATCH v2 1/1] x86: don't compare pointers to 0 Heinrich Schuchardt
@ 2017-11-21  6:11 ` Bin Meng
  2017-11-21  9:25   ` Bin Meng
  0 siblings, 1 reply; 3+ messages in thread
From: Bin Meng @ 2017-11-21  6:11 UTC (permalink / raw
  To: u-boot

On Tue, Nov 21, 2017 at 2:45 AM, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
> 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>
> ---
> v2
>         remove further parathesis
> ---
>  arch/x86/cpu/cpu.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH v2 1/1] x86: don't compare pointers to 0
  2017-11-21  6:11 ` Bin Meng
@ 2017-11-21  9:25   ` Bin Meng
  0 siblings, 0 replies; 3+ messages in thread
From: Bin Meng @ 2017-11-21  9:25 UTC (permalink / raw
  To: u-boot

On Tue, Nov 21, 2017 at 2:11 PM, Bin Meng <bmeng.cn@gmail.com> wrote:
> On Tue, Nov 21, 2017 at 2:45 AM, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>> 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>
>> ---
>> v2
>>         remove further parathesis
>> ---
>>  arch/x86/cpu/cpu.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

applied to u-boot-x86, thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-11-21  9:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-20 18:45 [U-Boot] [PATCH v2 1/1] x86: don't compare pointers to 0 Heinrich Schuchardt
2017-11-21  6:11 ` Bin Meng
2017-11-21  9:25   ` Bin Meng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.