From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751480AbdISKhN (ORCPT ); Tue, 19 Sep 2017 06:37:13 -0400 Received: from ozlabs.org ([103.22.144.67]:41285 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751205AbdISKhM (ORCPT ); Tue, 19 Sep 2017 06:37:12 -0400 From: Michael Ellerman To: 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: References: User-Agent: Notmuch/0.21 (https://notmuchmail.org) Date: Tue, 19 Sep 2017 20:37:10 +1000 Message-ID: <87poankm95.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 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