From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751737AbdJIFBy (ORCPT ); Mon, 9 Oct 2017 01:01:54 -0400 Received: from ozlabs.org ([103.22.144.67]:35095 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751390AbdJIFBx (ORCPT ); Mon, 9 Oct 2017 01:01:53 -0400 From: Michael Ellerman To: David Binderman , "benh\@kernel.crashing.org" , "paulus\@samba.org" , "linuxppc-dev\@lists.ozlabs.org" , "linux-kernel\@vger.kernel.org" , anju@linux.vnet.ibm.com Subject: Re: linux-4.14-rc3/arch/powerpc/perf/imc-pmu.c:599: pointless test ? In-Reply-To: References: Date: Mon, 09 Oct 2017 16:01:48 +1100 Message-ID: <87fuasewxv.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-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. 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