diff mbox

[1/2] drivers/rtc/interface.c: Change rtc_set_mmss() to use time64_t

Message ID 1431682292-29732-1-git-send-email-xlpang@126.com
State New
Headers show

Commit Message

Xunlei Pang May 15, 2015, 9:31 a.m. UTC
From: Xunlei Pang <pang.xunlei@linaro.org>

rtc_set_mmss() uses "unsigned long" as its second parameter which
may have y2038 problem on 32-bit systems.

Change it to use time64_t.

All its call sites will be changed later(there are no problems
leaving these call sites untouched).

Signed-off-by: Xunlei Pang <pang.xunlei@linaro.org>
---
 drivers/rtc/interface.c | 2 +-
 include/linux/rtc.h     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

John Stultz May 15, 2015, 11:46 p.m. UTC | #1
On Fri, May 15, 2015 at 2:31 AM, Xunlei Pang <xlpang@126.com> wrote:
> From: Xunlei Pang <pang.xunlei@linaro.org>
>
> rtc_set_mmss() uses "unsigned long" as its second parameter which
> may have y2038 problem on 32-bit systems.
>
> Change it to use time64_t.
>
> All its call sites will be changed later(there are no problems
> leaving these call sites untouched).

This line isn't super convincing. Better to explain *why* there aren't
problems making this change first, rather then just asserting it, and
to give some confidence you'll address this, point out that sparc is
the only user of this funciton and will be updated by the following
patch in the series.

thanks
-john
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
diff mbox

Patch

diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c
index d43ee40..480ee3c 100644
--- a/drivers/rtc/interface.c
+++ b/drivers/rtc/interface.c
@@ -90,7 +90,7 @@  int rtc_set_time(struct rtc_device *rtc, struct rtc_time *tm)
 }
 EXPORT_SYMBOL_GPL(rtc_set_time);
 
-int rtc_set_mmss(struct rtc_device *rtc, unsigned long secs)
+int rtc_set_mmss(struct rtc_device *rtc, time64_t secs)
 {
 	int err;
 
diff --git a/include/linux/rtc.h b/include/linux/rtc.h
index 8dcf682..9c3180e 100644
--- a/include/linux/rtc.h
+++ b/include/linux/rtc.h
@@ -161,7 +161,7 @@  extern void devm_rtc_device_unregister(struct device *dev,
 
 extern int rtc_read_time(struct rtc_device *rtc, struct rtc_time *tm);
 extern int rtc_set_time(struct rtc_device *rtc, struct rtc_time *tm);
-extern int rtc_set_mmss(struct rtc_device *rtc, unsigned long secs);
+extern int rtc_set_mmss(struct rtc_device *rtc, time64_t secs);
 extern int rtc_set_ntp_time(struct timespec64 now);
 int __rtc_read_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm);
 extern int rtc_read_alarm(struct rtc_device *rtc,