All of lore.kernel.org
 help / color / mirror / Atom feed
From: roman.stratiienko@globallogic.com
To: xenomai@xenomai.org
Cc: Roman Stratiienko <roman.stratiienko@globallogic.com>
Subject: [PATCH 6/7] kernel: cobalt: migrate to ktime_t
Date: Tue,  5 Mar 2019 16:45:20 +0200	[thread overview]
Message-ID: <20190305144521.2567-6-roman.stratiienko@globallogic.com> (raw)
In-Reply-To: <20190305144521.2567-1-roman.stratiienko@globallogic.com>

From: Roman Stratiienko <roman.stratiienko@globallogic.com>

Signed-off-by: Roman Stratiienko <roman.stratiienko@globallogic.com>
---
 kernel/cobalt/clock.c                 | 4 +---
 kernel/drivers/analogy/rtdm_helpers.c | 5 +----
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/kernel/cobalt/clock.c b/kernel/cobalt/clock.c
index 272db3241..f8291b006 100644
--- a/kernel/cobalt/clock.c
+++ b/kernel/cobalt/clock.c
@@ -350,9 +350,7 @@ EXPORT_SYMBOL_GPL(xnclock_adjust);
 
 xnticks_t xnclock_get_host_time(void)
 {
-	struct timeval tv;
-	do_gettimeofday(&tv);
-	return tv.tv_sec * 1000000000ULL + tv.tv_usec * 1000;
+	return ktime_to_ns(ktime_get_real());
 }
 EXPORT_SYMBOL_GPL(xnclock_get_host_time);
 
diff --git a/kernel/drivers/analogy/rtdm_helpers.c b/kernel/drivers/analogy/rtdm_helpers.c
index 8330d0676..675594152 100644
--- a/kernel/drivers/analogy/rtdm_helpers.c
+++ b/kernel/drivers/analogy/rtdm_helpers.c
@@ -32,11 +32,8 @@ static nanosecs_abs_t a4l_clkofs;
 void a4l_init_time(void)
 {
 	nanosecs_abs_t t1, t2;
-	struct timeval tv;
 	t1 = rtdm_clock_read();
-	do_gettimeofday(&tv);
-	t2 = 1000000000 * ((nanosecs_abs_t)tv.tv_sec) +
-		1000000 * ((nanosecs_abs_t)tv.tv_usec);
+	t2 = ktime_to_ns(ktime_get_real());
 	a4l_clkofs = t2 - t1;
 }
 
-- 
2.17.1



  parent reply	other threads:[~2019-03-05 14:45 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-05 14:45 [PATCH 1/7] travis: add basic CI support roman.stratiienko
2019-03-05 14:45 ` [PATCH 2/7] kernel: cobalt: fix build with kernel v4.20 roman.stratiienko
2019-03-05 18:00   ` Jan Kiszka
2019-03-05 14:45 ` [PATCH 3/7] Kernel: cobalt: workaround of BUILD_BUG_ON error on v4.18 roman.stratiienko
2019-03-05 18:00   ` Jan Kiszka
2019-03-05 14:45 ` [PATCH 4/7] kernel: cobalt: add missing quotes roman.stratiienko
2019-03-05 18:03   ` Jan Kiszka
2019-03-05 14:45 ` [PATCH 5/7] kernel: cobalt: support building against v5.0 roman.stratiienko
2019-03-05 18:05   ` Jan Kiszka
2019-03-05 14:45 ` roman.stratiienko [this message]
2019-03-05 18:16   ` [PATCH 6/7] kernel: cobalt: migrate to ktime_t Jan Kiszka
2019-03-05 14:45 ` [PATCH 7/7] travis: append v5.0 to the matrix roman.stratiienko
2019-03-05 18:24   ` Jan Kiszka
2019-03-06 17:52   ` Philippe Gerum
2019-03-05 17:53 ` [PATCH 1/7] travis: add basic CI support Jan Kiszka
2019-03-05 20:29   ` Greg Gallagher
2019-03-05 21:27     ` Jan Kiszka
     [not found]   ` <CAODwZ7ugD-swhVFpr7VrkEniJBNM3QvkPymNrzBJSNG3uUkMMw@mail.gmail.com>
2019-03-06 11:49     ` Fwd: " Roman Stratiienko
2019-03-06 12:16       ` Jan Kiszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190305144521.2567-6-roman.stratiienko@globallogic.com \
    --to=roman.stratiienko@globallogic.com \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.