timeout(9): remove unused timeout_add_ts(9), timeout_add_bt(9)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

timeout(9): remove unused timeout_add_ts(9), timeout_add_bt(9)

Scott Cheloha
timeout_add_ts(9) and timeout_add_bt(9) are not used anywhere.

ok to remove them?

Index: sys/kern/kern_timeout.c
===================================================================
RCS file: /cvs/src/sys/kern/kern_timeout.c,v
retrieving revision 1.76
diff -u -p -r1.76 kern_timeout.c
--- sys/kern/kern_timeout.c 25 Jul 2020 00:48:04 -0000 1.76
+++ sys/kern/kern_timeout.c 27 Jul 2020 01:22:20 -0000
@@ -297,35 +297,6 @@ timeout_add_tv(struct timeout *to, const
 }
 
 int
-timeout_add_ts(struct timeout *to, const struct timespec *ts)
-{
- uint64_t to_ticks;
-
- to_ticks = (uint64_t)hz * ts->tv_sec + ts->tv_nsec / (tick * 1000);
- if (to_ticks > INT_MAX)
- to_ticks = INT_MAX;
- if (to_ticks == 0 && ts->tv_nsec > 0)
- to_ticks = 1;
-
- return timeout_add(to, (int)to_ticks);
-}
-
-int
-timeout_add_bt(struct timeout *to, const struct bintime *bt)
-{
- uint64_t to_ticks;
-
- to_ticks = (uint64_t)hz * bt->sec + (long)(((uint64_t)1000000 *
-    (uint32_t)(bt->frac >> 32)) >> 32) / tick;
- if (to_ticks > INT_MAX)
- to_ticks = INT_MAX;
- if (to_ticks == 0 && bt->frac > 0)
- to_ticks = 1;
-
- return timeout_add(to, (int)to_ticks);
-}
-
-int
 timeout_add_sec(struct timeout *to, int secs)
 {
  uint64_t to_ticks;
Index: sys/sys/timeout.h
===================================================================
RCS file: /cvs/src/sys/sys/timeout.h,v
retrieving revision 1.37
diff -u -p -r1.37 timeout.h
--- sys/sys/timeout.h 25 Jul 2020 00:48:03 -0000 1.37
+++ sys/sys/timeout.h 27 Jul 2020 01:22:20 -0000
@@ -110,15 +110,11 @@ int timeout_sysctl(void *, size_t *, voi
 
 #define TIMEOUT_INITIALIZER(_f, _a) TIMEOUT_INITIALIZER_FLAGS((_f), (_a), 0)
 
-struct bintime;
-
 void timeout_set(struct timeout *, void (*)(void *), void *);
 void timeout_set_flags(struct timeout *, void (*)(void *), void *, int);
 void timeout_set_proc(struct timeout *, void (*)(void *), void *);
 int timeout_add(struct timeout *, int);
 int timeout_add_tv(struct timeout *, const struct timeval *);
-int timeout_add_ts(struct timeout *, const struct timespec *);
-int timeout_add_bt(struct timeout *, const struct bintime *);
 int timeout_add_sec(struct timeout *, int);
 int timeout_add_msec(struct timeout *, int);
 int timeout_add_usec(struct timeout *, int);
Index: share/man/man9/timeout.9
===================================================================
RCS file: /cvs/src/share/man/man9/timeout.9,v
retrieving revision 1.50
diff -u -p -r1.50 timeout.9
--- share/man/man9/timeout.9 3 Jan 2020 02:16:38 -0000 1.50
+++ share/man/man9/timeout.9 27 Jul 2020 01:22:20 -0000
@@ -35,8 +35,6 @@
 .Nm timeout_add_nsec ,
 .Nm timeout_add_usec ,
 .Nm timeout_add_tv ,
-.Nm timeout_add_ts ,
-.Nm timeout_add_bt ,
 .Nm timeout_del ,
 .Nm timeout_del_barrier ,
 .Nm timeout_barrier ,
@@ -75,10 +73,6 @@
 .Ft int
 .Fn timeout_add_tv "struct timeout *to" "struct timeval *"
 .Ft int
-.Fn timeout_add_ts "struct timeout *to" "struct timespec *"
-.Ft int
-.Fn timeout_add_bt "struct timeout *to" "struct bintime *"
-.Ft int
 .Fn timeout_add_sec "struct timeout *to" "int sec"
 .Ft int
 .Fn timeout_add_msec "struct timeout *to" "int msec"
@@ -212,8 +206,6 @@ functions clear the triggered state for
 .Pp
 When possible, use the
 .Fn timeout_add_tv ,
-.Fn timeout_add_ts ,
-.Fn timeout_add_bt ,
 .Fn timeout_add_sec ,
 .Fn timeout_add_msec ,
 .Fn timeout_add_usec ,
@@ -257,8 +249,6 @@ context.
 .Fn timeout_add_nsec ,
 .Fn timeout_add_usec ,
 .Fn timeout_add_tv ,
-.Fn timeout_add_ts ,
-.Fn timeout_add_bt ,
 .Fn timeout_del ,
 .Fn timeout_pending ,
 .Fn timeout_initialized ,
@@ -289,10 +279,8 @@ flag was given at initialization.
 .Fn timeout_add_msec ,
 .Fn timeout_add_nsec ,
 .Fn timeout_add_usec ,
-.Fn timeout_add_tv ,
-.Fn timeout_add_ts ,
 and
-.Fn timeout_add_bt
+.Fn timeout_add_tv
 will return 1 if the timeout
 .Fa to
 was added to the timeout schedule or 0 if it was already queued.