[<prev] [next>] [day] [month] [year] [list]
Message-Id: <6d0c9ea91b9e33757073a05756e2ac1078168945.1519796369.git.baolin.wang@linaro.org>
Date: Wed, 28 Feb 2018 13:57:22 +0800
From: Baolin Wang <baolin.wang@...aro.org>
To: john.stultz@...aro.org, nicstange@...il.com, arnd@...db.de
Cc: adi-buildroot-devel@...ts.sourceforge.net,
linux-kernel@...r.kernel.org, broonie@...nel.org,
baolin.wang@...aro.org
Subject: [PATCH] blackfin: time: Use read_persistent_clock64() instead of read_persistent_clock()
Since struct timespec is not y2038 safe on 32bit machines, this patch
converts read_persistent_clock() to read_persistent_clock64() using
struct timespec64.
Signed-off-by: Baolin Wang <baolin.wang@...aro.org>
---
arch/blackfin/kernel/time-ts.c | 6 ++++--
arch/blackfin/kernel/time.c | 6 ++++--
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/arch/blackfin/kernel/time-ts.c b/arch/blackfin/kernel/time-ts.c
index 0135055..95a80ab 100644
--- a/arch/blackfin/kernel/time-ts.c
+++ b/arch/blackfin/kernel/time-ts.c
@@ -357,9 +357,11 @@ void bfin_coretmr_clockevent_init(void)
#endif /* CONFIG_TICKSOURCE_CORETMR */
-void read_persistent_clock(struct timespec *ts)
+void read_persistent_clock64(struct timespec64 *ts)
{
- time_t secs_since_1970 = (365 * 37 + 9) * 24 * 60 * 60; /* 1 Jan 2007 */
+ /* 1 Jan 2007 */
+ time64_t secs_since_1970 = (365 * 37 + 9) * 24 * 60 * 60;
+
ts->tv_sec = secs_since_1970;
ts->tv_nsec = 0;
}
diff --git a/arch/blackfin/kernel/time.c b/arch/blackfin/kernel/time.c
index 3126b92..48a6684 100644
--- a/arch/blackfin/kernel/time.c
+++ b/arch/blackfin/kernel/time.c
@@ -132,9 +132,11 @@ irqreturn_t timer_interrupt(int irq, void *dummy)
return IRQ_HANDLED;
}
-void read_persistent_clock(struct timespec *ts)
+void read_persistent_clock64(struct timespec64 *ts)
{
- time_t secs_since_1970 = (365 * 37 + 9) * 24 * 60 * 60; /* 1 Jan 2007 */
+ /* 1 Jan 2007 */
+ time64_t secs_since_1970 = (365 * 37 + 9) * 24 * 60 * 60;
+
ts->tv_sec = secs_since_1970;
ts->tv_nsec = 0;
}
--
1.7.9.5
Powered by blists - more mailing lists