wangchdo commented on code in PR #17642:
URL: https://github.com/apache/nuttx/pull/17642#discussion_r2660474945


##########
include/nuttx/hrtimer.h:
##########
@@ -97,11 +84,11 @@ struct hrtimer_node_s
 
 struct hrtimer_s
 {
-  hrtimer_node_t          node;    /* RB-tree node for sorted insertion */
-  enum hrtimer_state_e    state;   /* Current timer state */
-  hrtimer_cb              func;    /* Expiration callback function */
-  FAR void               *arg;     /* Argument passed to callback */
-  uint64_t                expired; /* Absolute expiration time (ns) */
+  hrtimer_node_t node;   /* RB-tree node for sorted insertion */
+  hrtimer_cb func;       /* Expiration callback function */
+  FAR void *arg;         /* Argument passed to callback */

Review Comment:
   Agree, removed arg struct member



##########
sched/hrtimer/hrtimer_start.c:
##########
@@ -141,8 +89,18 @@ int hrtimer_start(FAR hrtimer_t *hrtimer,
 
   /* Insert the timer into the RB-tree */
 
-  ret = hrtimer_insert(hrtimer);
+  RB_INSERT(hrtimer_tree_s, &g_hrtimer_tree, &hrtimer->node);
+
+  /* If the inserted timer is now the earliest, start hardware timer */
+
+  if (&hrtimer->node == RB_MIN(hrtimer_tree_s, &g_hrtimer_tree))

Review Comment:
   Agree, updated.



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