From patchwork Fri Jun 12 07:53:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 49800 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5414F228DB for ; Fri, 12 Jun 2015 07:55:24 +0000 (UTC) Received: by wibut5 with SMTP id ut5sf2727255wib.0 for ; Fri, 12 Jun 2015 00:55:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:in-reply-to:references :sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=NiijsgCDPDtZ6Ji1CWUkPGu4m4yx+P2ryvO6un2XvFc=; b=ZAWxqKrfkCwh+d2yHeoNjFurYlTndqDdWZ/ydhjoeqHi1pYsgbXRcSQnrQJYMQqoZM nXEaefwockg4W4iDV6B+UWHpgkACIOl5PG5coFrgTfk7rLgm12GW8P9WvtaxyHRH4yYV K/1wzbt0xca+lzmLFwfWFn9iq2Zo7g62aBhhwsS5sbRgfAfBAzh2E5XyKasC82ds9uXN mGUSM65Nn9szGqp6O4BRViJRQvPr/sJgyFPy0Hru52Q5agO6bdRKzDArq2BeY3TQr7Ib TAzRcc2e3SDjHiKCZs61SwIMhwltsEfri7OPMH9KdMLXQGC1W2ZODW2UIbtKHta0I7uX 8qxA== X-Gm-Message-State: ALoCoQkXbaZqOutgpFqEs5a6qmXGk3eCrlfcvJ+2wKIJsQbB7Evc/OCEmNBdvClSDCDxONJPYEH/ X-Received: by 10.112.135.230 with SMTP id pv6mr12897816lbb.0.1434095723580; Fri, 12 Jun 2015 00:55:23 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.28.197 with SMTP id d5ls461176lah.97.gmail; Fri, 12 Jun 2015 00:55:23 -0700 (PDT) X-Received: by 10.112.142.232 with SMTP id rz8mr13385773lbb.74.1434095723406; Fri, 12 Jun 2015 00:55:23 -0700 (PDT) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id ci12si2755177lad.24.2015.06.12.00.55.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Jun 2015 00:55:23 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by lbbqq2 with SMTP id qq2so15408895lbb.3 for ; Fri, 12 Jun 2015 00:55:23 -0700 (PDT) X-Received: by 10.112.219.70 with SMTP id pm6mr13580034lbc.41.1434095723265; Fri, 12 Jun 2015 00:55:23 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp358562lbb; Fri, 12 Jun 2015 00:55:22 -0700 (PDT) X-Received: by 10.70.35.201 with SMTP id k9mr20939343pdj.128.1434095721586; Fri, 12 Jun 2015 00:55:21 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gu1si4235497pbd.210.2015.06.12.00.55.19; Fri, 12 Jun 2015 00:55:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753568AbbFLHzP (ORCPT + 29 others); 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 Received: by pdbki1 with SMTP id ki1so19752248pdb.1 for ; Fri, 12 Jun 2015 00:55:11 -0700 (PDT) X-Received: by 10.66.222.130 with SMTP id qm2mr21122024pac.39.1434095711367; Fri, 12 Jun 2015 00:55:11 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([175.111.195.49]) by mx.google.com with ESMTPSA id xd9sm2766640pab.6.2015.06.12.00.55.08 (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 12 Jun 2015 00:55:10 -0700 (PDT) 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 Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: baolin.wang@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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,