From patchwork Fri Jun 12 02:04:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xunlei Pang X-Patchwork-Id: 49779 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A09452460E for ; Fri, 12 Jun 2015 02:07:17 +0000 (UTC) Received: by laboh3 with SMTP id oh3sf6776968lab.0 for ; Thu, 11 Jun 2015 19:07:16 -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=GerpDJOjSgeGyj62Wjzw8/tIAVTC/FRBjxyGylfYK5Y=; b=Y3bimJGDtTgIg6Y1L3MZRrpIJy3txmgKbr1FbK+TyFg45P0SseMQ+0AZBMe/8DbfnZ nBUPJidACvSuc6MRdYrPiYfEXXM+S/UhbBbySI24E1T+ZHe/Q+FdetWozCL+K/bkNRWW xLnVwMnDgR3fZi1AGGBanwO0wKHqt7KBJTA1ha1YVHzobifUxkVZ/6KYADJ6UQtWaDfZ 32QbgexHII6W5z8UQXwj0nm3VkWKhxqR4sdzDNSxBdHzwaciums5NWFYxEi1EsahRX0C c08IWjIJM6M91Q97xwAUtyvlXraJofkOz1VBCpTMiz7e5GcZOt3IZRBFDdc18itPGv6J Ifwg== X-Gm-Message-State: ALoCoQmLtGADg08/ucgR0DmgvX/7uy6dTxANti89DzClGSN6AaWRH6s3pH/XhMGrgePPN9WFdB6B X-Received: by 10.152.5.2 with SMTP id o2mr11646416lao.0.1434074836340; Thu, 11 Jun 2015 19:07:16 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.129 with SMTP id s1ls278983las.89.gmail; Thu, 11 Jun 2015 19:07:16 -0700 (PDT) X-Received: by 10.152.44.132 with SMTP id e4mr13060619lam.34.1434074836157; Thu, 11 Jun 2015 19:07:16 -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 yg5si2108539lab.174.2015.06.11.19.07.16 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Jun 2015 19:07:16 -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 lbbtu8 with SMTP id tu8so11969456lbb.2 for ; Thu, 11 Jun 2015 19:07:16 -0700 (PDT) X-Received: by 10.112.199.133 with SMTP id jk5mr13128031lbc.32.1434074836007; Thu, 11 Jun 2015 19:07:16 -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 hn6csp217482lbb; Thu, 11 Jun 2015 19:07:14 -0700 (PDT) X-Received: by 10.68.103.164 with SMTP id fx4mr19127389pbb.125.1434074833670; Thu, 11 Jun 2015 19:07:13 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id by3si2093831pdb.201.2015.06.11.19.07.12; Thu, 11 Jun 2015 19:07:13 -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 S1751746AbbFLCG5 (ORCPT + 29 others); Thu, 11 Jun 2015 22:06:57 -0400 Received: from m50-112.126.com ([123.125.50.112]:52178 "EHLO m50-112.126.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750737AbbFLCGr (ORCPT ); Thu, 11 Jun 2015 22:06:47 -0400 Received: from localhost.localdomain (unknown [210.21.223.3]) by smtp6 (Coremail) with SMTP id j9KowAAnryswPnpVKTVCAA--.101S2; Fri, 12 Jun 2015 10:04:42 +0800 (CST) From: Xunlei Pang To: linux-kernel@vger.kernel.org Cc: rtc-linux@googlegroups.com, Alessandro Zummo , Alexandre Belloni , John Stultz , Arnd Bergmann , Xunlei Pang Subject: [PATCH v3 1/4] drivers/rtc/pcf8563: Replace deprecated rtc_time_to_tm() and rtc_tm_to_time() Date: Fri, 12 Jun 2015 10:04:09 +0800 Message-Id: <1434074652-16054-1-git-send-email-xlpang@126.com> X-Mailer: git-send-email 1.9.1 X-CM-TRANSID: j9KowAAnryswPnpVKTVCAA--.101S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7AF45urWUXw43Aw13Jw4xWFg_yoW8GrW5pF 4rGFyDtrs2qryFgwn2yFykuF4rJ3WkJ3ykXF4DG39Y9F1rXasrKF9YkryUK34UXa95CF12 vF4rZF15Jw1DCa7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jVzuXUUUUU= X-Originating-IP: [210.21.223.3] X-CM-SenderInfo: p0ost0bj6rjloofrz/1tbimhEXv1GfW36ZlgAAsH 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=@126.com; 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() Acked-by: Arnd Bergmann Signed-off-by: Xunlei Pang --- v2->v3: no changes. 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 "