pkarashchenko commented on code in PR #7033:
URL: https://github.com/apache/incubator-nuttx/pull/7033#discussion_r992649770


##########
include/nuttx/clock.h:
##########
@@ -251,6 +251,19 @@ EXTERN volatile clock_t g_system_ticks;
  * Public Function Prototypes
  ****************************************************************************/
 
+#define timespec_from_tick(ts, tick) \
+  do \
+    { \
+      clock_t _tick = (tick); \
+      (ts)->tv_sec = _tick / TICK_PER_SEC; \
+      _tick -= (clock_t)(ts)->tv_sec * TICK_PER_SEC; \
+      (ts)->tv_nsec = (clock_t)_tick * NSEC_PER_TICK; \

Review Comment:
   ```suggestion
         (ts)->tv_nsec = _tick * NSEC_PER_TICK; \
   ```
   since `_tick` is already `clock_t` type



-- 
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: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to