mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 17:33:08 +08:00
power: change pm_count to pm_empty to optimize speed
Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
@@ -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 -
|
||||
|
||||
@@ -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++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user