Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753489AbbFLHzP (ORCPT ); Fri, 12 Jun 2015 03:55:15 -0400 Received: from mail-pd0-f180.google.com ([209.85.192.180]:34166 "EHLO mail-pd0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751166AbbFLHzL (ORCPT ); Fri, 12 Jun 2015 03:55:11 -0400 From: Baolin Wang To: tglx@linutronix.de Cc: arnd@arndb.de, john.stultz@linaro.org, pang.xunlei@linaro.org, mingo@kernel.org, peterz@infradead.org, linux-kernel@vger.kernel.org, baolin.wang@linaro.org, y2038@lists.linaro.org Subject: [PATCH v5 16/24] timekeeping: Change the implementation of timekeeping_clocktai() Date: Fri, 12 Jun 2015 15:53:58 +0800 Message-Id: <3be0e285a52bc022a0280150c7e694297e8f6bbb.1434079263.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1918 Lines: 55 The timekeeping_clocktai() function is not year 2038 safe on 32bit systems, change its implementation with using struct timespec64. Signed-off-by: Baolin Wang --- include/linux/timekeeping.h | 4 ++-- kernel/time/posix-timers.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/linux/timekeeping.h b/include/linux/timekeeping.h index 2dcc86b..07581c0 100644 --- a/include/linux/timekeeping.h +++ b/include/linux/timekeeping.h @@ -256,9 +256,9 @@ static inline void get_monotonic_boottime64(struct timespec64 *ts) *ts = ktime_to_timespec64(ktime_get_boottime()); } -static inline void timekeeping_clocktai(struct timespec *ts) +static inline void timekeeping_clocktai(struct timespec64 *ts) { - *ts = ktime_to_timespec(ktime_get_clocktai()); + *ts = ktime_to_timespec64(ktime_get_clocktai()); } /* diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c index 0b0663a..029a2b6 100644 --- a/kernel/time/posix-timers.c +++ b/kernel/time/posix-timers.c @@ -296,7 +296,7 @@ static int posix_get_boottime(const clockid_t which_clock, struct timespec *tp) return 0; } -static int posix_get_tai(clockid_t which_clock, struct timespec *tp) +static int posix_get_tai(clockid_t which_clock, struct timespec64 *tp) { timekeeping_clocktai(tp); return 0; @@ -350,7 +350,7 @@ static __init int init_posix_timers(void) }; struct k_clock clock_tai = { .clock_getres = posix_get_hrtimer_res, - .clock_get = posix_get_tai, + .clock_get64 = posix_get_tai, .nsleep = common_nsleep, .nsleep_restart = hrtimer_nanosleep_restart, .timer_create = common_timer_create, -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/