From patchwork Tue Jun 20 09:35:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 105967 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1276767qgd; Tue, 20 Jun 2017 02:44:08 -0700 (PDT) X-Received: by 10.98.156.1 with SMTP id f1mr29893557pfe.192.1497951848792; Tue, 20 Jun 2017 02:44:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497951848; cv=none; d=google.com; s=arc-20160816; b=eJ6jm14RP8wZ06xu0yiDYaOyyReJOz35Kuyy/PJEK2+KAdYgodhuX14+lSqw2r4K+Z ljU4m1V+3lF1FQoyC+fSxiDmnGo8JYOYnpYYv8xMwZpQXDLIbSykt5odVpBW6Wa6ME6H gzxO2Ft3hKGk8fI5lAclBixHwE2m5H/smYGOCpLliDY83rY+htq1neq+gIyrFBOe8jWz uMDP4TnxSd9vgOVIjcm/tTG7CfWDfhLTu2B1u98tRPPpkmoTYHfHl81lo+C1kDc3/XYp NXrPwFUqnCfYWdj821kv6fGWdUqBwlKar384lx4odppDgxC6Uc8UymUORXLDWm+5QmWI +3Rw== 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=ZAfw0QETp3CNSSAHq9TLLK0cNIn7kinl24LWcGIXmXo=; b=GD+4LcPfGh1RmeWZtakjWcdhbtPcKwYERL+SW6hXuxXsiEu99h2aKC7xV3lpOt57YK xxoPK1L+3VST7fBPl53+H2/uMq5V6BQgeem/57c+lfXHHxRbSd5NuflrZcgF69VtFpEN XP6VgtiG9c9eXjAe5fAp6QO11RgY3iQNkeDgTNe6p0ROabbk9XfUNgdEXlBV2/iAOKWd 2PV/559FEdHP/x0sDVJ2DJDTlMDO1WrCIBX4y1loEDRVMoeVCoxzSLuyEn7BWMk4ugYb g3UIfn2D9kCpq6BkxYbffC+GnPNgJax48hn+ViBfiu8f/n0Msil0qX5IziJPUx5jctqM ELqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=VsynSZJp; 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 f8si11201780pli.377.2017.06.20.02.44.08; Tue, 20 Jun 2017 02:44:08 -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=VsynSZJp; 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 S1752070AbdFTJn7 (ORCPT + 25 others); Tue, 20 Jun 2017 05:43:59 -0400 Received: from mail-wm0-f48.google.com ([74.125.82.48]:35616 "EHLO mail-wm0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752448AbdFTJiY (ORCPT ); Tue, 20 Jun 2017 05:38:24 -0400 Received: by mail-wm0-f48.google.com with SMTP id x70so16042807wme.0 for ; Tue, 20 Jun 2017 02:38:23 -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=ZAfw0QETp3CNSSAHq9TLLK0cNIn7kinl24LWcGIXmXo=; b=VsynSZJpyHY7h1NefHfsNR+iwALbDmUN7czCXl8F5wSk7MmuMM/wAfBAf1DUYL1W0k O9gacKijUffJqVWKgfZOR88TySzKzUVdXs/Y+I3Bfu3MS/x8udo0pghMoxN+AOPnqrPN o6cOHet7QdC/o0OA3Sw0veo45rNERvAQdN7Ng= 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=ZAfw0QETp3CNSSAHq9TLLK0cNIn7kinl24LWcGIXmXo=; b=rqQ2p4jG6/JJGpzc+4XZRtibGLTVPUZJ79IiJ2gujKEOP2PpX7kQ3XNJdzdQyvAI/t A4GvECaMrJMD7i5sAiyga/0ALFp0yodrRqWI2qzCaBiEiRvt0iZIKvgxptm/a0yKf9/a ktqqud84ulSYO/1D0WcHVLbxgHHLQzkTNw3R2qzHbsMErOZRI5mCouvEqyP53sENnb7l tKKxMnEo3gLxqTSceqWL/1gdiJa/oDrXh8wOuM79/WZ02sXouU8TXAHytkqftPZbycZX As7TZgGhpJPBzoTI6TPb1O2HZqtArJxnGVVlpBRGbxFkm3Y8GzPKyUqx+rfRGpy9mvB2 bKOQ== X-Gm-Message-State: AKS2vOwXb/SiYyHNlPWY4XSAybN8AmjhSRYOJgI9TN7EeenSqiLcgGwF qBuwYmx+Tl4C156X X-Received: by 10.28.143.16 with SMTP id r16mr2212110wmd.50.1497951502953; Tue, 20 Jun 2017 02:38:22 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.38.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:38:22 -0700 (PDT) From: Benjamin Gaignard To: benjamin.gaignard@linaro.org Cc: linaro-kernel@lists.linaro.org, Alessandro Zummo , Alexandre Belloni , Barry Song , rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 39/51] rtc: sirfsoc: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:47 +0200 Message-Id: <1497951359-13334-40-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: Barry Song CC: rtc-linux@googlegroups.com CC: linux-kernel@vger.kernel.org CC: linux-arm-kernel@lists.infradead.org --- drivers/rtc/rtc-sirfsoc.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-sirfsoc.c b/drivers/rtc/rtc-sirfsoc.c index 7367f61..972ede9 100644 --- a/drivers/rtc/rtc-sirfsoc.c +++ b/drivers/rtc/rtc-sirfsoc.c @@ -91,11 +91,11 @@ static int sirfsoc_rtc_read_alarm(struct device *dev, */ /* if alarm is in next overflow cycle */ if (rtc_count > rtc_alarm) - rtc_time_to_tm((rtcdrv->overflow_rtc + 1) - << (BITS_PER_LONG - RTC_SHIFT) - | rtc_alarm >> RTC_SHIFT, &(alrm->time)); + rtc_time64_to_tm((rtcdrv->overflow_rtc + 1) + << (BITS_PER_LONG - RTC_SHIFT) + | rtc_alarm >> RTC_SHIFT, &(alrm->time)); else - rtc_time_to_tm(rtcdrv->overflow_rtc + rtc_time64_to_tm(rtcdrv->overflow_rtc << (BITS_PER_LONG - RTC_SHIFT) | rtc_alarm >> RTC_SHIFT, &(alrm->time)); if (sirfsoc_rtc_readl(rtcdrv, RTC_STATUS) & SIRFSOC_RTC_AL0E) @@ -109,12 +109,12 @@ static int sirfsoc_rtc_read_alarm(struct device *dev, static int sirfsoc_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) { - unsigned long rtc_status_reg, rtc_alarm; + unsigned long long rtc_status_reg, rtc_alarm; struct sirfsoc_rtc_drv *rtcdrv; rtcdrv = dev_get_drvdata(dev); if (alrm->enabled) { - rtc_tm_to_time(&(alrm->time), &rtc_alarm); + rtc_alarm = rtc_tm_to_time64(&alrm->time); spin_lock_irq(&rtcdrv->lock); @@ -182,7 +182,7 @@ static int sirfsoc_rtc_read_time(struct device *dev, cpu_relax(); } while (tmp_rtc != sirfsoc_rtc_readl(rtcdrv, RTC_CN)); - rtc_time_to_tm(rtcdrv->overflow_rtc << (BITS_PER_LONG - RTC_SHIFT) | + rtc_time64_to_tm(rtcdrv->overflow_rtc << (BITS_PER_LONG - RTC_SHIFT) | tmp_rtc >> RTC_SHIFT, tm); return 0; } @@ -190,11 +190,11 @@ static int sirfsoc_rtc_read_time(struct device *dev, static int sirfsoc_rtc_set_time(struct device *dev, struct rtc_time *tm) { - unsigned long rtc_time; + unsigned long long rtc_time; struct sirfsoc_rtc_drv *rtcdrv; rtcdrv = dev_get_drvdata(dev); - rtc_tm_to_time(tm, &rtc_time); + rtc_time = rtc_tm_to_time64(tm); rtcdrv->overflow_rtc = rtc_time >> (BITS_PER_LONG - RTC_SHIFT);