dead code: remove itimerround()

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

dead code: remove itimerround()

Scott Cheloha
As of kern_time.c v1.122 this code is dead.  We still round the
per-process itimers up to one tick, but this happens in itimerfix()
anyway, so itimerround() was redundant and the last callsite in
sys_setitimer() was dropped.

While here, tweak an adjacent prototype in time.h for style(9).

ok?

Index: kern/kern_time.c
===================================================================
RCS file: /cvs/src/sys/kern/kern_time.c,v
retrieving revision 1.122
diff -u -p -r1.122 kern_time.c
--- kern/kern_time.c 2 Aug 2019 02:17:35 -0000 1.122
+++ kern/kern_time.c 3 Aug 2019 17:55:02 -0000
@@ -659,17 +659,6 @@ itimerfix(struct timeval *tv)
 }
 
 /*
- * Nonzero timer interval smaller than the resolution of the
- * system clock are rounded up.
- */
-void
-itimerround(struct timeval *tv)
-{
- if (tv->tv_sec == 0 && tv->tv_usec != 0 && tv->tv_usec < tick)
- tv->tv_usec = tick;
-}
-
-/*
  * Decrement an interval timer by the given number of nanoseconds.
  * If the timer expires and it is periodic then reload it.  When reloading
  * the timer we subtract any overrun from the next period so that the timer
Index: sys/time.h
===================================================================
RCS file: /cvs/src/sys/sys/time.h,v
retrieving revision 1.45
diff -u -p -r1.45 time.h
--- sys/time.h 2 Aug 2019 03:33:15 -0000 1.45
+++ sys/time.h 3 Aug 2019 17:55:02 -0000
@@ -298,8 +298,7 @@ struct proc;
 int clock_gettime(struct proc *, clockid_t, struct timespec *);
 
 int itimerfix(struct timeval *);
-int itimerdecr(struct itimerspec *itp, long nsec);
-void itimerround(struct timeval *);
+int itimerdecr(struct itimerspec *, long);
 int settime(const struct timespec *);
 int ratecheck(struct timeval *, const struct timeval *);
 int ppsratecheck(struct timeval *, int *, int);