You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/12/01 09:42:26 UTC
[GitHub] [nuttx] masayuki2009 commented on a diff in pull request #7744: arch: risc-v: Fix nsec overflow in riscv_mtimer_current()
masayuki2009 commented on code in PR #7744:
URL: https://github.com/apache/nuttx/pull/7744#discussion_r1036891552
##########
arch/risc-v/src/common/riscv_mtimer.c:
##########
@@ -290,7 +290,7 @@ static int riscv_mtimer_current(struct oneshot_lowerhalf_s *lower,
struct riscv_mtimer_lowerhalf_s *priv =
(struct riscv_mtimer_lowerhalf_s *)lower;
uint64_t mtime = riscv_mtimer_get_mtime(priv);
- uint64_t nsec = mtime * NSEC_PER_SEC / priv->freq;
+ uint64_t nsec = mtime * (NSEC_PER_SEC / priv->freq);
Review Comment:
@pkarashchenko
Thanks for the suggestion. I confirmed the above code works.
--
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-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org