Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Feb 2018 12:12:06 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r328971 - head/sys/compat/linuxkpi/common/include/linux
Message-ID:  <201802071212.w17CC6lt058156@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Wed Feb  7 12:12:06 2018
New Revision: 328971
URL: https://svnweb.freebsd.org/changeset/base/328971

Log:
  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

Modified:
  head/sys/compat/linuxkpi/common/include/linux/ktime.h

Modified: head/sys/compat/linuxkpi/common/include/linux/ktime.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/linux/ktime.h	Wed Feb  7 09:37:22 2018	(r328970)
+++ head/sys/compat/linuxkpi/common/include/linux/ktime.h	Wed Feb  7 12:12:06 2018	(r328971)
@@ -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;
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201802071212.w17CC6lt058156>