From: Patrick Bellasi Date: Tue, 28 Mar 2017 09:13:20 +0000 (+0100) Subject: sched/fair: always used unsigned long for utilization X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9378b808908c76ddfd1ec768fc146ff055fb1cc4;p=platform%2Fkernel%2Flinux-exynos.git sched/fair: always used unsigned long for utilization Utilization and capacity are tracked as unsigned long, however some functions using them return an int which is ultimately assigned back to unsigned long variables. Since there is not scope on using a different and signed type, this consolidate the signature of functions returning utilization to always use the native type. As well as improving code consistency this is expected also benefits code paths where utilizations should be clamped by avoiding further type conversions or ugly type casts. Signed-off-by: Patrick Bellasi Reviewed-by: Chris Redpath Reviewed-by: Brendan Jackman Reviewed-by: Dietmar Eggemann Cc: Ingo Molnar Cc: Peter Zijlstra Cc: Vincent Guittot Cc: Morten Rasmussen Cc: Dietmar Eggemann Cc: linux-kernel@vger.kernel.org Signed-off-by: Lukasz Luba --- diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index d56d33dd94b5..47b56833a146 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -6060,8 +6060,8 @@ static int wake_affine(struct sched_domain *sd, struct task_struct *p, return affine; } -static inline int task_util(struct task_struct *p); -static int cpu_util_wake(int cpu, struct task_struct *p); +static inline unsigned long task_util(struct task_struct *p); +static unsigned long cpu_util_wake(int cpu, struct task_struct *p); static unsigned long capacity_spare_wake(int cpu, struct task_struct *p) { @@ -6516,7 +6516,7 @@ static int select_idle_sibling(struct task_struct *p, int prev, int target) return target; } -static inline int task_util(struct task_struct *p) +static inline unsigned long task_util(struct task_struct *p) { return p->se.avg.util_avg; } @@ -6525,7 +6525,7 @@ static inline int task_util(struct task_struct *p) * cpu_util_wake: Compute cpu utilization with any contributions from * the waking task p removed. */ -static int cpu_util_wake(int cpu, struct task_struct *p) +static unsigned long cpu_util_wake(int cpu, struct task_struct *p) { unsigned long util, capacity;