From: Brendan Jackman Date: Thu, 5 Oct 2017 11:45:13 +0000 (+0100) Subject: sched/fair: Remove unnecessary comparison with -1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1e579f6ddd1f74e9b18ba7e41deb11d3465515fc;p=platform%2Fkernel%2Flinux-exynos.git sched/fair: Remove unnecessary comparison with -1 Since commit: 83a0a96a5f26 ("sched/fair: Leverage the idle state info when choosing the "idlest" cpu") find_idlest_group_cpu() (formerly find_idlest_cpu) no longer returns -1, so we can simplify the checking of the return value in find_idlest_cpu(). Signed-off-by: Brendan Jackman Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Josef Bacik Reviewed-by: Vincent Guittot Cc: Dietmar Eggemann Cc: Josef Bacik Cc: Linus Torvalds Cc: Mike Galbraith Cc: Morten Rasmussen Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20171005114516.18617-3-brendan.jackman@arm.com Signed-off-by: Ingo Molnar Signed-off-by: Lukasz Luba --- diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 2f336bdeef2c..46637a005c4f 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5934,7 +5934,7 @@ static inline int find_idlest_cpu(struct sched_domain *sd, struct task_struct *p } new_cpu = find_idlest_group_cpu(group, p, cpu); - if (new_cpu == -1 || new_cpu == cpu) { + if (new_cpu == cpu) { /* Now try balancing at a lower domain level of cpu */ sd = sd->child; continue;