From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753162AbbEFQe7 (ORCPT ); Wed, 6 May 2015 12:34:59 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:64527 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752094AbbEFQaw (ORCPT ); Wed, 6 May 2015 12:30:52 -0400 From: Arnd Bergmann To: y2038@lists.linaro.org Cc: baolin.wang@linaro.org, tglx@linutronix.de, albert.aribaud@3adev.fr, john.stultz@linaro.org, bamvor.zhangjian@linaro.org, ruchandani.tina@gmail.com, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, libc-alpha@sourceware.org, Arnd Bergmann Subject: [PATCH 15/19] y2038: introduce timespec64_to_jiffies Date: Wed, 6 May 2015 18:30:22 +0200 Message-Id: <1430929826-318934-16-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.1.0.rc2 In-Reply-To: <1430929826-318934-1-git-send-email-arnd@arndb.de> References: <1430929826-318934-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:FMrT5musYnWAmKsZH2202oIFP3r3PrS2Pkd9uLe+gI0V6YaJ1kh HYpGXt4rQjWF1EjCqgVgXhCOZPx3NrVX4fcVRfCoZUM0XbRbasbbriFCveh/uvEHWk0S6eT 4xuTr/nYifgUve4US586+76eTAy7GSJrOP2aFO7ZKZTGPFqym6Z/9V0b9SaaIFIIfCQzeS9 ec461xfkj6m7S/awlQUEg== X-UI-Out-Filterresults: notjunk:1; Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is needed to convert do_sigtimedwait to use timespec64. Signed-off-by: Arnd Bergmann --- include/linux/jiffies.h | 13 ++++++++++++- kernel/time/time.c | 11 ++--------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h index c367cbdf73ab..2aeb872f5547 100644 --- a/include/linux/jiffies.h +++ b/include/linux/jiffies.h @@ -290,7 +290,18 @@ static inline u64 jiffies_to_nsecs(const unsigned long j) extern unsigned long msecs_to_jiffies(const unsigned int m); extern unsigned long usecs_to_jiffies(const unsigned int u); -extern unsigned long timespec_to_jiffies(const struct timespec *value); +extern unsigned long __timespec_to_jiffies(unsigned long sec, long nsec); +static inline unsigned long timespec_to_jiffies(const struct timespec *value) +{ + return __timespec_to_jiffies(value->tv_sec, value->tv_nsec); +} + +static inline unsigned long timespec64_to_jiffies(const struct timespec64 *value) +{ + return __timespec_to_jiffies(value->tv_sec, value->tv_nsec); +} + + extern void jiffies_to_timespec(const unsigned long jiffies, struct timespec *value); extern unsigned long timeval_to_jiffies(const struct timeval *value); diff --git a/kernel/time/time.c b/kernel/time/time.c index 845af1db66fa..4d96236c07b0 100644 --- a/kernel/time/time.c +++ b/kernel/time/time.c @@ -571,7 +571,7 @@ EXPORT_SYMBOL(usecs_to_jiffies); * The >> (NSEC_JIFFIE_SC - SEC_JIFFIE_SC) converts the scaled nsec * value to a scaled second value. */ -static unsigned long +unsigned long __timespec_to_jiffies(unsigned long sec, long nsec) { nsec = nsec + TICK_NSEC - 1; @@ -585,14 +585,7 @@ __timespec_to_jiffies(unsigned long sec, long nsec) (NSEC_JIFFIE_SC - SEC_JIFFIE_SC))) >> SEC_JIFFIE_SC; } - -unsigned long -timespec_to_jiffies(const struct timespec *value) -{ - return __timespec_to_jiffies(value->tv_sec, value->tv_nsec); -} - -EXPORT_SYMBOL(timespec_to_jiffies); +EXPORT_SYMBOL(__timespec_to_jiffies); void jiffies_to_timespec(const unsigned long jiffies, struct timespec *value) -- 2.1.0.rc2