From patchwork Wed Jul 12 08:04:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 9836089 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 8C8C5602BD for ; Wed, 12 Jul 2017 08:06:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8149F28437 for ; Wed, 12 Jul 2017 08:06:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 753AB28602; Wed, 12 Jul 2017 08:06:15 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 87BC2285FB for ; Wed, 12 Jul 2017 08:06:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756940AbdGLIGB (ORCPT ); Wed, 12 Jul 2017 04:06:01 -0400 Received: from mail-wr0-f182.google.com ([209.85.128.182]:34604 "EHLO mail-wr0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757081AbdGLIF6 (ORCPT ); Wed, 12 Jul 2017 04:05:58 -0400 Received: by mail-wr0-f182.google.com with SMTP id 77so22558624wrb.1 for ; Wed, 12 Jul 2017 01:05:52 -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=Ag/XSxvhcECxadOjjWRH1pG6I2aUy8KaYQ6uprANa68=; b=jG7vPZpkdldztR36gQWOR4LiPDeYvdHUGWJZ2tb4+aAnNDfAW3XOPluLruEPJl4Rf5 XKlMOhvdoa7JaNAI8bOjom4liaZJgDJtJn9u5bWn/7uEOBc/BI+LUUGE/VRRhYt9i03r CVflLjETqcyWCklJF3X0pw+aipu4oAysUNcz4= 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=Ag/XSxvhcECxadOjjWRH1pG6I2aUy8KaYQ6uprANa68=; b=FxrmcwbmA50HCetfJqCl7Ps/4Bb7adv0ctUvvhZOHsfo5ZHen3Iyw5qmst7udtFcsN 3r4eBng5yVnCG7NEKBuncskeksfj2VOo7K1HrbsXCC/i4E31RMgQnCifU2kfbTTNHS7b hZSbFpOmG0HytqKIW0d8qQeGMFJqH69Jjj8Ski58yYQm4v3nuoQrDDXI1GmvpRuNFKj3 f87gjagrUY3ocE2xFGQmH/R5NqdXi9WyoWfpVrApZhAdLIk4JjSKgHdCMNP2HJLg/Fue pv8QAjQhlpH+MyaPXBeIWji1et7p7KOcIQC28EMg8viuVoq7ShC02BfXD3xrd8xOvu7a x6aA== X-Gm-Message-State: AIVw110FbweP8CMZKvC4/E7O0FQ1/o4zCcBWucGLhhHzHgaR5BX2SdQE qKhvVhWRUnYCLmei X-Received: by 10.28.126.87 with SMTP id z84mr1542565wmc.65.1499846746764; Wed, 12 Jul 2017 01:05:46 -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.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 12 Jul 2017 01:05:46 -0700 (PDT) From: Benjamin Gaignard To: benjamin.gaignard@linaro.org Cc: linaro-kernel@lists.linaro.org, "Rafael J. Wysocki" , Pavel Machek , Len Brown , Alessandro Zummo , Alexandre Belloni , rtc-linux@googlegroups.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 22/22] power: suspend test: stop using rtc deprecated functions Date: Wed, 12 Jul 2017 10:04:42 +0200 Message-Id: <1499846682-14093-23-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-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.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 Acked-by: Pavel Machek CC: "Rafael J. Wysocki" CC: Pavel Machek CC: Len Brown CC: Alessandro Zummo CC: Alexandre Belloni CC: rtc-linux@googlegroups.com CC: linux-pm@vger.kernel.org CC: linux-kernel@vger.kernel.org --- kernel/power/suspend_test.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/power/suspend_test.c b/kernel/power/suspend_test.c index 5db2170..334a893 100644 --- a/kernel/power/suspend_test.c +++ b/kernel/power/suspend_test.c @@ -71,7 +71,7 @@ static void __init test_wakealarm(struct rtc_device *rtc, suspend_state_t state) static char info_test[] __initdata = KERN_INFO "PM: test RTC wakeup from '%s' suspend\n"; - unsigned long now; + unsigned long long now; struct rtc_wkalrm alm; int status; @@ -82,10 +82,10 @@ static void __init test_wakealarm(struct rtc_device *rtc, suspend_state_t state) printk(err_readtime, dev_name(&rtc->dev), status); return; } - rtc_tm_to_time(&alm.time, &now); + now = rtc_tm_to_time64(&alm.time); memset(&alm, 0, sizeof alm); - rtc_time_to_tm(now + TEST_SUSPEND_SECONDS, &alm.time); + rtc_time64_to_tm(now + TEST_SUSPEND_SECONDS, &alm.time); alm.enabled = true; status = rtc_set_alarm(rtc, &alm);