Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753744AbbFATxp (ORCPT ); Mon, 1 Jun 2015 15:53:45 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:54529 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751891AbbFATxh (ORCPT ); Mon, 1 Jun 2015 15:53:37 -0400 From: Arnd Bergmann To: Xunlei Pang Cc: linux-kernel@vger.kernel.org, rtc-linux@googlegroups.com, Alessandro Zummo , John Stultz , Xunlei Pang , Carlo Caione Subject: Re: [PATCH RESEND 3/3] drivers/rtc/sunxi: Replace deprecated rtc_tm_to_time() Date: Mon, 01 Jun 2015 21:53:03 +0200 Message-ID: <3461238.S8UhmYfQDn@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <1432911877-607-3-git-send-email-xlpang@126.com> References: <1432911877-607-1-git-send-email-xlpang@126.com> <1432911877-607-3-git-send-email-xlpang@126.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:y/bCZ9sYQggYVb1pzCASMNCO6NYJbMIHGRrHtlJwMARhNNy2/sA 4mIhBTBct5p6EHUex4zJ+gw0bp2Mfb4mgqsMv4Fjn/1JV4RlgXEmC0cKBHXh7NJK7iGW3GJ gDdskPifXWUJYWcCx+5TBTCyW35dqzT8C4Fr6dVcQgiEIBKvLU+g/MdiX8MbhDFXdK7HhU8 vu0F2rZz8X+kvoRQedqBw== X-UI-Out-Filterresults: notjunk:1;V01:K0:sJoid8Z0DP0=:2njUrsIxGOqNCn+QTvvGtj SDB/FSnIpxn9lJQDvOKUST1lnQnXiLh2bky/wUpxY9KE03G7hH6K25qbLC4TX9vk+FKyk4ki6 NwAsabSNI3NIyxclBLMwrBraRezE3DAPqqjY7CsY78ZWZ1eAOw8S2Z6c8gsSK7HGfp5HS7D9K 1xdS6R2odbkSht8/uPlS5ud1/u62eQksIXaD4de5ilVWD4dz2yI98jmrGoLxTs7EDcxJGbD4C NaxZeO6Jc55LbRdGdy1sNWVb+lZqTG4rc+XWFTMksxiEKW6eS/gPHG5xM4TjH/pi0EsSHbyOf w5d08tLwljW6nLc1yQXaj+ZEyRsG2nwzGnxLTLhSsuC2PEsMQa+drRtSkyEsJYog9Ippf11nZ 8nmgF+ZSKbL3PeIKu8YVn0n9bE4tliLDiCidtxVJ2mFeyygBf+MxGIKR1SRn443O2S2+lhLu9 v5fYY4bbKpswqsACBL/TW+g7WL00QkKt7uHFoOx5LXYLaZXZLYn5kUeYbdZmS11o9enb/3b1U A4Ir92MarpA6mJTcwtKvwqxLj3ithA+4bGsnQsxQTDZ2SvHv0vCkC26MzyhMlWXSTxmfXqC/f GDz6uEQZpzZFuSyZepWkp3gxequKYPhJc3ucrhCDDro3FDEy93Rl9O+FQxshNcXwOLbuIOUwX TViN0SMOhzNm33MZQeHowCVNV22cjw2c8wgNOOmeZJCgudQ== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1087 Lines: 32 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. Arnd -- 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/