From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3y9dYY3cMyzDqlv for ; Mon, 9 Oct 2017 22:38:57 +1100 (AEDT) Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v99BciQ1040143 for ; Mon, 9 Oct 2017 07:38:55 -0400 Received: from e32.co.us.ibm.com (e32.co.us.ibm.com [32.97.110.150]) by mx0a-001b2d01.pphosted.com with ESMTP id 2dg3jd5nnk-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Oct 2017 07:38:54 -0400 Received: from localhost by e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 9 Oct 2017 05:38:54 -0600 Subject: Re: linux-4.14-rc3/arch/powerpc/perf/imc-pmu.c:599: pointless test ? To: Michael Ellerman , David Binderman , "benh@kernel.crashing.org" , "paulus@samba.org" , "linuxppc-dev@lists.ozlabs.org" , "linux-kernel@vger.kernel.org" References: <87fuasewxv.fsf@concordia.ellerman.id.au> From: Anju T Sudhakar Date: Mon, 9 Oct 2017 17:08:47 +0530 MIME-Version: 1.0 In-Reply-To: <87fuasewxv.fsf@concordia.ellerman.id.au> Content-Type: text/plain; charset=utf-8; format=flowed Message-Id: List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Hi David, On Monday 09 October 2017 10:31 AM, Michael Ellerman wrote: > David Binderman writes: >> Hello there, >> >> linux-4.14-rc3/arch/powerpc/perf/imc-pmu.c:599]: (style) Unsigned variable 'ncpu' can't be negative so it is unnecessary to test it. >> >> Source code is >> >> if (ncpu >= 0 && ncpu < nr_cpu_ids) { >> >> but >> >> unsigned int ncpu, core_id; >> >> Suggest remove test. Nice catch. Thanks for mentioning this. I will fix this. Thanks, Anju > Thanks. > > Notifying the author would be more helpful: > > $ git blame -L 599,599 arch/powerpc/perf/imc-pmu.c > 39a846db1d574 (Anju T Sudhakar 2017-07-19 03:06:35 +0530 599) if (ncpu >= 0 && ncpu < nr_cpu_ids) { > $ git log -1 --format=%ae 39a846db1d574 > anju@linux.vnet.ibm.com > > cheers >