diff mbox

[RFC,v2,3/9] rtc/test: Update driver to address y2038/y2106 issues

Message ID 1421163897-8020-4-git-send-email-xlpang@126.com
State New
Headers show

Commit Message

Xunlei Pang Jan. 13, 2015, 3:44 p.m. UTC
From: Xunlei Pang <pang.xunlei@linaro.org>

This driver has a number of y2038/y2106 issues.

This patch resolves them by:
- Repalce get_seconds() with get_seconds64()
- Replace rtc_time_to_tm() with rtc_time64_to_tm()
- Change test_rtc_set_mmss() to use rtc_class_ops's set_mmss64()

After this patch, this driver should not have any remaining
y2038/y2106 issues.

Signed-off-by: Xunlei Pang <pang.xunlei@linaro.org>
---
 drivers/rtc/rtc-test.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

pang.xunlei Jan. 14, 2015, 2:56 p.m. UTC | #1
On 14 January 2015 at 00:19, Alessandro Zummo <a.zummo@towertech.it> wrote:
> On Tue, 13 Jan 2015 23:44:51 +0800
> Xunlei Pang <xlpang@126.com> wrote:
>
>> This patch resolves them by:
>> - Repalce get_seconds() with get_seconds64()
>> - Replace rtc_time_to_tm() with rtc_time64_to_tm()
>> - Change test_rtc_set_mmss() to use rtc_class_ops's set_mmss64()
>
>  so we no more have a non time64 test driver?|

Hi Alessandro,

We want to do away with set_mmss() eventually, time64 is the final version,
so I think this would be ok.

Thanks,
Xunlei

>
> --
>
>  Best regards,
>
>  Alessandro Zummo,
>   Tower Technologies - Torino, Italy
>
>   http://www.towertech.it
>
--
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/
pang.xunlei Jan. 14, 2015, 3:26 p.m. UTC | #2
On 14 January 2015 at 23:03, Alessandro Zummo <a.zummo@towertech.it> wrote:
> On Wed, 14 Jan 2015 22:56:15 +0800
> Xunlei Pang <pang.xunlei@linaro.org> wrote:
>
>> We want to do away with set_mmss() eventually, time64 is the final version,
>> so I think this would be ok.
>
>  We'll get rid of set_mmss() from the test driver later on,
>  after everything else has been converted :)

Ok.

But on the other hand, we will have no test for  set_mmss64(),
because adding the set_mmss64() will make set_mmss() dysfunctional.

Thanks,
Xunlei
>
> --
>
>  Best regards,
>
>  Alessandro Zummo,
>   Tower Technologies - Torino, Italy
>
>   http://www.towertech.it
>
--
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/rtc-test.c b/drivers/rtc/rtc-test.c
index 8f86fa9..056138b 100644
--- a/drivers/rtc/rtc-test.c
+++ b/drivers/rtc/rtc-test.c
@@ -30,13 +30,13 @@  static int test_rtc_set_alarm(struct device *dev,
 static int test_rtc_read_time(struct device *dev,
 	struct rtc_time *tm)
 {
-	rtc_time_to_tm(get_seconds(), tm);
+	rtc_time64_to_tm(get_seconds64(), tm);
 	return 0;
 }
 
-static int test_rtc_set_mmss(struct device *dev, unsigned long secs)
+static int test_rtc_set_mmss(struct device *dev, time64_t secs)
 {
-	dev_info(dev, "%s, secs = %lu\n", __func__, secs);
+	dev_info(dev, "%s, secs = %lld\n", __func__, (long long)secs);
 	return 0;
 }
 
@@ -60,7 +60,7 @@  static const struct rtc_class_ops test_rtc_ops = {
 	.read_time = test_rtc_read_time,
 	.read_alarm = test_rtc_read_alarm,
 	.set_alarm = test_rtc_set_alarm,
-	.set_mmss = test_rtc_set_mmss,
+	.set_mmss64 = test_rtc_set_mmss,
 	.alarm_irq_enable = test_rtc_alarm_irq_enable,
 };