All of lore.kernel.org
 help / color / mirror / Atom feed
* linux-4.14-rc1/arch/powerpc/perf/hv-24x7.c:541: bad condition ?
@ 2017-09-18 20:42 David Binderman
  2017-09-19 10:37 ` Michael Ellerman
  0 siblings, 1 reply; 3+ messages in thread
From: David Binderman @ 2017-09-18 20:42 UTC (permalink / raw)
  To: benh, paulus, mpe, linuxppc-dev, linux-kernel

Hello there,

linux-4.14-rc1/arch/powerpc/perf/hv-24x7.c:543]: (warning) Identical condit=
ion 's1<s2', second condition is always false

Source code is

    if (s1 < s2)
        return 1;
    if (s2 > s1)
        return -1;

Suggest code rework.

Regards

David Binderman=

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

* Re: linux-4.14-rc1/arch/powerpc/perf/hv-24x7.c:541: bad condition ?
  2017-09-18 20:42 linux-4.14-rc1/arch/powerpc/perf/hv-24x7.c:541: bad condition ? David Binderman
@ 2017-09-19 10:37 ` Michael Ellerman
  2017-09-21 11:01   ` Michael Ellerman
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Ellerman @ 2017-09-19 10:37 UTC (permalink / raw)
  To: David Binderman, benh, paulus, linuxppc-dev, linux-kernel

David Binderman <dcb314@hotmail.com> writes:

> Hello there,
>
> linux-4.14-rc1/arch/powerpc/perf/hv-24x7.c:543]: (warning) Identical condition 's1<s2', second condition is always false
>
> Source code is
>
>     if (s1 < s2)
>         return 1;
>     if (s2 > s1)
>         return -1;
>
> Suggest code rework.

Um thanks.

It's trying to implement a sort comparison returning -1, 0, 1.

So it's pretty obviously wrong, but also harmless AFAICS, because it's
just an optimisation before doing a full comparison using memcmp().

So yeah we should fix it, but not an actual bug AFAICS.

cheers

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

* Re: linux-4.14-rc1/arch/powerpc/perf/hv-24x7.c:541: bad condition ?
  2017-09-19 10:37 ` Michael Ellerman
@ 2017-09-21 11:01   ` Michael Ellerman
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Ellerman @ 2017-09-21 11:01 UTC (permalink / raw)
  To: cody; +Cc: David Binderman, benh, paulus, linuxppc-dev, linux-kernel

[ + Cody in case he's still interested]

Michael Ellerman <mpe@ellerman.id.au> writes:
> David Binderman <dcb314@hotmail.com> writes:
>
>> Hello there,
>>
>> linux-4.14-rc1/arch/powerpc/perf/hv-24x7.c:543]: (warning) Identical condition 's1<s2', second condition is always false
>>
>> Source code is
>>
>>     if (s1 < s2)
>>         return 1;
>>     if (s2 > s1)
>>         return -1;
>>
>> Suggest code rework.
>
> Um thanks.
>
> It's trying to implement a sort comparison returning -1, 0, 1.
>
> So it's pretty obviously wrong, but also harmless AFAICS, because it's
> just an optimisation before doing a full comparison using memcmp().
>
> So yeah we should fix it, but not an actual bug AFAICS.
>
> cheers

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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-18 20:42 linux-4.14-rc1/arch/powerpc/perf/hv-24x7.c:541: bad condition ? David Binderman
2017-09-19 10:37 ` Michael Ellerman
2017-09-21 11:01   ` Michael Ellerman

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.