Re: [RFCv5 PATCH 20/46] sched: Relocated get_cpu_usage() and change return type

From: Peter Zijlstra
Date: Wed Aug 12 2015 - 06:59:33 EST


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?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/