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


##########
sched/wdog/wd_gettime.c:
##########
@@ -54,14 +54,13 @@
 
 sclock_t wd_gettime(FAR struct wdog_s *wdog)
 {
-  sclock_t delay;
+  sclock_t delay = 0;
 
-  if (wdog == NULL || !WDOG_ISACTIVE(wdog))
+  if (wdog && WDOG_ISACTIVE(wdog))
     {
-      return 0;
+      delay = (sclock_t)(wdog->expired - clock_systime_ticks());
+      delay = delay < 0 ? 0 : delay;

Review Comment:
   Thank you for the suggestion.



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