From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751793AbdIULBc (ORCPT ); Thu, 21 Sep 2017 07:01:32 -0400 Received: from ozlabs.org ([103.22.144.67]:48673 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751652AbdIULBb (ORCPT ); Thu, 21 Sep 2017 07:01:31 -0400 From: Michael Ellerman To: cody@codyps.com Cc: David Binderman , "benh\@kernel.crashing.org" , "paulus\@samba.org" , "linuxppc-dev\@lists.ozlabs.org" , "linux-kernel\@vger.kernel.org" Subject: Re: linux-4.14-rc1/arch/powerpc/perf/hv-24x7.c:541: bad condition ? In-Reply-To: <87poankm95.fsf@concordia.ellerman.id.au> References: <87poankm95.fsf@concordia.ellerman.id.au> User-Agent: Notmuch/0.21 (https://notmuchmail.org) Date: Thu, 21 Sep 2017 21:01:28 +1000 Message-ID: <87y3p8b9iv.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ + Cody in case he's still interested] Michael Ellerman writes: > David Binderman writes: > >> Hello there, >> >> linux-4.14-rc1/arch/powerpc/perf/hv-24x7.c:543]: (warning) Identical condition 's1> >> 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