summaryrefslogtreecommitdiffstats
path: root/kernel/time/posix-clock.c
diff options
context:
space:
mode:
authorDeepa Dinamani <deepa.kernel@gmail.com>2017-03-26 21:04:17 +0200
committerThomas Gleixner <tglx@linutronix.de>2017-04-14 21:49:56 +0200
commit5f252b325625c13db1dbc76ac6cdb49ee3bd062e (patch)
tree0e6d6ce2d1acf7f5bcecc3e33724fcd0b76b39c4 /kernel/time/posix-clock.c
parenttime: Change k_clock clock_set() to use timespec64 (diff)
downloadlinux-5f252b325625c13db1dbc76ac6cdb49ee3bd062e.tar.xz
linux-5f252b325625c13db1dbc76ac6cdb49ee3bd062e.zip
time: Change k_clock timer_set() and timer_get() to use timespec64
struct timespec is not y2038 safe on 32 bit machines. Replace uses of struct timespec with struct timespec64 in the kernel. struct itimerspec internally uses struct timespec. Use struct itimerspec64 which uses struct timespec64. The syscall interfaces themselves will be changed in a separate series. Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com> Cc: y2038@lists.linaro.org Cc: john.stultz@linaro.org Cc: arnd@arndb.de Link: http://lkml.kernel.org/r/1490555058-4603-7-git-send-email-deepa.kernel@gmail.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/time/posix-clock.c')
-rw-r--r--kernel/time/posix-clock.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/kernel/time/posix-clock.c b/kernel/time/posix-clock.c
index 3807a34519c4..31d588d37a17 100644
--- a/kernel/time/posix-clock.c
+++ b/kernel/time/posix-clock.c
@@ -399,40 +399,33 @@ static int pc_timer_delete(struct k_itimer *kit)
return err;
}
-static void pc_timer_gettime(struct k_itimer *kit, struct itimerspec *ts)
+static void pc_timer_gettime(struct k_itimer *kit, struct itimerspec64 *ts)
{
clockid_t id = kit->it_clock;
struct posix_clock_desc cd;
- struct itimerspec64 ts64;
if (get_clock_desc(id, &cd))
return;
- if (cd.clk->ops.timer_gettime) {
- cd.clk->ops.timer_gettime(cd.clk, kit, &ts64);
- *ts = itimerspec64_to_itimerspec(&ts64);
- }
+ if (cd.clk->ops.timer_gettime)
+ cd.clk->ops.timer_gettime(cd.clk, kit, ts);
+
put_clock_desc(&cd);
}
static int pc_timer_settime(struct k_itimer *kit, int flags,
- struct itimerspec *ts, struct itimerspec *old)
+ struct itimerspec64 *ts, struct itimerspec64 *old)
{
- struct itimerspec64 ts64 = itimerspec_to_itimerspec64(ts);
clockid_t id = kit->it_clock;
struct posix_clock_desc cd;
- struct itimerspec64 old64;
int err;
err = get_clock_desc(id, &cd);
if (err)
return err;
- if (cd.clk->ops.timer_settime) {
- err = cd.clk->ops.timer_settime(cd.clk, kit, flags, &ts64, &old64);
- if (old)
- *old = itimerspec64_to_itimerspec(&old64);
- }
+ if (cd.clk->ops.timer_settime)
+ err = cd.clk->ops.timer_settime(cd.clk, kit, flags, ts, old);
else
err = -EOPNOTSUPP;