You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by pk...@apache.org on 2024/02/16 20:16:36 UTC

(nuttx) branch master updated: rpmsg/ping: Replace UINT_MAX with CLOCK_MAX

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/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 42dad89211 rpmsg/ping: Replace UINT_MAX with CLOCK_MAX
42dad89211 is described below

commit 42dad89211f2d34f62c103a7647bd64e466a0215
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Fri Feb 16 14:15:30 2024 +0800

    rpmsg/ping: Replace UINT_MAX with CLOCK_MAX
    
    since clock_t may map to either 32-bit or 64-bit integer type,
    UINT_MAX may not be the maximum value of clock_t.
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 drivers/rpmsg/rpmsg_ping.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rpmsg/rpmsg_ping.c b/drivers/rpmsg/rpmsg_ping.c
index fb8e2e739e..883392a4a2 100644
--- a/drivers/rpmsg/rpmsg_ping.c
+++ b/drivers/rpmsg/rpmsg_ping.c
@@ -188,7 +188,7 @@ static void rpmsg_ping_logout_rate(uint64_t len, clock_t avg)
 int rpmsg_ping(FAR struct rpmsg_endpoint *ept,
                FAR const struct rpmsg_ping_s *ping)
 {
-  clock_t min = UINT_MAX;
+  clock_t min = CLOCK_MAX;
   clock_t max = 0;
   uint64_t total = 0;
   uint32_t buf_len = 0;