This is an automated email from the ASF dual-hosted git repository.

pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 5b0b4bd586246df133da2cedc58a12bc03a38dba
Author: Xiang Xiao <[email protected]>
AuthorDate: Wed May 18 21:58:18 2022 +0800

    sched/wdog: Change the return type of wd_gettime from int to sclock_t
    
    to handle 64bits sclock_t correctly
    
    Signed-off-by: Xiang Xiao <[email protected]>
---
 drivers/power/activity_governor.c | 6 ++++--
 include/nuttx/wdog.h              | 2 +-
 sched/wdog/wd_gettime.c           | 4 ++--
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/power/activity_governor.c 
b/drivers/power/activity_governor.c
index c124e52b9b..254892ab9e 100644
--- a/drivers/power/activity_governor.c
+++ b/drivers/power/activity_governor.c
@@ -569,8 +569,10 @@ static void governor_timer(int domain)
 
   if (state < PM_SLEEP && !pdom->stay[pdom->state])
     {
-      int delay = pmtick[state] + pdomstate->btime - clock_systime_ticks();
-      int left  = wd_gettime(&pdomstate->wdog);
+      sclock_t delay = pmtick[state] +
+                       pdomstate->btime -
+                       clock_systime_ticks();
+      sclock_t left  = wd_gettime(&pdomstate->wdog);
 
       if (delay <= 0)
         {
diff --git a/include/nuttx/wdog.h b/include/nuttx/wdog.h
index 9df0c5337e..742eb5a067 100644
--- a/include/nuttx/wdog.h
+++ b/include/nuttx/wdog.h
@@ -160,7 +160,7 @@ int wd_cancel(FAR struct wdog_s *wdog);
  *
  ****************************************************************************/
 
-int wd_gettime(FAR struct wdog_s *wdog);
+sclock_t wd_gettime(FAR struct wdog_s *wdog);
 
 #undef EXTERN
 #ifdef __cplusplus
diff --git a/sched/wdog/wd_gettime.c b/sched/wdog/wd_gettime.c
index 429e78a5f6..e407270882 100644
--- a/sched/wdog/wd_gettime.c
+++ b/sched/wdog/wd_gettime.c
@@ -50,7 +50,7 @@
  *
  ****************************************************************************/
 
-int wd_gettime(FAR struct wdog_s *wdog)
+sclock_t wd_gettime(FAR struct wdog_s *wdog)
 {
   irqstate_t flags;
 
@@ -64,7 +64,7 @@ int wd_gettime(FAR struct wdog_s *wdog)
        */
 
       FAR struct wdog_s *curr;
-      int delay = 0;
+      sclock_t delay = 0;
 
       for (curr = (FAR struct wdog_s *)g_wdactivelist.head;
            curr != NULL;

Reply via email to