lkml.org 
[lkml]   [2015]   [Jan]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH v2 5/9] rtc/mc13xxx: Update driver to address y2038/y2106 issues
Hello,

On Wed, Jan 14, 2015 at 11:07:31PM +0800, Xunlei Pang wrote:
> Cc Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
Thanks, that was useful.

>
> On 13 January 2015 at 23:44, Xunlei Pang <xlpang@126.com> wrote:
> > From: Xunlei Pang <pang.xunlei@linaro.org>
> >
> > This driver has a number of y2038/y2106 issues.
> >
> > This patch resolves them by:
> > - Replace rtc_time_to_tm() with rtc_time64_to_tm()
> > - Change mc13xxx_rtc_set_mmss() to use rtc_class_ops's set_mmss64()
> >
> > After this patch, the driver should not have any remaining
> > y2038/y2106 issues.
> >
> > Signed-off-by: Xunlei Pang <pang.xunlei@linaro.org>
> > ---
> > drivers/rtc/rtc-mc13xxx.c | 32 ++++++++++++++------------------
> > 1 file changed, 14 insertions(+), 18 deletions(-)
> >
> > diff --git a/drivers/rtc/rtc-mc13xxx.c b/drivers/rtc/rtc-mc13xxx.c
> > index 5bce904b..32df1d8 100644
> > --- a/drivers/rtc/rtc-mc13xxx.c
> > +++ b/drivers/rtc/rtc-mc13xxx.c
> > @@ -83,20 +83,19 @@ static int mc13xxx_rtc_read_time(struct device *dev, struct rtc_time *tm)
> > return ret;
> > } while (days1 != days2);
> >
> > - rtc_time_to_tm(days1 * SEC_PER_DAY + seconds, tm);
> > + rtc_time64_to_tm((time64_t)days1 * SEC_PER_DAY + seconds, tm);
> >
> > return rtc_valid_tm(tm);
> > }
> >
> > -static int mc13xxx_rtc_set_mmss(struct device *dev, unsigned long secs)
> > +static int mc13xxx_rtc_set_mmss(struct device *dev, time64_t secs)
I don't know if there is a usual conversion rule, but I'd expect that
the function is also renamed to get a suffix 64.

Other than that the patch looks good.

Best regards
Uwe

--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |


\
 
 \ /
  Last update: 2015-01-14 18:41    [W:3.751 / U:0.524 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site