From patchwork Wed Jul 12 08:04:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 107465 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp606770obm; Wed, 12 Jul 2017 01:12:29 -0700 (PDT) X-Received: by 10.84.195.3 with SMTP id i3mr2729886pld.65.1499847149349; Wed, 12 Jul 2017 01:12:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499847149; cv=none; d=google.com; s=arc-20160816; b=MKNOVPI4WQwmNs95p394sxoyKsF9pU7E6Hm1sgIdtBc/KlrA3kY81XazRooPPEJD/v 0Tg0PnuF3ehBOwUJz8z7d+cp/A0BjU0Kz+oR8YuO16NWZnyzG/oPAUdVdqcLQx/mdufE snhhDEobsvenyHQ6kH1s5wsAFutpRBiDJGT0gTtkf0ItPDU6i+xoZXzlr4dsSBNSksv/ hp+hCa3E4xK2lXcIPbI19Ozb0foiuZR+0Ym/P0/vwidoTLpzCdSAWfnfJ5+EjGxx1C7p qxhMNUy+ITEI1F4A4MxaYxrrHSSjWDnhxKsBWgg3/mzoYeAFrui67I9OXcdNigFrpZ+C 6xIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=xQZnvb6WkHY7uiUpIFUonTnxXqndHkNZi2qqU6KJSMU=; b=FRm53rPzBXdokQc96QKkTGYrF8tiG/DzpQ3hCndTktUiOhe1CTB2eStDyrtrqg+6/4 fx6gUpCNElFEfX8IksKE+muILjzmnbXZhC5a0ubTrLpz12v8eO9fYf0CndtIew6b0TEt UZEPV9z7UJou+fQUPVKm51JasGbMGwTLEzTTMiPgsXOF3bFFbtKu6RAtezF1nKudGAZd SKwjP5xT0sCUWy75iYCe6FsrgvMPjKiGBrYRNyEsFxYOoSY67URL4UDBYmqwP8L8r6wn 5SyqUfsHn9uYdCistMK8koG6hkacVWvHGYs8dWjKyj7GlLcfDg5rWZzYdLaQA6dFK0lI BbaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=g8Z2sWUj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 102si1560734plf.448.2017.07.12.01.12.29; Wed, 12 Jul 2017 01:12:29 -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; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.b=g8Z2sWUj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933830AbdGLIMU (ORCPT + 25 others); Wed, 12 Jul 2017 04:12:20 -0400 Received: from mail-wr0-f180.google.com ([209.85.128.180]:32902 "EHLO mail-wr0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757016AbdGLIFX (ORCPT ); Wed, 12 Jul 2017 04:05:23 -0400 Received: by mail-wr0-f180.google.com with SMTP id r103so22505536wrb.0 for ; Wed, 12 Jul 2017 01:05:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=xQZnvb6WkHY7uiUpIFUonTnxXqndHkNZi2qqU6KJSMU=; b=g8Z2sWUjNq17qhKuSL6/q9ijtotEc6y51g90Zjh0PVwYlN4GK/GiQE2pk2xfC+Z4k9 Rle7AWFSdSa3eIFnBmK6Iebh93HCOrxcZn6t9nsqwFdxPgxVs3jHFqiseQKwme4uWoBj 4c1Spg8e+6TG4xXzBzUAAbKXtTtVoGNCCBZd8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=xQZnvb6WkHY7uiUpIFUonTnxXqndHkNZi2qqU6KJSMU=; b=a7qDFs1uAgNF9Jw3tjKzSQUUQxn/yxs603+WYE/tHieb8P79or8yz1+oQ6CdKQPjiJ kXGmt0dvVXhV15jxqZ0MOCx3qcjdVjvNdOwlCM08amPtRhGnr11lqq+x+1hhkcBgN2QJ gvGIJSq+vB+aF5kAmxB6nWQlVwgg3f2xjjUKdajNvCV0JKr/yPr0msIx1XZJrCCl3H6D 4OJZdlLajGLDsysh4xdL5wQaIYxqPAOOdKFdGFBxtr7pw32xYRT4MRab8RyT9YGY9nA7 5KLUa2CTAoywkn2WymHJjEATEt0WquK1pwjgDMxal80qKrfSwNFURiUH6bEA3giv5JH2 3QvQ== X-Gm-Message-State: AIVw111kzjfyrMMXovzFQs5/Ccd+/lT9TyzUiDAt1G/hQJYZHJX20EJW V5CE5i1WAC8K5heX X-Received: by 10.28.184.87 with SMTP id i84mr1548763wmf.22.1499846721715; Wed, 12 Jul 2017 01:05:21 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.158.26]) by smtp.gmail.com with ESMTPSA id p34sm1430744wrc.66.2017.07.12.01.05.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 12 Jul 2017 01:05:21 -0700 (PDT) From: Benjamin Gaignard To: benjamin.gaignard@linaro.org Cc: linaro-kernel@lists.linaro.org, Alessandro Zummo , Alexandre Belloni , rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org Subject: [PATCH v2 08/22] rtc: ds1305: stop using rtc deprecated functions Date: Wed, 12 Jul 2017 10:04:28 +0200 Message-Id: <1499846682-14093-9-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1499846682-14093-1-git-send-email-benjamin.gaignard@linaro.org> References: <1499846682-14093-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. Signed-off-by: Benjamin Gaignard CC: Alessandro Zummo CC: Alexandre Belloni CC: rtc-linux@googlegroups.com CC: linux-kernel@vger.kernel.org --- drivers/rtc/rtc-ds1305.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-ds1305.c b/drivers/rtc/rtc-ds1305.c index 72b2293..b41168b 100644 --- a/drivers/rtc/rtc-ds1305.c +++ b/drivers/rtc/rtc-ds1305.c @@ -324,23 +324,20 @@ static int ds1305_set_alarm(struct device *dev, struct rtc_wkalrm *alm) { struct ds1305 *ds1305 = dev_get_drvdata(dev); struct spi_device *spi = ds1305->spi; - unsigned long now, later; + unsigned long long now, later; struct rtc_time tm; int status; u8 buf[1 + DS1305_ALM_LEN]; /* convert desired alarm to time_t */ - status = rtc_tm_to_time(&alm->time, &later); - if (status < 0) - return status; + later = rtc_tm_to_time64(&alm->time); /* Read current time as time_t */ status = ds1305_get_time(dev, &tm); if (status < 0) return status; - status = rtc_tm_to_time(&tm, &now); - if (status < 0) - return status; + + now = rtc_tm_to_time64(&tm); /* make sure alarm fires within the next 24 hours */ if (later <= now)