Skip to content

Commit

Permalink
cpuidle: ladder governor - use macro instead of hardcoded value
Browse files Browse the repository at this point in the history
use CPUIDLE_DRIVER_STATE_START, instead of hardcoded value 0. As,
CPUIDLE_DRIVER_STATE_START can be 1/0 based on
CONFIG_ARCH_HAS_CPU_RELAX is defined or not.

Signed-off-by: Mohammad Merajul Islam Molla <meraj.enigma@gmail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Mohammad Merajul Islam Molla authored and Rafael J. Wysocki committed Jul 28, 2014
1 parent 6ee7f5d commit 1469244
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/cpuidle/governors/ladder.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ static int ladder_enable_device(struct cpuidle_driver *drv,

ldev->last_state_idx = CPUIDLE_DRIVER_STATE_START;

for (i = 0; i < drv->state_count; i++) {
for (i = CPUIDLE_DRIVER_STATE_START; i < drv->state_count; i++) {
state = &drv->states[i];
lstate = &ldev->states[i];

Expand All @@ -156,7 +156,7 @@ static int ladder_enable_device(struct cpuidle_driver *drv,

if (i < drv->state_count - 1)
lstate->threshold.promotion_time = state->exit_latency;
if (i > 0)
if (i > CPUIDLE_DRIVER_STATE_START)
lstate->threshold.demotion_time = state->exit_latency;
}

Expand Down

0 comments on commit 1469244

Please sign in to comment.