From: jsg Date: Wed, 14 Jul 2021 09:56:17 +0000 (+0000) Subject: timeout_add() always sets a new expiry time unrelated to the previous X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=67cf64fe95a212067a34c76cc60add2b78026316;p=openbsd 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@ --- 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); }