Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/include/linux linux: Add del_timer ret...



details:   https://anonhg.NetBSD.org/src/rev/80a2be996776
branches:  trunk
changeset: 1028790:80a2be996776
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 12:02:05 2021 +0000

description:
linux: Add del_timer return value.

diffstat:

 sys/external/bsd/drm2/include/linux/timer.h |  13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diffs (30 lines):

diff -r 42842ad4c60e -r 80a2be996776 sys/external/bsd/drm2/include/linux/timer.h
--- a/sys/external/bsd/drm2/include/linux/timer.h       Sun Dec 19 12:01:57 2021 +0000
+++ b/sys/external/bsd/drm2/include/linux/timer.h       Sun Dec 19 12:02:05 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: timer.h,v 1.15 2021/12/19 12:01:57 riastradh Exp $     */
+/*     $NetBSD: timer.h,v 1.16 2021/12/19 12:02:05 riastradh Exp $     */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -76,11 +76,18 @@
        mod_timer(timer, then);
 }
 
-static inline void
+static inline int
 del_timer(struct timer_list *timer)
 {
 
-       callout_stop(&timer->tl_callout);
+       /*
+        * Linux: `del_timer of an inactive timer returns 0, del_timer
+        * of an active timer returns 1.'
+        *
+        * NetBSD: `callout_stop will return a non-zero value if the
+        * callout was EXPIRED.', meaning it is no longer pending.
+        */
+       return !callout_stop(&timer->tl_callout);
 }
 
 static inline int



Home | Main Index | Thread Index | Old Index