mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
cpuidle: Fix finding state with min power_usage
Since cpuidle_state.power_usage is a signed value, use INT_MAX (instead of -1) to init the local copies so that functions that tries to find cpuidle states with minimum power usage works correctly even if they use non-negative values. Signed-off-by: Sivaram Nair <[email protected]> Reviewed-by: Rik van Riel <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
This commit is contained in:
parent
d1c3ed669a
commit
0e5537b30d
2 changed files with 2 additions and 2 deletions
|
|
@ -70,7 +70,7 @@ int cpuidle_play_dead(void)
|
|||
struct cpuidle_device *dev = __this_cpu_read(cpuidle_devices);
|
||||
struct cpuidle_driver *drv = cpuidle_get_cpu_driver(dev);
|
||||
int i, dead_state = -1;
|
||||
int power_usage = -1;
|
||||
int power_usage = INT_MAX;
|
||||
|
||||
if (!drv)
|
||||
return -ENODEV;
|
||||
|
|
|
|||
|
|
@ -312,7 +312,7 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
|
|||
{
|
||||
struct menu_device *data = &__get_cpu_var(menu_devices);
|
||||
int latency_req = pm_qos_request(PM_QOS_CPU_DMA_LATENCY);
|
||||
int power_usage = -1;
|
||||
int power_usage = INT_MAX;
|
||||
int i;
|
||||
int multiplier;
|
||||
struct timespec t;
|
||||
|
|
|
|||
Loading…
Reference in a new issue