From af8798d5f1b4b0e87d39c3694c4cbf5630f044e2 Mon Sep 17 00:00:00 2001 From: cheloha Date: Tue, 8 Nov 2022 19:09:53 +0000 Subject: [PATCH] timeout(9): remove unused, undocumented timeout_in_nsec() interface The kernel is not quite ready for timeout_in_nsec(). Remove it and kclock_nanotime(). Both are unused. Prompted by jsg@. ok kn@ --- sys/kern/kern_timeout.c | 27 +-------------------------- sys/sys/timeout.h | 3 +-- 2 files changed, 2 insertions(+), 28 deletions(-) diff --git a/sys/kern/kern_timeout.c b/sys/kern/kern_timeout.c index 199dd3357a9..44a4918db19 100644 --- a/sys/kern/kern_timeout.c +++ b/sys/kern/kern_timeout.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_timeout.c,v 1.85 2021/06/19 02:05:33 cheloha Exp $ */ +/* $OpenBSD: kern_timeout.c,v 1.86 2022/11/08 19:09:53 cheloha Exp $ */ /* * Copyright (c) 2001 Thomas Nordin * Copyright (c) 2000-2001 Artur Grabowski @@ -166,7 +166,6 @@ struct lock_type timeout_spinlock_type = { ((needsproc) ? &timeout_sleeplock_obj : &timeout_spinlock_obj) #endif -void kclock_nanotime(int, struct timespec *); void softclock(void *); void softclock_create_thread(void *); void softclock_process_kclock_timeout(struct timeout *, int); @@ -430,30 +429,6 @@ timeout_at_ts(struct timeout *to, const struct timespec *abstime) return ret; } -int -timeout_in_nsec(struct timeout *to, uint64_t nsecs) -{ - struct timespec abstime, interval, now; - - kclock_nanotime(to->to_kclock, &now); - NSEC_TO_TIMESPEC(nsecs, &interval); - timespecadd(&now, &interval, &abstime); - - return timeout_at_ts(to, &abstime); -} - -void -kclock_nanotime(int kclock, struct timespec *now) -{ - switch (kclock) { - case KCLOCK_UPTIME: - nanouptime(now); - break; - default: - panic("invalid kclock: 0x%x", kclock); - } -} - int timeout_del(struct timeout *to) { diff --git a/sys/sys/timeout.h b/sys/sys/timeout.h index 073756420a9..72874341f01 100644 --- a/sys/sys/timeout.h +++ b/sys/sys/timeout.h @@ -1,4 +1,4 @@ -/* $OpenBSD: timeout.h,v 1.43 2021/07/13 17:50:19 mvs Exp $ */ +/* $OpenBSD: timeout.h,v 1.44 2022/11/08 19:09:53 cheloha Exp $ */ /* * Copyright (c) 2000-2001 Artur Grabowski * All rights reserved. @@ -120,7 +120,6 @@ int timeout_add_usec(struct timeout *, int); int timeout_add_nsec(struct timeout *, int); int timeout_at_ts(struct timeout *, const struct timespec *); -int timeout_in_nsec(struct timeout *, uint64_t); int timeout_del(struct timeout *); int timeout_del_barrier(struct timeout *); -- 2.20.1