From: Baolin Wang <baolin.wang@linaro.org>
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 [thread overview]
Message-ID: <1433159935-5178-1-git-send-email-baolin.wang@linaro.org> (raw)
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 <baolin.wang@linaro.org>
---
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);
--
1.7.9.5
next reply other threads:[~2015-06-01 11:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-01 11:58 Baolin Wang [this message]
2015-06-02 19:20 ` [PATCH v4 17/25] timekeeping:Introduce the timekeeping_clocktai() function with timespec64 type Thomas Gleixner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1433159935-5178-1-git-send-email-baolin.wang@linaro.org \
--to=baolin.wang@linaro.org \
--cc=arnd@arndb.de \
--cc=heenasirwani@gmail.com \
--cc=john.stultz@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pang.xunlei@linaro.org \
--cc=peterz@infradead.org \
--cc=rafael.j.wysocki@intel.com \
--cc=tglx@linutronix.de \
--cc=y2038@lists.linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).