summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2021-07-14 09:56:18 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2021-07-14 09:56:18 +0000
commit58f91b79a1c48bc609d7f938d4b6591c096d4fcd (patch)
tree2f9506e25e897fb8bc619432b0844116dfe4e890
parentcc425e462596a2b5b2468e9c4f2aa2122668999a (diff)
timeout_add() always sets a new expiry time unrelated to the previous
one and requeues as needed so no need to call timeout_del() before timeout_add() spotted by kettenis@
-rw-r--r--sys/dev/pci/drm/include/linux/timer.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/dev/pci/drm/include/linux/timer.h b/sys/dev/pci/drm/include/linux/timer.h
index 5ffa0321625..a5bc0072abd 100644
--- a/sys/dev/pci/drm/include/linux/timer.h
+++ b/sys/dev/pci/drm/include/linux/timer.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: timer.h,v 1.7 2021/07/14 05:42:47 jsg Exp $ */
+/* $OpenBSD: timer.h,v 1.8 2021/07/14 09:56:17 jsg Exp $ */
/*
* Copyright (c) 2013, 2014, 2015 Mark Kettenis
*
@@ -31,10 +31,8 @@
static inline int
mod_timer(struct timeout *to, unsigned long j)
{
- if (j <= jiffies) {
- timeout_del(to);
+ if (j <= jiffies)
return timeout_add(to, 1);
- }
return timeout_add(to, j - jiffies);
}