Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 14692446 authored by Mohammad Merajul Islam Molla's avatar Mohammad Merajul Islam Molla Committed by Rafael J. Wysocki
Browse files

cpuidle: ladder governor - use macro instead of hardcoded value



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: default avatarMohammad Merajul Islam Molla <meraj.enigma@gmail.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 6ee7f5dd
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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];

@@ -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;
	}