Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752530AbdFVO2c (ORCPT ); Thu, 22 Jun 2017 10:28:32 -0400 Received: from mail-pf0-f176.google.com ([209.85.192.176]:36372 "EHLO mail-pf0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752380AbdFVO2a (ORCPT ); Thu, 22 Jun 2017 10:28:30 -0400 Date: Thu, 22 Jun 2017 19:58:16 +0530 From: Viresh Kumar To: Juri Lelli Cc: Greg Kroah-Hartman , linux-arm-kernel@lists.infradead.org, Catalin Marinas , linux@arm.linux.org.uk, Will Deacon , Vincent Guittot , arnd.bergmann@linaro.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH V2 4/5] arch_topology: Return 0 or -ve errors from topology_parse_cpu_capacity() Message-ID: <20170622142816.GC6314@vireshk-i7> References: <2213a1f0657ef057dd775085943b362dc3e9757d.1498019799.git.viresh.kumar@linaro.org> <20170622093957.vlhacauj4vff64bv@e106622-lin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170622093957.vlhacauj4vff64bv@e106622-lin> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1235 Lines: 39 On 22-06-17, 10:39, Juri Lelli wrote: > Hi, > > On 21/06/17 10:16, Viresh Kumar wrote: > > Use the standard way of returning errors instead of returning 0(failure) > > OR 1(success) and making it hard to read. > > > > Signed-off-by: Viresh Kumar > > --- > > arch/arm/kernel/topology.c | 2 +- > > drivers/base/arch_topology.c | 8 ++++---- > > 2 files changed, 5 insertions(+), 5 deletions(-) > > > > diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c > > index bf949a763dbe..a7ef4c35855e 100644 > > --- a/arch/arm/kernel/topology.c > > +++ b/arch/arm/kernel/topology.c > > @@ -111,7 +111,7 @@ static void __init parse_dt_topology(void) > > continue; > > } > > > > - if (topology_parse_cpu_capacity(cn, cpu)) { > > + if (!topology_parse_cpu_capacity(cn, cpu)) { > > Not sure why you want to change this. I just didn't find it straight forward to read. > I currently read it as "if cpu_capacity parsing succedeed" continue with > next CPU, otherwise we set cap_from_dt to false and fall back to using > efficiencies. Actually, I can just make the return type bool and that should solve the issues I was seeing and keep the code as it is. Will that be fine ? -- viresh