From patchwork Wed Jul 12 08:04:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 107451 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp601219obm; Wed, 12 Jul 2017 01:05:44 -0700 (PDT) X-Received: by 10.99.145.67 with SMTP id l64mr2643863pge.184.1499846744819; Wed, 12 Jul 2017 01:05:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499846744; cv=none; d=google.com; s=arc-20160816; b=QdQIIvJUtcSR0XH7A3Dr4m+K/u4q2FEDs20dPxvZUbvQLvM+F+kVjPyajByTwQKtyG HHZj+6HyeqEuu/9QG5s/NwrpwmyLd7GRYxLmBHiOc8lbsF+hAc1Lvs0Oksoub+LaopLf iXR4tNnEw0XBl7KbzIw81H20zB4zcbUqdri7dQv+ZczCT1/ke2Nx/RlOghnU2hMLb2Fd DnZUKJTsIgrgCxdzs/Qzbho6vci9bYVr3YgsYa2/+COZehTLrmYRGqu2KteNRG4weDWG 7sSIWmTuU74wI54XOfnJqdNzgBvPSXW463iR6uJpLq6dR93l9iwgcyDY1oW17X8U7IeM nCuQ== 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=tBnQbIBVbnyEw7aeJ3LeZF8woaglUVfix17xszPmJ6JppCVZmL8vLhwiLTIIhYUSdB 1Euzm+3quMdIRs8rhJDCjJA8DHH7rQeUympgXZrxSbEqBAANciwD+1d8+MNpXEpx8rN/ jmzx6+5G+tBR7YeVZ6bNvy4JNr/734iXLGKFqLI1gQJvJPEPVoO9OVfwTyT2rEG71Ht2 YzE5LKU2D1LXCkdSyQZPwISJ8UtNdkRm4ON6N76jPJ/UVfpAvdF0f0QNtBpERGaduzwl socb+PUjC+K1hPgB3436EwJq3s21KpnMuPnRGYjo6oHC9WPDWhealxF2859W4RyRZPSx N2WQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=FdE+C2pq; 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 y15si1430087pli.569.2017.07.12.01.05.44; Wed, 12 Jul 2017 01:05:44 -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=FdE+C2pq; 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 S1757031AbdGLIF0 (ORCPT + 25 others); Wed, 12 Jul 2017 04:05:26 -0400 Received: from mail-wr0-f180.google.com ([209.85.128.180]:35766 "EHLO mail-wr0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756892AbdGLIFV (ORCPT ); Wed, 12 Jul 2017 04:05:21 -0400 Received: by mail-wr0-f180.google.com with SMTP id k67so22364535wrc.2 for ; Wed, 12 Jul 2017 01:05:20 -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=FdE+C2pqJcjndO6ZuKxXc12zvoeybJFUZWpOoc/wEtPJ9W4ZDA9ZpnHcu24IA7h3Ns jxQgAgZWXGTxOad15R65IYaNyFK/9A05nTIF+Ypo1KAn/ijFYZAAwaglQjuQX0a87oqN OCCeyZ8UhrcfXUL5LI/gnfRUd4gLgh+T+S3f4= 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=FMcpjnYe+ZYIincZjgPxPKVrhWdumeKZyt2UvHCvn0HIcGwQphW0VY8oGCDWRm3ZjL 4qo4rWhTwCzuUOrmKpMAoybCMKcQu5fN419NXrt3M7xZsd8Ig/TUeTwChedSOTVADER8 lv/v0+OaYeYSFK3sePufbzKSDN0UMz+vDlBbXANdXM+vbVsPL3bf61tmxaYvlbl4xEkL NalpIzAGxG7OU2098kfUCAs0ZvKOaRGVxK+d/sQQEl5mjpLRlMX8IVuNg+oRry4wCiDY SZtQVgYH+CPudzLzrcezSQGCT42IQFKv9fYacrnVn2GpaBzVUsdMgTCmSHBS1s+02n9j qIAA== X-Gm-Message-State: AIVw113YURFnhajC5MtGkwihHQc3nG3wixmltMbHC6OPPPaFtns7V1ct ZgB2P5Y5FA9L5y0g X-Received: by 10.223.132.7 with SMTP id 7mr2184476wrf.187.1499846719914; Wed, 12 Jul 2017 01:05:19 -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.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 12 Jul 2017 01:05:19 -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 07/22] rtc: davinci: stop using rtc deprecated functions Date: Wed, 12 Jul 2017 10:04:27 +0200 Message-Id: <1499846682-14093-8-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-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;