sched/fair: Simplify idle_idx handling in select_idle_sibling()
authorDietmar Eggemann <dietmar.eggemann@arm.com>
Mon, 16 Jan 2017 12:42:59 +0000 (12:42 +0000)
committerAmit Pundir <amit.pundir@linaro.org>
Wed, 21 Jun 2017 11:07:32 +0000 (16:37 +0530)
commit674c738269d71c960367ef21fbd20eaadf4d8ae8
tree721bb096ab8bb352f68782a3e1ac01210f9c55e7
parent8b4d10e09b630d0dc2dda0803a583b18bfd7eea1
sched/fair: Simplify idle_idx handling in select_idle_sibling()

Rename best_idle to best_idle_cpu so the same name is used like in
find_best_target().

Fix if (best_idle > 0) since best_idle_cpu = 0 is a valid target.

Use 'unsigned long' data type for best_idle_capacity.

Since we're looking for the shallowest best_idle_cstate initialize
best_idle_cstate = INT_MAX. For cpus which are not idle (idle_idx = -1)
the condition 'if (idle_idx < best_idle_cstate && ...)' is never
executed.

Change-Id: Ic5b63d58478696b3d1ec6253cf739a69a574cf99
Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
(cherry picked from commit 8bff5e9c0968108d465e1f2a4624fc5ec2f00849)
Signed-off-by: Chris Redpath <chris.redpath@arm.com>
kernel/sched/fair.c