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

Commit 8c6851ab authored by Maulik Shah's avatar Maulik Shah
Browse files

lpm-levels: Remove check for non negative LPM level selected



cpu power select will always return non negative LPM level.
Remove check for non negative best level.

Change-Id: I127dd4a0026fd8123b3d689d1da942d9eec16f28
Signed-off-by: default avatarMaulik Shah <mkshah@codeaurora.org>
parent d8f81fe4
Loading
Loading
Loading
Loading
+2 −3
Original line number Original line Diff line number Diff line
@@ -606,7 +606,7 @@ static int cpu_power_select(struct cpuidle_device *dev,
	struct power_params *pwr_params;
	struct power_params *pwr_params;


	if ((sleep_disabled && !cpu_isolated(dev->cpu)) || sleep_us < 0)
	if ((sleep_disabled && !cpu_isolated(dev->cpu)) || sleep_us < 0)
		return 0;
		return best_level;


	idx_restrict = cpu->nlevels + 1;
	idx_restrict = cpu->nlevels + 1;


@@ -683,8 +683,7 @@ static int cpu_power_select(struct cpuidle_device *dev,
	max_residency = pwr_params->max_residency;
	max_residency = pwr_params->max_residency;


	if ((predicted || (idx_restrict != (cpu->nlevels + 1)))
	if ((predicted || (idx_restrict != (cpu->nlevels + 1)))
			&& ((best_level >= 0)
			&& (best_level < (cpu->nlevels-1))) {
			&& (best_level < (cpu->nlevels-1)))) {
		htime = predicted + cpu->tmr_add;
		htime = predicted + cpu->tmr_add;
		if (htime == cpu->tmr_add)
		if (htime == cpu->tmr_add)
			htime = idx_restrict_time;
			htime = idx_restrict_time;