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: 9799073 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B8E5A60329 for ; Tue, 20 Jun 2017 09:39:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AA73F26B41 for ; Tue, 20 Jun 2017 09:39:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9E080283A6; Tue, 20 Jun 2017 09:39:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 19C5726B41 for ; Tue, 20 Jun 2017 09:39:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=ixBcFf49Tv0YOJ+W4xTgkhzIz7nZHPgpuLN4ilYlgtw=; b=WJEs4JS64uV7GYMit9py4f8Htr PLn9QfzkgfEvXhJEcJumC8yScJbJCsaZ3QffozdErIu/FMnoEw8k65rcqlz/HoDJrx+UvYk2c5Xpj bwz+WFBFXSkIPDz3rQ5+vuCRjk9JCwq41oNYePoU/ak4C1GrwoL2ZTAinqOTU9WZOEUf8u1WIdSsL 8a8VLLw4v9CKnxn5DvU96WqlIkq+yJlnRrgZwWpRk3yUfDNU7SJb7nQTh2E4BY1pyHRjoOSDjY+Fr mgIEX3YUVu2FTDl/6lV3bK0T5QT7PFXR2LLTnzOOGIXKhgL/yd81pOX1gOA5Yb0XJ7vmZd/0u5gPa 1Q5n4E0Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dNFcs-0005U6-Rj; Tue, 20 Jun 2017 09:39:10 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dNFcV-0004tw-TS for linux-arm-kernel@bombadil.infradead.org; Tue, 20 Jun 2017 09:38:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=ZAfw0QETp3CNSSAHq9TLLK0cNIn7kinl24LWcGIXmXo=; b=I5R/a/f8xcKMCQGD0qwngAZOb t8m4Z/PAAzpSDjoRnS5p+5Ceie7Reo8lhUqyYHnQAYIO/sI5Gu2apWsWfK23zRUGNvogecEM5aIjr lPThjVgoeW0ui1KfuUhNzygDPDcwgWFTf2+6uXii0lsMMqNpoZ9kQhymqj1F+YzsSoC/+vAGrWUUN aSqPvSF1HMKahSq3z7hj/uOpkYbgg4kGiOxmu+bBfcYCihzlWm3v5/p/150E1X+/qlUddLuRAPt5f cnbo7YR6x4ZWXxBXdjRFeDeq3mKr03ON5q2RsPfCeVabuKdRLTUiKXHxJvwHTV/jBf5dFf/D5URvW 5mhzWEc5Q==; Received: from mail-wm0-x230.google.com ([2a00:1450:400c:c09::230]) by casper.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dNFcS-00076N-Hv for linux-arm-kernel@lists.infradead.org; Tue, 20 Jun 2017 09:38:46 +0000 Received: by mail-wm0-x230.google.com with SMTP id u195so14583312wmd.1 for ; Tue, 20 Jun 2017 02:38:24 -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=Xie/Me8qNVEN1f9qGPiLIq/BiQeMBVux2/or9cyC0rxnFhDrWpaNC1FA4Q6Ly/atKF JY663f6yWDsLcQQ8C7dtoVJrvpwCYHM2jeYdp36r7olHptcGM9V/xMH3/SxyV9IkiNNJ ps7aHbt8YUlvzQVEQXpZt67yTQZj/R0OfXPYakpBslQqaMNCbB/cZXBQGWiXvF0TpqTS 7JEEPWDEp1baNx0iORiVR726hrVZ6O5ZgsiRUCKmLYiM1NZhpYBTnMbq1OWcniKHy66Y SNkjXjI5fb4gbCWDv9cWiCB+cQdYXEn81IM3/1LjIUbR+3JrzYw4JD4mOPLIjyo+eqYu 4T9g== X-Gm-Message-State: AKS2vOzsj9+UKoU07zfXPvc5ggTLy9k9OUQLEPH0s+VZLysgcdUkWhAP MloQlKIxfItzJEhK 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170620_103844_695564_D5581C4A X-CRM114-Status: GOOD ( 12.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alessandro Zummo , Barry Song , linaro-kernel@lists.linaro.org, rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org, Alexandre Belloni , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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);