xiaoxiang781216 commented on code in PR #3639:
URL: https://github.com/apache/nuttx-apps/pull/3639#discussion_r3584595116


##########
testing/drivers/drivertest/drivertest_watchdog.c:
##########
@@ -291,6 +292,141 @@ static int capture_callback(int irq, FAR void *context, 
FAR void *arg)
   return OK;
 }
 
+#ifdef CONFIG_WATCHDOG_TIMEOUT_NOTIFIER
+
+struct watchdog_notifier_test_nb_s
+{
+  struct notifier_block nb;
+  int                    id;
+};
+
+struct watchdog_notifier_test_ctx_s
+{
+  unsigned int  calls;
+  unsigned long action[8];
+  FAR void     *data[8];
+  int           id[8];
+};
+
+static FAR struct watchdog_notifier_test_ctx_s *g_notifier_test_ctx;
+
+static int watchdog_notifier_test_callback(FAR struct notifier_block *nb,
+                                            unsigned long action,
+                                            FAR void *data)
+{
+  FAR struct watchdog_notifier_test_nb_s *test_nb;
+  unsigned int index;
+
+  test_nb = (FAR struct watchdog_notifier_test_nb_s *)
+            ((FAR char *)nb - offsetof(struct watchdog_notifier_test_nb_s,

Review Comment:
   call container_of



##########
testing/drivers/drivertest/Makefile:
##########
@@ -26,6 +26,11 @@ PRIORITY  = $(CONFIG_TESTING_DRIVER_TEST_PRIORITY)
 STACKSIZE = $(CONFIG_TESTING_DRIVER_TEST_STACKSIZE)
 MODULE    = $(CONFIG_TESTING_DRIVER_TEST)
 
+ifeq ($(CONFIG_TESTING_DRIVER_TEST_WATCHDOG_ONLY),y)
+MAINSRC  += drivertest_watchdog.c
+PROGNAME += cmocka_driver_watchdog
+else

Review Comment:
   why skip other wdog test



##########
testing/drivers/drivertest/drivertest_watchdog.c:
##########
@@ -291,6 +292,141 @@ static int capture_callback(int irq, FAR void *context, 
FAR void *arg)
   return OK;
 }
 
+#ifdef CONFIG_WATCHDOG_TIMEOUT_NOTIFIER
+
+struct watchdog_notifier_test_nb_s

Review Comment:
   why not merge into wdg_state_s



##########
testing/drivers/drivertest/drivertest_watchdog.c:
##########
@@ -291,6 +299,222 @@ static int capture_callback(int irq, FAR void *context, 
FAR void *arg)
   return OK;
 }
 
+#ifdef CONFIG_WATCHDOG_TIMEOUT_NOTIFIER
+
+struct watchdog_notifier_test_nb_s
+{
+  struct notifier_block nb;
+  int                    id;

Review Comment:
   let's remove one extra space



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