From patchwork Tue Jun 20 09:35:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 105985 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1280248qgd; Tue, 20 Jun 2017 02:55:15 -0700 (PDT) X-Received: by 10.84.132.65 with SMTP id 59mr34381039ple.21.1497952515777; Tue, 20 Jun 2017 02:55:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497952515; cv=none; d=google.com; s=arc-20160816; b=XyxCVsp37xcBXY0Z54UDPpc1SK2q960nXGxJrHz7ZHnkPR/OpnqRzP2wP0A4p9P8MA rvBV0pFvHQK9W1/BWUVER0PppgrcgN7Mwc+f/pI8vCA34syEckzFGSISVNAXYuvP6EUm ztnjvJiIxy9rGgXnXfDY4DgIN+PLgIaaRpHtf5B1K8v/ClgqtS2sw7y5J1NhHzuGg3Pg fMTDDW4qpbM98s9znrUlYqWRcnotLhMoL/2BjMGHo+gcOYURqqQamY1Fbylq1IEscJ8b 8gJtnyupYvvmIcxv+LmOeY7judOSTM3uKEeF+sNcT2bAedhszlaIpJ3u6dp5NwSQqH+6 zVbA== 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=bn8NCtMSsa4AlKiUPT9/9okjnlHEoQxc4622FjHf0xM=; b=cgRDLawsFVJmKzgm0587x3QLAVmQg3RwaNcw862xVNDIepLt3lg3u/ZEbCyP8D/s/r VlGZr9y9pWmfLDrDjnyf5xDMwzLY2uQiFtjCwoBii9l2j62xDEXZj4Bsa/3FXnBeDeiC 8/pein3EwZp6Xdn/El+DkR8r0YKdeHDXa9+3vazefVy1cK/Fkvc5S11qJKC3x5RwU60p TLjwRlZ9G3huj6wO89wLa4NyLXSuqzaKE83+4Xu2B0KLiWCegClZDoRqcaDlkN8DJhNZ edAiTTS8V6yShq6b1KF5C+teb31xMAcY3yf9bdjRBnrLBw7eI0Ii+GzIzPZ7+1wfLVk/ p8LQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=ThMhN1Zj; 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 u14si8325720pgb.287.2017.06.20.02.55.15; Tue, 20 Jun 2017 02:55:15 -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=ThMhN1Zj; 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 S1752049AbdFTJzN (ORCPT + 25 others); Tue, 20 Jun 2017 05:55:13 -0400 Received: from mail-wm0-f44.google.com ([74.125.82.44]:38440 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752676AbdFTJh1 (ORCPT ); Tue, 20 Jun 2017 05:37:27 -0400 Received: by mail-wm0-f44.google.com with SMTP id u195so14559858wmd.1 for ; Tue, 20 Jun 2017 02:37:27 -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=bn8NCtMSsa4AlKiUPT9/9okjnlHEoQxc4622FjHf0xM=; b=ThMhN1ZjHyrjA//nEflsR0Fjxe9E4qrwrMQZNIArsumhw2iSBWv6kQtH+sOMIhk+ve 0JTQTtho2+vXud1v6gOZS4/cNrPBek0c1WKv6UBvw2K1uWCJdX7fxv8X6TRHjaws5Xtx qsCoEDW2IyoVCHL/xzq3cJISVDM+tIj4lquX4= 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=bn8NCtMSsa4AlKiUPT9/9okjnlHEoQxc4622FjHf0xM=; b=sQtMJjQyOAS9VH1HG0UGQN0CSxFblo2kuyoQ+H28r9uXiT/7q+nFF847p0FseiSnEt f0pTRq0HZARQkRgocqErIKmCRXInM9zWF/GRub9wjSxLabfSQ3JWPwTLMJT/O+OLgXD6 yOzwAjUHICzFij7ww90+AerbqFQILYQp1poQ3kKeBIaf/I+UmiwjmlHAF/Z9dchdlkZ7 s929P6T7SyrczticC6qDW8R3u1R1QtLaY3lUJQ7aZ3/EjwKr+MqY9DvFSyllvCqR9hzB FszEn9iedRuOrgDutTmzANzp7Deg83ei/gxg7tdcsFWb1t//YUpxnk7VFENQCczR9N4o InvQ== X-Gm-Message-State: AKS2vOzkKbx/zJsZpOVwdd0dWH/3nfk2L7QV6ybOhHJDvW43dBDhzDTn qEu30ebxGqIyA1rMtchx5A== X-Received: by 10.28.134.3 with SMTP id i3mr2015132wmd.1.1497951446582; Tue, 20 Jun 2017 02:37:26 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.37.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:37:26 -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 16/51] rtc: davinci: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:24 +0200 Message-Id: <1497951359-13334-17-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-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-davinci.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-davinci.c b/drivers/rtc/rtc-davinci.c index caf3556..03beba3 100644 --- a/drivers/rtc/rtc-davinci.c +++ b/drivers/rtc/rtc-davinci.c @@ -429,18 +429,18 @@ static int davinci_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm) if (alm->time.tm_mday <= 0 && alm->time.tm_mon < 0 && alm->time.tm_year < 0) { struct rtc_time tm; - unsigned long now, then; + unsigned long long now, then; davinci_rtc_read_time(dev, &tm); - rtc_tm_to_time(&tm, &now); + now = rtc_tm_to_time64(&tm); alm->time.tm_mday = tm.tm_mday; alm->time.tm_mon = tm.tm_mon; alm->time.tm_year = tm.tm_year; - rtc_tm_to_time(&alm->time, &then); + then = rtc_tm_to_time64(&alm->time); if (then < now) { - rtc_time_to_tm(now + 24 * 60 * 60, &tm); + rtc_time64_to_tm(now + 24 * 60 * 60, &tm); alm->time.tm_mday = tm.tm_mday; alm->time.tm_mon = tm.tm_mon; alm->time.tm_year = tm.tm_year;