power: change pm_count to pm_empty to optimize speed

Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
ligd
2022-07-25 14:36:44 +08:00
committed by Xiang Xiao
parent 487771033d
commit 3ea2dbb7b4
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -508,7 +508,7 @@ static enum pm_state_e governor_checkstate(int domain)
for (index = 0; index < pdomstate->recommended; index++)
{
if (dq_count(&pdom->wakelock[index]) != 0)
if (!dq_empty(&pdom->wakelock[index]))
{
pdomstate->recommended = index;
break;
@@ -567,7 +567,7 @@ static void governor_timer(int domain)
pdomstate = &g_pm_activity_governor.domain_states[domain];
state = pdom->state;
if (state < PM_SLEEP && !dq_count(&pdom->wakelock[state]))
if (state < PM_SLEEP && dq_empty(&pdom->wakelock[state]))
{
sclock_t delay = pmtick[state] +
pdomstate->btime -
+1 -1
View File
@@ -122,7 +122,7 @@ static enum pm_state_e greedy_governor_checkstate(int domain)
{
/* Find the lowest power-level which is not locked. */
while (!dq_count(&pdom->wakelock[state]) && state < (PM_COUNT - 1))
while (dq_empty(&pdom->wakelock[state]) && state < (PM_COUNT - 1))
{
state++;
}