From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753581AbbANRDv (ORCPT ); Wed, 14 Jan 2015 12:03:51 -0500 Received: from metis.ext.pengutronix.de ([92.198.50.35]:33217 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751598AbbANRDu (ORCPT ); Wed, 14 Jan 2015 12:03:50 -0500 Date: Wed, 14 Jan 2015 18:03:45 +0100 From: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= To: Xunlei Pang Cc: Xunlei Pang , lkml , John Stultz , Arnd Bergmann , "rtc-linux@googlegroups.com" , Thomas Gleixner , Alessandro Zummo Subject: Re: [RFC PATCH v2 5/9] rtc/mc13xxx: Update driver to address y2038/y2106 issues Message-ID: <20150114170345.GM22880@pengutronix.de> References: <1421163897-8020-1-git-send-email-xlpang@126.com> <1421163897-8020-6-git-send-email-xlpang@126.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Wed, Jan 14, 2015 at 11:07:31PM +0800, Xunlei Pang wrote: > Cc Uwe Kleine-Koenig Thanks, that was useful. > > On 13 January 2015 at 23:44, Xunlei Pang wrote: > > From: Xunlei Pang > > > > 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 > > --- > > 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/ |