From patchwork Thu Sep 20 11:28:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Coelho X-Patchwork-Id: 10607531 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 66E6E174F for ; Thu, 20 Sep 2018 11:28:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 56DDC2D09B for ; Thu, 20 Sep 2018 11:28:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4B44B2D0A8; Thu, 20 Sep 2018 11:28:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E9E722D09B for ; Thu, 20 Sep 2018 11:28:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727986AbeITRL5 (ORCPT ); Thu, 20 Sep 2018 13:11:57 -0400 Received: from paleale.coelho.fi ([176.9.41.70]:50998 "EHLO farmhouse.coelho.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727029AbeITRL5 (ORCPT ); Thu, 20 Sep 2018 13:11:57 -0400 Received: from 91-156-4-241.elisa-laajakaista.fi ([91.156.4.241] helo=redipa.ger.corp.intel.com) by farmhouse.coelho.fi with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.91) (envelope-from ) id 1g2x8f-0004SQ-Mm; Thu, 20 Sep 2018 14:28:54 +0300 From: Luca Coelho To: backports@vger.kernel.org Cc: Luca Coelho Date: Thu, 20 Sep 2018 14:28:37 +0300 Message-Id: <20180920112842.27198-10-luca@coelho.fi> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180920112842.27198-1-luca@coelho.fi> References: <20180920112842.27198-1-luca@coelho.fi> Subject: [PATCH 09/14] backport: make ktime_get_boottime_seconds() non-inline Sender: backports-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: backports@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Luca Coelho 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 --- 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 + +time64_t ktime_get_boottime_seconds(void) +{ + return ktime_divns(ktime_get_boottime(), NSEC_PER_SEC); +} +EXPORT_SYMBOL_GPL(ktime_get_boottime_seconds);