From 5b7cc89266ac338e2c0713a4ce5e2c1bcd0898ac Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Wed, 7 Feb 2018 12:12:06 +0000 Subject: [PATCH] Fix implementation of ktime_add_ns() and ktime_sub_ns() in the LinuxKPI to actually return the computed result instead of the input value. This is a regression issue after r289572. Found by: gcc6 MFC after: 3 days Sponsored by: Mellanox Technologies --- sys/compat/linuxkpi/common/include/linux/ktime.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/ktime.h b/sys/compat/linuxkpi/common/include/linux/ktime.h index a1b8af008e6..f5f11e4919e 100644 --- a/sys/compat/linuxkpi/common/include/linux/ktime.h +++ b/sys/compat/linuxkpi/common/include/linux/ktime.h @@ -88,18 +88,14 @@ ktime_to_timeval(ktime_t kt) static inline ktime_t ktime_add_ns(ktime_t kt, int64_t ns) { - ktime_t res; - - res.tv64 = kt.tv64 + ns; + kt.tv64 += ns; return kt; } static inline ktime_t ktime_sub_ns(ktime_t kt, int64_t ns) { - ktime_t res; - - res.tv64 = kt.tv64 - ns; + kt.tv64 -= ns; return kt; }