xiaoxiang781216 commented on code in PR #6673:
URL: https://github.com/apache/incubator-nuttx/pull/6673#discussion_r927468156


##########
include/nuttx/power/pm.h:
##########
@@ -85,6 +87,14 @@
  * own, custom idle loop to support board-specific IDLE time power management
  */
 
+#define PM_WAKELOCK_INITIALIZER(name, domain, state) {name, domain, state}
+
+#define PM_WAKELOCK_DECLARE(var, name, domain, state) \
+      struct pm_wakelock_s var = PM_WAKELOCK_INITIALIZER(name, domain, state)
+
+#define PM_WAKELOCK_DECLARE_STATIC(var, name, domain, state) \

Review Comment:
   Since PM is optional feature, if we reuse PM_WAKELOCK_DECLARE macro, we have 
to:
   ```
   #ifdef CONFIG_PM
   static PM_WAKELOCK_DECLARE(x, y, z, t);
   #endif
   ```
   On the other hand, we can write more simple code with 
PM_WAKELOCK_DECLARE_STATIC:
   ```
   PM_WAKELOCK_DECLARE_STATIC(x, y, z, t);
   ```



-- 
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]

Reply via email to