This is an automated email from Gerrit.

"Antonio Borneo <[email protected]>" just uploaded a new patch set to 
Gerrit, which you can find at https://review.openocd.org/c/openocd/+/9747

-- gerrit

commit 20c0672f190566ba075cf1b34dd7eae6daf1293a
Author: Antonio Borneo <[email protected]>
Date:   Mon Jun 15 23:02:56 2026 +0200

    helper: time_support: drop unused functions
    
    The helpers
    - timeval_add_time()
    - timeval_compare()
    - timeval_subtract()
    are not used anymore. Drop them.
    
    Change-Id: I1c5cf1ec7d2a931a61efbb06437456374e271600
    Signed-off-by: Antonio Borneo <[email protected]>

diff --git a/src/helper/time_support.c b/src/helper/time_support.c
index dd2cf3ccd6..f13b19fbc9 100644
--- a/src/helper/time_support.c
+++ b/src/helper/time_support.c
@@ -19,55 +19,6 @@
 
 #include "time_support.h"
 
-/* calculate difference between two struct timeval values */
-int timeval_subtract(struct timeval *result, struct timeval *x, struct timeval 
*y)
-{
-       if (x->tv_usec < y->tv_usec) {
-               int nsec = (y->tv_usec - x->tv_usec) / 1000000 + 1;
-               y->tv_usec -= 1000000 * nsec;
-               y->tv_sec += nsec;
-       }
-       if (x->tv_usec - y->tv_usec > 1000000) {
-               int nsec = (x->tv_usec - y->tv_usec) / 1000000;
-               y->tv_usec += 1000000 * nsec;
-               y->tv_sec -= nsec;
-       }
-
-       result->tv_sec = x->tv_sec - y->tv_sec;
-       result->tv_usec = x->tv_usec - y->tv_usec;
-
-       /* Return 1 if result is negative. */
-       return x->tv_sec < y->tv_sec;
-}
-
-int timeval_add_time(struct timeval *result, long sec, long usec)
-{
-       result->tv_sec += sec;
-       result->tv_usec += usec;
-
-       while (result->tv_usec > 1000000) {
-               result->tv_usec -= 1000000;
-               result->tv_sec++;
-       }
-
-       return 0;
-}
-
-/* compare two timevals and return -1/0/+1 accordingly */
-int timeval_compare(const struct timeval *x, const struct timeval *y)
-{
-       if (x->tv_sec < y->tv_sec)
-               return -1;
-       else if (x->tv_sec > y->tv_sec)
-               return 1;
-       else if (x->tv_usec < y->tv_usec)
-               return -1;
-       else if (x->tv_usec > y->tv_usec)
-               return 1;
-       else
-               return 0;
-}
-
 int duration_start(struct duration *duration)
 {
        int64_t now = timeval_ms();
diff --git a/src/helper/time_support.h b/src/helper/time_support.h
index 7e0a315c20..36d08c4431 100644
--- a/src/helper/time_support.h
+++ b/src/helper/time_support.h
@@ -21,10 +21,6 @@
 #include <sys/time.h>
 #endif
 
-int timeval_subtract(struct timeval *result, struct timeval *x, struct timeval 
*y);
-int timeval_add_time(struct timeval *result, long sec, long usec);
-int timeval_compare(const struct timeval *x, const struct timeval *y);
-
 /** @returns gettimeofday() timeval as 64-bit in ms */
 int64_t timeval_ms(void);
 

-- 

Reply via email to