From: Michael Ellerman <mpe@ellerman.id.au>
To: cody@codyps.com
Cc: David Binderman <dcb314@hotmail.com>,
"benh\@kernel.crashing.org" <benh@kernel.crashing.org>,
"paulus\@samba.org" <paulus@samba.org>,
"linuxppc-dev\@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
"linux-kernel\@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: linux-4.14-rc1/arch/powerpc/perf/hv-24x7.c:541: bad condition ?
Date: Thu, 21 Sep 2017 21:01:28 +1000 [thread overview]
Message-ID: <87y3p8b9iv.fsf@concordia.ellerman.id.au> (raw)
In-Reply-To: <87poankm95.fsf@concordia.ellerman.id.au>
[ + 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
prev parent reply other threads:[~2017-09-21 11:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <HE1PR0802MB2331572C98E215722EE4411C9C630@HE1PR0802MB2331.eurprd08.prod.outlook.com>
2017-09-19 10:37 ` Michael Ellerman
2017-09-21 11:01 ` Michael Ellerman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y3p8b9iv.fsf@concordia.ellerman.id.au \
--to=mpe@ellerman.id.au \
--cc=benh@kernel.crashing.org \
--cc=cody@codyps.com \
--cc=dcb314@hotmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=paulus@samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®