From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Xunlei Pang <pang.xunlei@linaro.org>
Cc: Xunlei Pang <xlpang@126.com>, lkml <linux-kernel@vger.kernel.org>,
John Stultz <john.stultz@linaro.org>,
Arnd Bergmann <arnd.bergmann@linaro.org>,
"rtc-linux@googlegroups.com" <rtc-linux@googlegroups.com>,
Thomas Gleixner <tglx@linutronix.de>,
Alessandro Zummo <a.zummo@towertech.it>
Subject: Re: [RFC PATCH v2 5/9] rtc/mc13xxx: Update driver to address y2038/y2106 issues
Date: Wed, 14 Jan 2015 18:03:45 +0100 [thread overview]
Message-ID: <20150114170345.GM22880@pengutronix.de> (raw)
In-Reply-To: <CADcy93Xkyn-vg6zJw7S=1aO-i4ack66TLn8JHLuZShnB4nWKYw@mail.gmail.com>
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/ |
next prev parent reply other threads:[~2015-01-14 17:03 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-13 15:44 [RFC PATCH v2 0/9] Provide y2038/y2106 safe rtc_class_ops.set_mmss64() Xunlei Pang
2015-01-13 15:44 ` [RFC PATCH v2 1/9] rtc: Provide y2038 safe rtc_class_ops.set_mmss() replacement Xunlei Pang
2015-01-13 16:12 ` Alessandro Zummo
2015-01-13 15:44 ` [RFC PATCH v2 2/9] time: Provide y2106 safe get_seconds() replacement Xunlei Pang
2015-01-13 16:17 ` Alessandro Zummo
2015-01-13 20:34 ` Arnd Bergmann
2015-01-13 20:42 ` Thomas Gleixner
2015-01-14 14:52 ` Xunlei Pang
2015-01-13 15:44 ` [RFC PATCH v2 3/9] rtc/test: Update driver to address y2038/y2106 issues Xunlei Pang
2015-01-13 16:19 ` Alessandro Zummo
2015-01-14 14:56 ` Xunlei Pang
2015-01-14 15:03 ` Alessandro Zummo
2015-01-14 15:26 ` Xunlei Pang
2015-01-14 15:39 ` Alessandro Zummo
2015-01-16 15:40 ` Xunlei Pang
2015-01-13 15:44 ` [RFC PATCH v2 4/9] rtc/ab3100: " Xunlei Pang
2015-01-13 16:20 ` Alessandro Zummo
2015-01-15 17:23 ` Linus Walleij
2015-01-13 15:44 ` [RFC PATCH v2 5/9] rtc/mc13xxx: " Xunlei Pang
2015-01-14 15:07 ` Xunlei Pang
2015-01-14 17:03 ` Uwe Kleine-König [this message]
2015-01-13 15:44 ` [RFC PATCH v2 6/9] rtc/mxc: Modify rtc_update_alarm() not to touch the alarm time Xunlei Pang
2015-01-13 16:23 ` Alessandro Zummo
2015-01-14 15:13 ` Xunlei Pang
2015-01-13 15:44 ` [RFC PATCH v2 7/9] rtc/mxc: Convert get_alarm_or_time()/set_alarm_or_time() to use time64_t Xunlei Pang
2015-01-13 15:44 ` [RFC PATCH v2 8/9] rtc/mxc: Update driver to address y2038/y2106 issues Xunlei Pang
2015-01-13 15:44 ` [RFC PATCH v2 9/9] alpha: change to use rtc_class_ops's set_mmss64() Xunlei Pang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150114170345.GM22880@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=a.zummo@towertech.it \
--cc=arnd.bergmann@linaro.org \
--cc=john.stultz@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pang.xunlei@linaro.org \
--cc=rtc-linux@googlegroups.com \
--cc=tglx@linutronix.de \
--cc=xlpang@126.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®