From patchwork Wed Apr 15 09:20:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xunlei Pang X-Patchwork-Id: 47164 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BD2CD20553 for ; Wed, 15 Apr 2015 09:21:42 +0000 (UTC) Received: by lbbrr5 with SMTP id rr5sf8050360lbb.3 for ; Wed, 15 Apr 2015 02:21:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=q/ZflvE+QsXb8KaK89onhMU0wlrlTYlfl803jz9/C9o=; b=YmM9Jj34c34ZMBx2xUKNLroWHeCPlWpXR1PFQzwAzWVJlW8+2S8R7uS9C9wl/pwX7t L85Am11e4N4cl8h3TLReS7k/k/LhMSVENpQU5oMTeZSYki5ZQWsFbn63gwP6Uy5Ky4u6 y1U72rxTOLt3haO4PlMnlILGwgKaKthrUhvgHHnVQYiQt6FndnvNzoKbGAqA0HPrw/Pj Od5mm2qWtpYqNuF9VqJxIL5xFB62nCYUCS2z6c4Yy5oh/wqPPdnojU8yc6KgZSMk0W9B pRDAGqazVL1GEI/RiJB5q3ceDCAVe5Z9+CpzTpWrXt8Lh7KIwPIE2qhxF1cawT4VHyrJ 4sGQ== X-Gm-Message-State: ALoCoQlnEoiIa2xrPCZaCiTUgieVpe+7WlNtJB874BnL3JE0AMCNoUxndOvRG22Gu57BWDNGHGOh X-Received: by 10.152.163.99 with SMTP id yh3mr4837482lab.8.1429089701417; Wed, 15 Apr 2015 02:21:41 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.170.198 with SMTP id ao6ls153298lac.103.gmail; Wed, 15 Apr 2015 02:21:41 -0700 (PDT) X-Received: by 10.152.22.168 with SMTP id e8mr22444418laf.27.1429089701243; Wed, 15 Apr 2015 02:21:41 -0700 (PDT) Received: from mail-lb0-x22d.google.com (mail-lb0-x22d.google.com. [2a00:1450:4010:c04::22d]) by mx.google.com with ESMTPS id oq3si3369496lbb.125.2015.04.15.02.21.41 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Apr 2015 02:21:41 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::22d as permitted sender) client-ip=2a00:1450:4010:c04::22d; Received: by lbcga7 with SMTP id ga7so29139542lbc.1 for ; Wed, 15 Apr 2015 02:21:41 -0700 (PDT) X-Received: by 10.112.204.72 with SMTP id kw8mr3015358lbc.88.1429089701143; Wed, 15 Apr 2015 02:21:41 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.67.65 with SMTP id l1csp2383079lbt; Wed, 15 Apr 2015 02:21:40 -0700 (PDT) X-Received: by 10.68.212.41 with SMTP id nh9mr43940685pbc.166.1429089699276; Wed, 15 Apr 2015 02:21:39 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id je6si3300958pbd.73.2015.04.15.02.21.37; Wed, 15 Apr 2015 02:21:39 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932247AbbDOJVd (ORCPT + 27 others); Wed, 15 Apr 2015 05:21:33 -0400 Received: from m15-111.126.com ([220.181.15.111]:44969 "EHLO m15-111.126.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752630AbbDOJVR (ORCPT ); Wed, 15 Apr 2015 05:21:17 -0400 Received: from localhost.localdomain (unknown [210.21.223.3]) by smtp1 (Coremail) with SMTP id C8mowEDJuURQLS5VuDFEAA--.7421S2; Wed, 15 Apr 2015 17:20:23 +0800 (CST) From: Xunlei Pang To: linux-kernel@vger.kernel.org Cc: rtc-linux@googlegroups.com, Alessandro Zummo , John Stultz , Arnd Bergmann , Xunlei Pang Subject: [PATCH 1/5] drivers/rtc/pcf8563: Replace deprecated rtc_time_to_tm() and rtc_tm_to_time() Date: Wed, 15 Apr 2015 17:20:07 +0800 Message-Id: <1429089611-29776-1-git-send-email-xlpang@126.com> X-Mailer: git-send-email 1.9.1 X-CM-TRANSID: C8mowEDJuURQLS5VuDFEAA--.7421S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7AF45urWUXw43Aw13Jw4xWFg_yoW8JFWkpF 4rGFyDtrs2qryFgwn2ya4kur4rJ3WkJayDWF4DG39Y9F1rX3ZrKFn5CFyUK345XFZ5C3W2 vF4rAFy5Xw1DCaDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07j2_M3UUUUU= X-Originating-IP: [210.21.223.3] X-CM-SenderInfo: p0ost0bj6rjloofrz/1tbijAbcv1GfU1FXcwAAsB Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Original-Sender: xlpang@126.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::22d as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=neutral (body hash did not verify) header.i=@; dmarc=fail (p=NONE dis=NONE) header.from=126.com Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Xunlei Pang pcf8563_rtc_set_alarm() uses deprecated rtc_tm_to_time() and rtc_time_to_tm(), which will overflow in year 2106 on 32-bit machines. This patch solves this by: - Replacing rtc_time_to_tm() with rtc_time64_to_tm() - Replacing rtc_tm_to_time() with rtc_tm_to_time64() Signed-off-by: Xunlei Pang --- drivers/rtc/rtc-pcf8563.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/rtc/rtc-pcf8563.c b/drivers/rtc/rtc-pcf8563.c index 96fb32e..4ce66ad 100644 --- a/drivers/rtc/rtc-pcf8563.c +++ b/drivers/rtc/rtc-pcf8563.c @@ -368,13 +368,13 @@ static int pcf8563_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *tm) struct i2c_client *client = to_i2c_client(dev); unsigned char buf[4]; int err; - unsigned long alarm_time; /* The alarm has no seconds, round up to nearest minute */ if (tm->time.tm_sec) { - rtc_tm_to_time(&tm->time, &alarm_time); - alarm_time += 60-tm->time.tm_sec; - rtc_time_to_tm(alarm_time, &tm->time); + time64_t alarm_time = rtc_tm_to_time64(&tm->time); + + alarm_time += 60 - tm->time.tm_sec; + rtc_time64_to_tm(alarm_time, &tm->time); } dev_dbg(dev, "%s, min=%d hour=%d wday=%d mday=%d "