From patchwork Fri May 29 15:04:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xunlei Pang X-Patchwork-Id: 49224 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 870E8218EC for ; Fri, 29 May 2015 15:06:42 +0000 (UTC) Received: by lbcue7 with SMTP id ue7sf19789739lbc.3 for ; Fri, 29 May 2015 08:06: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=OqxwA0PWTcDmwPSZFxpGgN+aOZGnhRN5P029YcppABs=; b=e4HuP3y46osc/ylSa/DNmY/06LQynVOJV0395/xa2xHgSck9dtKt67oE1eDe50iMVo DsuKCvidTJr4YOcNpwSiu1fVEiU8WnPfjbseisWbHpEXUyJ0DjJx4RXzPSy570EUNuAV O9DwTaM1HywKPWqTO4Ai1aOPHS+Iq/ra9iJNKzjTvdm+Zkd0V499bdTQSqpm0FQKb0nY o2554LeYm+9pz5gUn90HWojTXN9VbSS4chvt4kxuKBwuIF6iiVzbPuPyKy+Rkn4evLVq 0DpVE9mdXqJvt+Kl51aWr/hYJtpklTOoRpxm4WNHD/MoTjEE8Xn0lTzCHidEXJNbWMP4 7B5g== X-Gm-Message-State: ALoCoQlzFuZKDBsrKptm0kWQzdCF5/KTSry2AFmFURXvevFzoW6BIzIy/U0+mk2fClef7ro87VtM X-Received: by 10.112.219.200 with SMTP id pq8mr7741982lbc.7.1432912001414; Fri, 29 May 2015 08:06:41 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.30.37 with SMTP id p5ls366484lah.9.gmail; Fri, 29 May 2015 08:06:41 -0700 (PDT) X-Received: by 10.152.87.72 with SMTP id v8mr8199848laz.2.1432912001237; Fri, 29 May 2015 08:06:41 -0700 (PDT) Received: from mail-la0-x233.google.com (mail-la0-x233.google.com. [2a00:1450:4010:c03::233]) by mx.google.com with ESMTPS id j11si4897012lbg.95.2015.05.29.08.06.41 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 May 2015 08:06:41 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::233 as permitted sender) client-ip=2a00:1450:4010:c03::233; Received: by laat2 with SMTP id t2so57996718laa.1 for ; Fri, 29 May 2015 08:06:41 -0700 (PDT) X-Received: by 10.112.29.36 with SMTP id g4mr8646957lbh.56.1432912000999; Fri, 29 May 2015 08:06:40 -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.108.230 with SMTP id hn6csp407736lbb; Fri, 29 May 2015 08:06:39 -0700 (PDT) X-Received: by 10.70.40.131 with SMTP id x3mr15570042pdk.83.1432911998535; Fri, 29 May 2015 08:06:38 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id pm7si8788005pbb.107.2015.05.29.08.06.37; Fri, 29 May 2015 08:06:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756528AbbE2PGa (ORCPT + 28 others); Fri, 29 May 2015 11:06:30 -0400 Received: from m50-111.126.com ([123.125.50.111]:33404 "EHLO m50-111.126.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756420AbbE2PGN (ORCPT ); Fri, 29 May 2015 11:06:13 -0400 Received: from localhost.localdomain (unknown [210.21.223.3]) by smtp5 (Coremail) with SMTP id jtKowAAHBg8LgGhVo1v_AA--.164S2; Fri, 29 May 2015 23:04:49 +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 RESEND 1/3] drivers/rtc/pcf8563: Replace deprecated rtc_time_to_tm() and rtc_tm_to_time() Date: Fri, 29 May 2015 23:04:35 +0800 Message-Id: <1432911877-607-1-git-send-email-xlpang@126.com> X-Mailer: git-send-email 1.9.1 X-CM-TRANSID: jtKowAAHBg8LgGhVo1v_AA--.164S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7AF45urWUXw43Aw13Jw4xWFg_yoW8JFWkpF 4rGryDtrs2qrySgwn2ya4kur4rJ3WkJaykWF4DG39Y93WrX3ZrKF1rCryUK34UXFZ5C3W2 vF4rZFy5Xw1DCaDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07j2_M3UUUUU= X-Originating-IP: [210.21.223.3] X-CM-SenderInfo: p0ost0bj6rjloofrz/1tbiJxoJv01sB8drtwAAs2 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:c03::233 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 0ba7e59..5f87f84 100644 --- a/drivers/rtc/rtc-pcf8563.c +++ b/drivers/rtc/rtc-pcf8563.c @@ -363,13 +363,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 "