Date: Wed, 20 Jun 2018 06:43:41 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r335421 - stable/11/sys/compat/linuxkpi/common/include/linux Message-ID: <201806200643.w5K6hfA8025951@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Wed Jun 20 06:43:41 2018 New Revision: 335421 URL: https://svnweb.freebsd.org/changeset/base/335421 Log: MFC r334711: Implement the ktime_compare() and ktime_after() functions in the LinuxKPI. Submitted by: Johannes Lundberg <johalun0@gmail.com> Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: stable/11/sys/compat/linuxkpi/common/include/linux/ktime.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/ktime.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/ktime.h Wed Jun 20 06:42:51 2018 (r335420) +++ stable/11/sys/compat/linuxkpi/common/include/linux/ktime.h Wed Jun 20 06:43:41 2018 (r335421) @@ -127,6 +127,25 @@ ktime_add(ktime_t lhs, ktime_t rhs) return (lhs + rhs); } +static inline int +ktime_compare(const ktime_t cmp1, const ktime_t cmp2) +{ + + if (cmp1 > cmp2) + return (1); + else if (cmp1 < cmp2) + return (-1); + else + return (0); +} + +static inline bool +ktime_after(const ktime_t cmp1, const ktime_t cmp2) +{ + + return (ktime_compare(cmp1, cmp2) > 0); +} + static inline ktime_t timespec_to_ktime(struct timespec ts) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806200643.w5K6hfA8025951>