Fix-Point commented on code in PR #17640:
URL: https://github.com/apache/nuttx/pull/17640#discussion_r2642186322


##########
sched/wdog/wd_cancel.c:
##########
@@ -61,36 +61,33 @@
 int wd_cancel(FAR struct wdog_s *wdog)
 {
   irqstate_t flags;
-  bool head;
+  bool       reassess = false;
+  int        ret      = -EINVAL;
 
   flags = enter_critical_section();
 
   /* Make sure that the watchdog is valid and still active. */
 
-  if (wdog == NULL || !WDOG_ISACTIVE(wdog))
+  if (wdog != NULL && WDOG_ISACTIVE(wdog))
     {
-      leave_critical_section(flags);
-      return -EINVAL;
-    }
-
-  sched_note_wdog(NOTE_WDOG_CANCEL, (FAR void *)wdog->func,
-                  (FAR void *)(uintptr_t)wdog->expired);
+      /* Prohibit timer interactions with the timer queue until the
+       * cancellation is complete
+       */
 
-  /* Prohibit timer interactions with the timer queue until the
-   * cancellation is complete
-   */
+      reassess = list_is_head(&g_wdactivelist, &wdog->node);
 
-  head = list_is_head(&g_wdactivelist, &wdog->node);
+      /* Now, remove the watchdog from the timer queue */
 
-  /* Now, remove the watchdog from the timer queue */
+      list_delete(&wdog->node);
 
-  list_delete_fast(&wdog->node);

Review Comment:
   > why do you switch to list_delete? I would suggest you seperate the new 
change to new pr.
   
   Sorry for this mistake when fixing the cherry-picked commit. 



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