@@ -34,16 +34,10 @@ static inline int64_t ts_to_ns(const struct timespec *ts)
34
34
return ts -> tv_sec * NSEC_PER_SEC + ts -> tv_nsec ;
35
35
}
36
36
37
- static inline void tv_to_ts (const struct timeval * tv , struct timespec * ts )
38
- {
39
- ts -> tv_sec = tv -> tv_sec ;
40
- ts -> tv_nsec = tv -> tv_usec * NSEC_PER_USEC ;
41
- }
42
-
43
37
#define _tp_op (_a , _b , _op ) (ts_to_ns(_a) _op ts_to_ns(_b))
44
38
45
39
#define _decl_op (_type , _name , _op ) \
46
- static inline _type _name(const struct timespec *_a, const struct timespec *_b) \
40
+ __used static inline _type _name(const struct timespec *_a, const struct timespec *_b) \
47
41
{ \
48
42
return _tp_op(_a, _b, _op); \
49
43
}
@@ -56,8 +50,8 @@ _decl_op(bool, tp_ge, >=); /* a >= b */
56
50
_decl_op (int64_t , tp_diff , - ); /* a - b */
57
51
58
52
/* lo <= (a - b) < hi */
59
- static inline bool tp_diff_in_range_ns (const struct timespec * a , const struct timespec * b ,
60
- int64_t lo , int64_t hi )
53
+ __used static inline bool tp_diff_in_range_ns (const struct timespec * a , const struct timespec * b ,
54
+ int64_t lo , int64_t hi )
61
55
{
62
56
int64_t diff = tp_diff (a , b );
63
57
0 commit comments