From patchwork Fri May 29 15:04:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xunlei Pang X-Patchwork-Id: 49226 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 65C9F218EC for ; Fri, 29 May 2015 15:07:23 +0000 (UTC) Received: by lbbti3 with SMTP id ti3sf19882163lbb.1 for ; Fri, 29 May 2015 08:07:22 -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:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=dSnhp+1AEWcdmqf8HAevo7W/yFOL4N7lsbYonpo7paQ=; b=R1DKMh50SNb4sw5VNkHEhpXoHPhAWdteQlc5silbvSCgIylRXpcT6/+UIkz6tOQs1p Er3DkQHZgbcNeXjHVDA/+0/MWsBZ/TFziYrGvDgFNukZ4Y9QoQ+OHEnQT0U4i7aUCOoq S3cepdjSnaqh3CcaTiNSaPdDUvjgk02b4qIpfDc4bKBOKb4zXvDXTV448O+6Tz0jlPsM u+WQuM84K5eXXOV+fKEqY9IUY4j95s7upF83OAgfCaiIDtrCnVME86fJgC+6lFisiSzg z3mnl2Beywvk4FBzqmfgfGqUq/Rutu04upI/rRdBoybKRGKr6+aJJvAeuhljMsHhgsqu EYAg== X-Gm-Message-State: ALoCoQlvF+rgJXB/ahO3eXNxjaiiov/PGJ7ssTzPWRLYCORAnEMgTjV7QwVpBx5ePkWmhGoJWAeb X-Received: by 10.194.236.230 with SMTP id ux6mr7599872wjc.5.1432912042360; Fri, 29 May 2015 08:07:22 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.9.163 with SMTP id a3ls341675lab.103.gmail; Fri, 29 May 2015 08:07:22 -0700 (PDT) X-Received: by 10.152.4.98 with SMTP id j2mr8536528laj.42.1432912042155; Fri, 29 May 2015 08:07:22 -0700 (PDT) Received: from mail-lb0-x22f.google.com (mail-lb0-x22f.google.com. [2a00:1450:4010:c04::22f]) by mx.google.com with ESMTPS id m5si4876884laf.170.2015.05.29.08.07.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 May 2015 08:07:22 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::22f as permitted sender) client-ip=2a00:1450:4010:c04::22f; Received: by lbbuc2 with SMTP id uc2so50451784lbb.2 for ; Fri, 29 May 2015 08:07:22 -0700 (PDT) X-Received: by 10.152.21.136 with SMTP id v8mr8460175lae.19.1432912042026; Fri, 29 May 2015 08:07:22 -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 hn6csp408290lbb; Fri, 29 May 2015 08:07:20 -0700 (PDT) X-Received: by 10.70.101.200 with SMTP id fi8mr15599238pdb.161.1432912039784; Fri, 29 May 2015 08:07:19 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h16si8770108pde.217.2015.05.29.08.07.18; Fri, 29 May 2015 08:07:19 -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 S1756698AbbE2PHO (ORCPT + 28 others); Fri, 29 May 2015 11:07:14 -0400 Received: from m50-111.126.com ([123.125.50.111]:33553 "EHLO m50-111.126.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756523AbbE2PGb (ORCPT ); Fri, 29 May 2015 11:06:31 -0400 Received: from localhost.localdomain (unknown [210.21.223.3]) by smtp5 (Coremail) with SMTP id jtKowAAHBg8LgGhVo1v_AA--.164S3; Fri, 29 May 2015 23:04:50 +0800 (CST) From: Xunlei Pang To: linux-kernel@vger.kernel.org Cc: rtc-linux@googlegroups.com, Alessandro Zummo , John Stultz , Arnd Bergmann , Xunlei Pang , Herbert Valerio Riedel Subject: [PATCH RESEND 2/3] drivers/rtc/isl1208: Replace deprecated rtc_tm_to_time() Date: Fri, 29 May 2015 23:04:36 +0800 Message-Id: <1432911877-607-2-git-send-email-xlpang@126.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1432911877-607-1-git-send-email-xlpang@126.com> References: <1432911877-607-1-git-send-email-xlpang@126.com> X-CM-TRANSID: jtKowAAHBg8LgGhVo1v_AA--.164S3 X-Coremail-Antispam: 1Uf129KBjvJXoW7Zw4kGr4kKF4DXF48Cw48Zwb_yoW8GFWUpF 42k3s0vrs2qr93WrnFyF1DuFWrGa4UtaykGFWxJa9a93WfX3WDKFWFkr409ryUXa1kC3y3 WF1YyF15Kr1Uu3JanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jToGQUUUUU= X-Originating-IP: [210.21.223.3] X-CM-SenderInfo: p0ost0bj6rjloofrz/1tbiJxoJv01sB8drtwABs3 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::22f 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 isl1208_i2c_set_alarm() uses deprecated rtc_tm_to_time(), which will overflow in year 2106 on 32-bit machines. This patch solves this by: - Replacing rtc_tm_to_time() with rtc_tm_to_time64() Cc: Herbert Valerio Riedel Signed-off-by: Xunlei Pang --- drivers/rtc/rtc-isl1208.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/rtc/rtc-isl1208.c b/drivers/rtc/rtc-isl1208.c index c3c549d..06113e8 100644 --- a/drivers/rtc/rtc-isl1208.c +++ b/drivers/rtc/rtc-isl1208.c @@ -370,19 +370,16 @@ isl1208_i2c_set_alarm(struct i2c_client *client, struct rtc_wkalrm *alarm) struct rtc_time *alarm_tm = &alarm->time; u8 regs[ISL1208_ALARM_SECTION_LEN] = { 0, }; const int offs = ISL1208_REG_SCA; - unsigned long rtc_secs, alarm_secs; + time64_t rtc_secs, alarm_secs; struct rtc_time rtc_tm; int err, enable; err = isl1208_i2c_read_time(client, &rtc_tm); if (err) return err; - err = rtc_tm_to_time(&rtc_tm, &rtc_secs); - if (err) - return err; - err = rtc_tm_to_time(alarm_tm, &alarm_secs); - if (err) - return err; + + rtc_secs = rtc_tm_to_time64(&rtc_tm); + alarm_secs = rtc_tm_to_time64(alarm_tm); /* If the alarm time is before the current time disable the alarm */ if (!alarm->enabled || alarm_secs <= rtc_secs)