diff mbox series

blackfin: time: Use read_persistent_clock64() instead of read_persistent_clock()

Message ID 6d0c9ea91b9e33757073a05756e2ac1078168945.1519796369.git.baolin.wang@linaro.org
State New
Headers show
Series blackfin: time: Use read_persistent_clock64() instead of read_persistent_clock() | expand

Commit Message

(Exiting) Baolin Wang Feb. 28, 2018, 5:57 a.m. UTC
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@linaro.org>

---
 arch/blackfin/kernel/time-ts.c |    6 ++++--
 arch/blackfin/kernel/time.c    |    6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

-- 
1.7.9.5
diff mbox series

Patch

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;
 }