lkml.org 
[lkml]   [2017]   [Sep]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: linux-4.14-rc1/arch/powerpc/perf/hv-24x7.c:541: bad condition ?
Date
[ + 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

\
 
 \ /
  Last update: 2017-09-21 19:30    [W:0.028 / U:2.280 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site