backports.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luca Coelho <luca@coelho.fi>
To: backports@vger.kernel.org
Cc: Luca Coelho <luciano.coelho@intel.com>
Subject: [PATCH 09/14] backport: make ktime_get_boottime_seconds() non-inline
Date: Thu, 20 Sep 2018 14:28:37 +0300	[thread overview]
Message-ID: <20180920112842.27198-10-luca@coelho.fi> (raw)
In-Reply-To: <20180920112842.27198-1-luca@coelho.fi>

From: Luca Coelho <luciano.coelho@intel.com>

With kernels < 3.17, we need to include hrtimer.h to get ktime_divns()
for the ktime_get_boottime_seconds() backport.  But we can't just
include htrtimer.h in the backport timekeeping.h because we run into
some cyclical inclusions that cause problems.  To solve that make
ktime_get_boottime_seconds() non-inline and add it to a new
backport-4.18.c file.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 backport/backport-include/linux/timekeeping.h |  5 +----
 backport/compat/Makefile                      |  1 +
 backport/compat/backport-4.18.c               | 11 +++++++++++
 3 files changed, 13 insertions(+), 4 deletions(-)
 create mode 100644 backport/compat/backport-4.18.c

diff --git a/backport/backport-include/linux/timekeeping.h b/backport/backport-include/linux/timekeeping.h
index 73ce9f1797ed..aebb00ca366b 100644
--- a/backport/backport-include/linux/timekeeping.h
+++ b/backport/backport-include/linux/timekeeping.h
@@ -25,10 +25,7 @@ static inline u64 ktime_get_boot_ns(void)
 #endif /* < 3.17 */
 
 #if LINUX_VERSION_IS_LESS(4,18,0)
-static inline time64_t ktime_get_boottime_seconds(void)
-{
-	return ktime_divns(ktime_get_boottime(), NSEC_PER_SEC);
-}
+extern time64_t ktime_get_boottime_seconds(void);
 #endif /* < 4.18 */
 
 #if LINUX_VERSION_IS_LESS(3,19,0)
diff --git a/backport/compat/Makefile b/backport/compat/Makefile
index 12c4121ff7e1..f5b1886e2d8e 100644
--- a/backport/compat/Makefile
+++ b/backport/compat/Makefile
@@ -37,6 +37,7 @@ compat-$(CPTCFG_KERNEL_4_7) += backport-4.7.o
 compat-$(CPTCFG_KERNEL_4_8) += backport-4.8.o
 compat-$(CPTCFG_KERNEL_4_10) += backport-4.10.o
 compat-$(CPTCFG_KERNEL_4_12) += backport-4.12.o
+compat-$(CPTCFG_KERNEL_4_18) += backport-4.18.o
 
 compat-$(CPTCFG_BPAUTO_CRYPTO_SKCIPHER) += crypto-skcipher.o
 
diff --git a/backport/compat/backport-4.18.c b/backport/compat/backport-4.18.c
new file mode 100644
index 000000000000..c47fabe5a7a1
--- /dev/null
+++ b/backport/compat/backport-4.18.c
@@ -0,0 +1,11 @@
+/*
+ * Copyright (C) 2018 Intel Corporation
+ */
+
+#include <linux/hrtimer.h>
+
+time64_t ktime_get_boottime_seconds(void)
+{
+	return ktime_divns(ktime_get_boottime(), NSEC_PER_SEC);
+}
+EXPORT_SYMBOL_GPL(ktime_get_boottime_seconds);
-- 
2.18.0

--
To unsubscribe from this list: send the line "unsubscribe backports" in

  parent reply	other threads:[~2018-09-20 17:11 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-20 11:28 [PATCH 00/14] backport: updates for 4.19 Luca Coelho
2018-09-20 11:28 ` [PATCH 01/14] backport: fix compilation with IPV6 not set Luca Coelho
2018-09-20 11:28 ` [PATCH 02/14] backports: add wait_event_killable_timeout backport support Luca Coelho
2018-09-20 11:28 ` [PATCH 03/14] backport: introduce match_string() for kernels < 4.6 Luca Coelho
2018-09-20 11:28 ` [PATCH 04/14] backport: add patch to ignore iwlwifi removal on < 3.14 kernels Luca Coelho
2018-09-20 11:28 ` [PATCH 05/14] backport: convert tree section names to ascii Luca Coelho
2018-09-20 11:28 ` [PATCH 06/14] backport: add rhashtable-types.h Luca Coelho
2018-09-20 11:28 ` [PATCH 07/14] backport: remove duplicate leds.h inclusion from backport-4.5.c Luca Coelho
2018-09-20 11:28 ` [PATCH 08/14] backport: prevent unused subclass variable warning in < 3.18 Luca Coelho
2018-09-20 11:28 ` Luca Coelho [this message]
2018-09-20 11:28 ` [PATCH 10/14] backport: update u64_stats_init() to a new version in kernels < 4.2 Luca Coelho
2018-09-20 11:28 ` [PATCH 11/14] backports: improve skb->xmit_more handling Luca Coelho
2018-09-20 11:28 ` [PATCH 12/14] backport: update lib-rhashtable.c Luca Coelho
2018-09-20 16:23   ` Luciano Coelho
2018-09-20 11:28 ` [PATCH 13/14] backport: convert int led activate op to void when needed Luca Coelho
2018-09-23 12:30   ` Hauke Mehrtens
2018-09-24  9:24     ` Luca Coelho
2018-09-20 11:28 ` [PATCH 14/14] backports: add __alloc_bucket_spinlocks() for < 4.19 Luca Coelho
2018-09-23 14:14 ` [PATCH 00/14] backport: updates for 4.19 Hauke Mehrtens
2018-09-24  9:26   ` Luca Coelho

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=20180920112842.27198-10-luca@coelho.fi \
    --to=luca@coelho.fi \
    --cc=backports@vger.kernel.org \
    --cc=luciano.coelho@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).