From 0e5537b30d3029d784226ab51c2b923d1155b553 Mon Sep 17 00:00:00 2001 From: Sivaram Nair Date: Tue, 18 Dec 2012 13:52:50 +0100 Subject: 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 Reviewed-by: Rik van Riel Signed-off-by: Rafael J. Wysocki --- drivers/cpuidle/cpuidle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/cpuidle/cpuidle.c') diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c index 8df53dd8dbe1..fb4a7dd57f94 100644 --- a/drivers/cpuidle/cpuidle.c +++ b/drivers/cpuidle/cpuidle.c @@ -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; -- cgit v1.2.3