linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] blackfin: time: Use read_persistent_clock64() instead of read_persistent_clock()
@ 2018-02-28  5:57 Baolin Wang
  0 siblings, 0 replies; only message in thread
From: Baolin Wang @ 2018-02-28  5:57 UTC (permalink / raw)
  To: john.stultz, nicstange, arnd
  Cc: adi-buildroot-devel, linux-kernel, broonie, baolin.wang

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(-)

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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-02-28  5:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-28  5:57 [PATCH] blackfin: time: Use read_persistent_clock64() instead of read_persistent_clock() Baolin Wang

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).