From patchwork Mon Jun 1 11:58:55 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: 49314 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 06077218FC for ; Mon, 1 Jun 2015 11:59:30 +0000 (UTC) Received: by wibut5 with SMTP id ut5sf5200833wib.0 for ; Mon, 01 Jun 2015 04:59:29 -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:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=NTfIgKras5J87AJIg9OAvZooxDcHB2ZS+s2hoANqiN8=; b=Um0Ey9HUpEn5ASZS7R5Jd3ghchRJpSYhIe4PQmUnrBVSeXjRAMXiR8w6cTWnkNQ1W5 un+MIpae5jTJzFFxyB9sRZzJ6pLZlgUvES1ASkG2VKVOhpFMU9/tpHG3IW9FtmuRmgSn oI/hI+eqjSVqCsdyUK5B9Ez+SUejuEVyYlEj5umkrMvHknTG6mpgrlyYc4czsHPc4TWJ fAfyJsT8RVtsoizrl6x9vzjMGobeJJAL+wygX6M3dk9VVdERIoNag7g/yMphhpXbHnvb ypPRXq9/eGdmn9zFymdz2re/9oRxDpj3ItL1sD8RwQiIazoyF7OeeOf+4rqe5jT/TrJ2 EHBQ== X-Gm-Message-State: ALoCoQmQleOntp4IfG9vKamOASRrpajzgcAqjbpUJauIjB6mto6yoVjBw+uFp3WfTw2hlSfFT0mt X-Received: by 10.180.84.70 with SMTP id w6mr11346198wiy.4.1433159969262; Mon, 01 Jun 2015 04:59:29 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.116.38 with SMTP id jt6ls697613lab.101.gmail; Mon, 01 Jun 2015 04:59:29 -0700 (PDT) X-Received: by 10.152.115.132 with SMTP id jo4mr21137089lab.102.1433159969001; Mon, 01 Jun 2015 04:59:29 -0700 (PDT) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com. [209.85.217.174]) by mx.google.com with ESMTPS id c7si9561174lah.106.2015.06.01.04.59.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Jun 2015 04:59:28 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) client-ip=209.85.217.174; Received: by lbbuc2 with SMTP id uc2so82761491lbb.2 for ; Mon, 01 Jun 2015 04:59:28 -0700 (PDT) X-Received: by 10.152.29.161 with SMTP id l1mr20483538lah.76.1433159968652; Mon, 01 Jun 2015 04:59:28 -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 hn6csp2259686lbb; Mon, 1 Jun 2015 04:59:27 -0700 (PDT) X-Received: by 10.70.22.131 with SMTP id d3mr39917716pdf.67.1433159966933; Mon, 01 Jun 2015 04:59:26 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bw10si21221734pdb.206.2015.06.01.04.59.25; Mon, 01 Jun 2015 04:59:26 -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 S1753262AbbFAL7U (ORCPT + 28 others); Mon, 1 Jun 2015 07:59:20 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:35222 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752704AbbFAL7P (ORCPT ); Mon, 1 Jun 2015 07:59:15 -0400 Received: by padjw17 with SMTP id jw17so35575292pad.2 for ; Mon, 01 Jun 2015 04:59:15 -0700 (PDT) X-Received: by 10.68.94.37 with SMTP id cz5mr2410763pbb.70.1433159955108; Mon, 01 Jun 2015 04:59:15 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([175.111.195.49]) by mx.google.com with ESMTPSA id om10sm14033208pbb.58.2015.06.01.04.59.11 (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 01 Jun 2015 04:59:14 -0700 (PDT) From: Baolin Wang To: tglx@linutronix.de Cc: arnd@arndb.de, john.stultz@linaro.org, heenasirwani@gmail.com, pang.xunlei@linaro.org, peterz@infradead.org, rafael.j.wysocki@intel.com, linux-kernel@vger.kernel.org, baolin.wang@linaro.org, y2038@lists.linaro.org Subject: [PATCH v4 17/25] timekeeping:Introduce the timekeeping_clocktai() function with timespec64 type Date: Mon, 1 Jun 2015 19:58:55 +0800 Message-Id: <1433159935-5178-1-git-send-email-baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 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.174 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: , This patch converts the timespec type to timespec64 type for timekeeping_clocktai() function which is used only in the posix-timers.c file, that makes it ready for 2038 issue. And remove the declaration of timekeeping_clocktai() in kernel/time/timekeeping.h file, cause nothing uses that declaration now, and it would conflict with the inline definition in the include/linux/timekeeping.h file. Also introduce the clock_get64 callback pointer for the k_clock structure, and convert the timespec type to timespec64 type for the posix_get_tai() function. Next patch will convert all the timespec/itimerspec to the timespec64/itimerspec64 type for other callbacks of the k_clock structure in the kernel/time/posix-timers.c file. Signed-off-by: Baolin Wang --- include/linux/timekeeping.h | 4 ++-- kernel/time/posix-timers.c | 4 ++-- kernel/time/timekeeping.h | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/include/linux/timekeeping.h b/include/linux/timekeeping.h index 89beb62..c3345d5 100644 --- a/include/linux/timekeeping.h +++ b/include/linux/timekeeping.h @@ -250,9 +250,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 d2975d9..04d5512 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; @@ -343,7 +343,7 @@ static __init int init_posix_timers(void) }; struct k_clock clock_tai = { .clock_getres = hrtimer_get_res, - .clock_get = posix_get_tai, + .clock_get64 = posix_get_tai, .nsleep = common_nsleep, .nsleep_restart = hrtimer_nanosleep_restart, .timer_create = common_timer_create, diff --git a/kernel/time/timekeeping.h b/kernel/time/timekeeping.h index 1d91416..04c7943 100644 --- a/kernel/time/timekeeping.h +++ b/kernel/time/timekeeping.h @@ -15,7 +15,6 @@ extern u64 timekeeping_max_deferment(void); extern int timekeeping_inject_offset(struct timespec *ts); extern s32 timekeeping_get_tai_offset(void); extern void timekeeping_set_tai_offset(s32 tai_offset); -extern void timekeeping_clocktai(struct timespec *ts); extern int timekeeping_suspend(void); extern void timekeeping_resume(void);