summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2020-07-02 11:01:22 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2020-07-02 11:01:22 +0000
commit172076ef8d267cf7290426bd3af5b2e518e658d1 (patch)
treecdb7776ac1a894bd543ae953389eb66665b918f4 /sys/dev
parent1f16b75deb18ac019eaeb49edd7023bd9ff10b7a (diff)
remove unused timespec interfaces no longer in linux
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/drm/drm_linux.c24
-rw-r--r--sys/dev/pci/drm/include/linux/time.h39
2 files changed, 2 insertions, 61 deletions
diff --git a/sys/dev/pci/drm/drm_linux.c b/sys/dev/pci/drm/drm_linux.c
index d46ef6a2503..356b56aef5b 100644
--- a/sys/dev/pci/drm/drm_linux.c
+++ b/sys/dev/pci/drm/drm_linux.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: drm_linux.c,v 1.60 2020/06/14 15:20:07 jsg Exp $ */
+/* $OpenBSD: drm_linux.c,v 1.61 2020/07/02 11:01:21 jsg Exp $ */
/*
* Copyright (c) 2013 Jonathan Gray <jsg@openbsd.org>
* Copyright (c) 2015, 2016 Mark Kettenis <kettenis@openbsd.org>
@@ -303,28 +303,6 @@ kthread_stop(struct proc *p)
free(thread, M_DRM, sizeof(*thread));
}
-struct timespec
-ns_to_timespec(const int64_t nsec)
-{
- struct timespec ts;
- int32_t rem;
-
- if (nsec == 0) {
- ts.tv_sec = 0;
- ts.tv_nsec = 0;
- return (ts);
- }
-
- ts.tv_sec = nsec / NSEC_PER_SEC;
- rem = nsec % NSEC_PER_SEC;
- if (rem < 0) {
- ts.tv_sec--;
- rem += NSEC_PER_SEC;
- }
- ts.tv_nsec = rem;
- return (ts);
-}
-
int64_t
timeval_to_ns(const struct timeval *tv)
{
diff --git a/sys/dev/pci/drm/include/linux/time.h b/sys/dev/pci/drm/include/linux/time.h
index 0719b8fce65..ec764e28a4a 100644
--- a/sys/dev/pci/drm/include/linux/time.h
+++ b/sys/dev/pci/drm/include/linux/time.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: time.h,v 1.2 2020/06/08 04:48:15 jsg Exp $ */
+/* $OpenBSD: time.h,v 1.3 2020/07/02 11:01:21 jsg Exp $ */
/*
* Copyright (c) 2013, 2014, 2015 Mark Kettenis
*
@@ -29,7 +29,6 @@
#define USEC_PER_MSEC 1000L
#define USEC_PER_SEC 1000000L
-extern struct timespec ns_to_timespec(const int64_t);
extern int64_t timeval_to_ms(const struct timeval *);
extern int64_t timeval_to_ns(const struct timeval *);
extern int64_t timeval_to_us(const struct timeval *);
@@ -40,40 +39,4 @@ struct timespec64 {
long tv_nsec;
};
-static inline struct timespec
-timespec_sub(struct timespec t1, struct timespec t2)
-{
- struct timespec diff;
-
- timespecsub(&t1, &t2, &diff);
- return diff;
-}
-
-static inline void
-set_normalized_timespec(struct timespec *ts, time_t sec, int64_t nsec)
-{
- while (nsec > NSEC_PER_SEC) {
- nsec -= NSEC_PER_SEC;
- sec++;
- }
-
- ts->tv_sec = sec;
- ts->tv_nsec = nsec;
-}
-
-static inline int64_t
-timespec_to_ns(const struct timespec *ts)
-{
- return ((ts->tv_sec * NSEC_PER_SEC) + ts->tv_nsec);
-}
-
-static inline int
-timespec_valid(const struct timespec *ts)
-{
- if (ts->tv_sec < 0 || ts->tv_sec > 100000000 ||
- ts->tv_nsec < 0 || ts->tv_nsec >= 1000000000)
- return (0);
- return (1);
-}
-
#endif