xiaoxiang781216 commented on code in PR #6673:
URL: https://github.com/apache/incubator-nuttx/pull/6673#discussion_r927486781
##########
drivers/power/activity_governor.c:
##########
@@ -508,7 +508,7 @@ static enum pm_state_e governor_checkstate(int domain)
for (index = 0; index < pdomstate->recommended; index++)
{
- if (pdom->stay[index] != 0)
+ if (dq_count(&pdom->wakelock[index]) != 0)
Review Comment:
let's check empty instead
##########
drivers/power/activity_governor.c:
##########
@@ -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 && !pdom->stay[pdom->state])
+ if (state < PM_SLEEP && !dq_count(&pdom->wakelock[state]))
Review Comment:
let's check empty instead
##########
drivers/power/greedy_governor.c:
##########
@@ -122,7 +122,7 @@ static enum pm_state_e greedy_governor_checkstate(int
domain)
{
/* Find the lowest power-level which is not locked. */
- while (!pdom->stay[state] && state < (PM_COUNT - 1))
+ while (!dq_count(&pdom->wakelock[state]) && state < (PM_COUNT - 1))
Review Comment:
let's check empty instead
##########
include/nuttx/power/pm.h:
##########
@@ -631,13 +801,27 @@ void pm_auto_updatestate(int domain);
* avoid so much conditional compilation in driver code when PM is disabled:
*/
+# define PM_WAKELOCK_INITIALIZER(n,d,s) {0}
Review Comment:
should not, maybe we can directly use `{{NULL, NULL}, name, domain, state,
0}` in PM_WAKELOCK_INITIALIZER.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]