Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755227AbbFBDVi (ORCPT ); Mon, 1 Jun 2015 23:21:38 -0400 Received: from mx5.zte.com.cn ([63.217.80.70]:33726 "EHLO mx5.zte.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752231AbbFBDVb (ORCPT ); Mon, 1 Jun 2015 23:21:31 -0400 In-Reply-To: <3461238.S8UhmYfQDn@wuerfel> References: <1432911877-607-1-git-send-email-xlpang@126.com> <1432911877-607-3-git-send-email-xlpang@126.com> <3461238.S8UhmYfQDn@wuerfel> To: Arnd Bergmann Cc: Alessandro Zummo , Carlo Caione , John Stultz , linux-kernel@vger.kernel.org, Xunlei Pang , rtc-linux@googlegroups.com Subject: Re: [PATCH RESEND 3/3] drivers/rtc/sunxi: Replace deprecated rtc_tm_to_time() MIME-Version: 1.0 X-KeepSent: 21D1C9CA:9D69E6EA-48257E58:00122AC0; type=4; name=$KeepSent X-Mailer: Lotus Notes Release 8.5.3 September 15, 2011 Message-ID: From: pang.xunlei@zte.com.cn Date: Tue, 2 Jun 2015 11:21:24 +0800 X-MIMETrack: Serialize by Router on notes_smtp/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2015-06-02 11:20:59, Serialize complete at 2015-06-02 11:20:59 Content-Type: text/plain; charset="US-ASCII" X-MAIL: mse01.zte.com.cn t523LF3U031688 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1829 Lines: 43 Hi Arnd, Arnd Bergmann wrote 2015-06-02 AM 03:53:03: > Re: [PATCH RESEND 3/3] drivers/rtc/sunxi: Replace deprecated rtc_tm_to_time() > > On Friday 29 May 2015 23:04:37 Xunlei Pang wrote: > > } > > > > - rtc_tm_to_time(alrm_tm, &time_set); > > - rtc_tm_to_time(&tm_now, &time_now); > > + time_set = rtc_tm_to_time64(alrm_tm); > > + time_now = rtc_tm_to_time64(&tm_now); > > if (time_set <= time_now) { > > dev_err(dev, "Date to set in the past\n"); > > return -EINVAL; > > } > > > > + if (time_set > time_now + 255 * SEC_IN_DAY) { > > + dev_err(dev, "Day must be in the range 0 - 255\n"); > > + return -EINVAL; > > + } > > + > > > > So this driver also uses the two values just to do a comparison > and to take the difference in seconds. > > If we have a helper function that returns the difference between > two rtc_tm values as a time64_t, we can use that for both > this driver and isl1208. Indeed, will do. Thanks, -Xunlei -------------------------------------------------------- ZTE Information Security Notice: The information contained in this mail (and any attachment transmitted herewith) is privileged and confidential and is intended for the exclusive use of the addressee(s). If you are not an intended recipient, any disclosure, reproduction, distribution or other dissemination or use of the information contained is strictly prohibited. If you have received this mail in error, please delete it and notify us immediately. -- 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/