Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755390AbbHLOgx (ORCPT ); Wed, 12 Aug 2015 10:36:53 -0400 Received: from foss.arm.com ([217.140.101.70]:58736 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753075AbbHLOgw (ORCPT ); Wed, 12 Aug 2015 10:36:52 -0400 Date: Wed, 12 Aug 2015 15:40:10 +0100 From: Morten Rasmussen To: Peter Zijlstra Cc: mingo@redhat.com, vincent.guittot@linaro.org, daniel.lezcano@linaro.org, Dietmar Eggemann , yuyang.du@intel.com, mturquette@baylibre.com, rjw@rjwysocki.net, Juri Lelli , sgurrappadi@nvidia.com, pang.xunlei@zte.com.cn, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: Re: [RFCv5 PATCH 20/46] sched: Relocated get_cpu_usage() and change return type Message-ID: <20150812144010.GB29326@e105550-lin.cambridge.arm.com> References: <1436293469-25707-1-git-send-email-morten.rasmussen@arm.com> <1436293469-25707-21-git-send-email-morten.rasmussen@arm.com> <20150812105923.GX19282@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150812105923.GX19282@twins.programming.kicks-ass.net> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 889 Lines: 25 On Wed, Aug 12, 2015 at 12:59:23PM +0200, Peter Zijlstra wrote: > On Tue, Jul 07, 2015 at 07:24:03PM +0100, Morten Rasmussen wrote: > > +static unsigned long get_cpu_usage(int cpu) > > +{ > > + int sum; > > + unsigned long usage = cpu_rq(cpu)->cfs.utilization_load_avg; > > + unsigned long blocked = cpu_rq(cpu)->cfs.utilization_blocked_avg; > > + unsigned long capacity_orig = capacity_orig_of(cpu); > > + > > + sum = usage + blocked; > > + > > + if (sum >= capacity_orig) > > + return capacity_orig; > > + > > + return sum; > > +} > > Should sum then not also be unsigned long? Yes it should. So much for my attempt at fixing the types :( -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/