cpuidle: governor: menu: Initialize power usage to max
Prashant Gaikwad [Mon, 23 Apr 2012 12:41:58 +0000 (17:41 +0530)]
power_usage variable data type changed from unsigned int
to int. -1 for unsigned int is max whereas for int it is
less than 0. s->power_usage < power_usage always fails since
power usage specified for Tegra CPU states is greater
or equal to 0.

Bug 971668

Change-Id: If2197f1c973e5774c3c46e2c1ac6ec83051d4e19
Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-on: http://git-master/r/98204
Reviewed-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>

drivers/cpuidle/governors/menu.c

index e8ddb44..a43a524 100644 (file)
@@ -240,7 +240,7 @@ static int menu_select(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;