From ab828f99afde2fe58623e7db31ece9b170f67bb1 Mon Sep 17 00:00:00 2001 From: Park Bumgyu Date: Thu, 14 Jun 2018 09:43:16 +0900 Subject: [PATCH] sched: ems: fix return type of task_util. The variable type of util_avg is unsigned long. Fix return type of task util to avoid data loss. Change-Id: I463b9fa65f018f4d98804df6f3c62fbbb6ff0951 Signed-off-by: Park Bumgyu --- kernel/sched/ems/core.c | 2 +- kernel/sched/ems/ems.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/sched/ems/core.c b/kernel/sched/ems/core.c index e13179ed3e3e..762266e71c0b 100644 --- a/kernel/sched/ems/core.c +++ b/kernel/sched/ems/core.c @@ -13,7 +13,7 @@ #include "ems.h" #include "../sched.h" -int task_util(struct task_struct *p) +unsigned long task_util(struct task_struct *p) { if (rt_task(p)) return p->rt.avg.util_avg; diff --git a/kernel/sched/ems/ems.h b/kernel/sched/ems/ems.h index 41f83a66dc0c..f558d3c58cde 100644 --- a/kernel/sched/ems/ems.h +++ b/kernel/sched/ems/ems.h @@ -35,7 +35,7 @@ static inline int prefer_idle_cpu(struct task_struct *p) { return -1; } static inline int group_balancing(struct task_struct *p) { return -1; } #endif -extern int task_util(struct task_struct *p); +extern unsigned long task_util(struct task_struct *p); extern int cpu_util_wake(int cpu, struct task_struct *p); extern unsigned long task_util_est(struct task_struct *p); extern inline unsigned int get_cpu_mips(unsigned int cpu); -- 2.20.1