From patchwork Wed Jul 12 08:04:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 107449 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp600935obm; Wed, 12 Jul 2017 01:05:25 -0700 (PDT) X-Received: by 10.99.186.83 with SMTP id l19mr2543362pgu.44.1499846725306; Wed, 12 Jul 2017 01:05:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499846725; cv=none; d=google.com; s=arc-20160816; b=rko4M+P8eCv4YzUrDE1p2ozLYQHki6ckyybyk7kkMo1DZpWILbIB7epQojAhQI5m0T R1yOy83/LAgUwzpbIUvgm9WVUnhMfCN3pLg5R0sFowwt3xOLRz2wAiQF/xe9BAAXEFCF IfodY6Q2U45n4X3Pg94VRqbu3WVelyoYNtFUoZJiV6UQVdPFYD5HNosKYY7Uq4Iq+1eR r4jiKARLXdXkK738tYx2FXKzfoc3AuARPhOjYPrLg/Zz96a5Eoqq5bILzJNhUZDJ4Jra bOe5LoFedhRhz8z54mT7cb6XXCBW2MLXcQvwkfGi4olKFXjUpzIb6+m6vwVlnMdBsn5V BXUA== 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=U/MzYqHesZ1TkC0bX8Tb71+LAVdTDZ2lH5taY7EtT3s=; b=YQxiolFmeBkS4jkscP7ZMovL1R5vMzfE2mkgF+nqoclO7P3L49oZPRf+A0DHZMZHuW e1GrPL9DuGSnRGPlFr7Z2od6/QLUFIhXUlMwdmA1UNJj8ri3cfnqlzYQPQ3eqq2XbU1O ONxt0WeSk++lRJhjGAMeuerjkl0pUP90FMsHhOmYhWr2V2Gz7cermk2b6+LUHZIfgyy0 FHeJZ4N4bS2igeeMNgnPG1o/Nc4RsdwGEfvx+HjWQ0cWw00/v58l/FICJRwTFlvofgLr mCmAIKcJdO3YoymsPjx7BZV0CbNB1gfdJhztP0uag9bVjmVrh42pQB6zGZOXkV9G0rjJ Dw6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=PhSy+kr3; 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 l29si1456364pli.30.2017.07.12.01.05.24; Wed, 12 Jul 2017 01:05:25 -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=PhSy+kr3; 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 S1756994AbdGLIFQ (ORCPT + 25 others); Wed, 12 Jul 2017 04:05:16 -0400 Received: from mail-wr0-f175.google.com ([209.85.128.175]:34072 "EHLO mail-wr0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756889AbdGLIFK (ORCPT ); Wed, 12 Jul 2017 04:05:10 -0400 Received: by mail-wr0-f175.google.com with SMTP id 77so22535057wrb.1 for ; Wed, 12 Jul 2017 01:05:10 -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=U/MzYqHesZ1TkC0bX8Tb71+LAVdTDZ2lH5taY7EtT3s=; b=PhSy+kr3c7Kk2odeVrCoBkZogCcdBmCkz1donw2I6L9SmF3yjR5/KcwXkyAxU0PHMA dtsFELb9Cnydd5/RiOdQahfkzPN0vGtQiHHdGCRitbiYqcbLkT2yckN6KVycH8jS+17y H7OTb3WCvAREZA3wx/Q4zvimvD+mRGYO+jh1o= 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=U/MzYqHesZ1TkC0bX8Tb71+LAVdTDZ2lH5taY7EtT3s=; b=cYzgi0a6Cy9wxt+6OqVjyi4ESPp1DZnzCE3/87gpumMf7a/z7tl40db6pUP774WmVK Jd+G/gn/VFAgbFHIClWod8MuSF/nu2+81JkvLzgM5zj2SWUcWsoD+j+pDbY9FPitKkMP AN4Vsi+EGw6Yti9cldbl0hMgsDIurTNu4htqmwZ9131YDtag+UTMj+iByAwKe5rPhvTF QFa5axPFzzvXvWfTHIIk7bjQEOIRi3fvKEd/h7LdWjoqf0P1ZcCJONdAwfwHVjJ2Xc/l JwtJ90AWM+ST7MRJzMptNHEFxn4gNKVlE5B38MEmV+/uslkRtfqCz46MtVJk/ftp23NX fUuA== X-Gm-Message-State: AIVw113yOfjewZcxgStJgCPn7w6GTG/MXfUyK2qVJeWJoOC4nz3Zf3u9 MFeR60wdrZKWjPT2 X-Received: by 10.28.222.214 with SMTP id v205mr1564575wmg.68.1499846709395; Wed, 12 Jul 2017 01:05:09 -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.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 12 Jul 2017 01:05:08 -0700 (PDT) From: Benjamin Gaignard To: benjamin.gaignard@linaro.org Cc: linaro-kernel@lists.linaro.org, Thomas Gleixner , Ingo Molnar , x86@kernel.org, John Stultz , linux-kernel@vger.kernel.org Subject: [PATCH v2 01/22] x86: rtc: stop using rtc deprecated functions Date: Wed, 12 Jul 2017 10:04:21 +0200 Message-Id: <1499846682-14093-2-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: Thomas Gleixner CC: Ingo Molnar CC: x86@kernel.org CC: John Stultz CC: linux-kernel@vger.kernel.org --- arch/x86/kernel/rtc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 1.9.1 diff --git a/arch/x86/kernel/rtc.c b/arch/x86/kernel/rtc.c index 5b21cb7..76b817c 100644 --- a/arch/x86/kernel/rtc.c +++ b/arch/x86/kernel/rtc.c @@ -40,11 +40,11 @@ */ int mach_set_rtc_mmss(const struct timespec *now) { - unsigned long nowtime = now->tv_sec; + unsigned long long nowtime = now->tv_sec; struct rtc_time tm; int retval = 0; - rtc_time_to_tm(nowtime, &tm); + rtc_time64_to_tm(nowtime, &tm); if (!rtc_valid_tm(&tm)) { retval = mc146818_set_time(&tm); if (retval) @@ -52,7 +52,7 @@ int mach_set_rtc_mmss(const struct timespec *now) __func__, retval); } else { printk(KERN_ERR - "%s: Invalid RTC value: write of %lx to RTC failed\n", + "%s: Invalid RTC value: write of %llx to RTC failed\n", __func__, nowtime); retval = -EINVAL; } From patchwork Wed Jul 12 08:04:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 107450 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp600941obm; Wed, 12 Jul 2017 01:05:25 -0700 (PDT) X-Received: by 10.98.62.70 with SMTP id l67mr54813437pfa.114.1499846725768; Wed, 12 Jul 2017 01:05:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499846725; cv=none; d=google.com; s=arc-20160816; b=VLSH5P0lgakBy1nCEh2acNdBRkEuc3RtGn5d4KHxdPEXeIrZKgswNhkQARkq34q98O lCWCiMRDpfbZZSYTH+FG6GEotC7FTt6RxlJqumT97/HZEjqrVgP0T/Scrb8mabwpDBuC hpk3fo9Jw1mQ0g/lEXMkbCp+B1ACbI0PqOvnl9WIODXNyjwnEB+LadQjxiNTkAGfCimZ 8lNpqt+/kUHZC6XfKNnC5hnz9V8mp1adt/cN6EJ/V79rkAEecPiq54Cubo/DBIkqUn4a nmFG6ZSu/lKn5AkIk7+rBDy+Qmry7rFJI6QQcKNhq7cgLuwrtqfuYGzlINTDP/UT/8EW dvXA== 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=lPsqTQKEpp8GZCa83QDdJK1PRkg9ZIKpF6paM4D3Nlk=; b=CbTyk/RnFMP72bIifAZdQaFK/SRMQdSEi0PLAqGcl0EYIxzq+JUb2UpnP0/FsdSimR YMpxSieiYHrPKyuD3ZRGpv1GNio07RQHKlYTfgihUvHEiqmPWyBNXyBaHdmS1kyOcN6A owOo7pGaARk10zavHNTMCiB7BmhD0avCgDuIbit/+wFNmadY22M0oshaawo6b35Qmfkh cP+iNwTq1T7pBSNePSR9OhBI1ZHBj9GomMD+cm6hHR0LCaRYVGyy5hzScO35b27STEa2 RE7MblOxNXcCc4MjwpDaE0CIgbWMeC8POxriM24/WO60rvtuWyLKjCTbzFRbU9GUTS06 ZRnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=cW+ihAEP; 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 l29si1456364pli.30.2017.07.12.01.05.25; Wed, 12 Jul 2017 01:05:25 -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=cW+ihAEP; 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 S1757013AbdGLIFU (ORCPT + 25 others); Wed, 12 Jul 2017 04:05:20 -0400 Received: from mail-wr0-f170.google.com ([209.85.128.170]:35646 "EHLO mail-wr0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756892AbdGLIFM (ORCPT ); Wed, 12 Jul 2017 04:05:12 -0400 Received: by mail-wr0-f170.google.com with SMTP id k67so22359215wrc.2 for ; Wed, 12 Jul 2017 01:05:12 -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=lPsqTQKEpp8GZCa83QDdJK1PRkg9ZIKpF6paM4D3Nlk=; b=cW+ihAEPitJ1gmn1ynwjqQuZneioQmOTSzILL/B2OTUXpSbBowUX3IVqPU9zoOl3dt iErsmPS+4lFtnKd1XmTBqI/gT6C13vK65/HxdoZrx1Lk2hG74QeVdpl39uUfIC4nhrtq tTAn8s/T/iPOOCnhfW/HyYjPxAxgBZVyQbnAY= 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=lPsqTQKEpp8GZCa83QDdJK1PRkg9ZIKpF6paM4D3Nlk=; b=ahzr8vlzGkP0nS19AzOJsCCbnLcPivOdbX9JIDfFdi8vhXWEB9Fb4Njj/HjdRPiUOz TE5CJvcvAbldV+T8v3qI1Txb4xF2KHQAyxguZA1/O2CtMRdbRZTCQLt3QavWh1GqmO7A hKW8vqnMw7pkQxrCf01ZJKJkm01noibs6UUkS0ZP4ouxCLSkZP/ddGaPsFmQj8EyzSZt o9qjN9rxVqVXSQ1bRv+CqkUZD/9AM6RLrbS0TAvF1A4CALUyfiqEENP3clpY78Sikep0 x/ZqUUh4ODtMpGSVflNFcY7iETOXVDq0IoHHe3KbILyeLbPPPUNO3oZjoDOCydWIemUW QE6g== X-Gm-Message-State: AIVw112lAChAkjiKDxDaGjjwA2jhHnQO3lp5//16jgdrFUghdFm5IzzC m3hMj5s+KchwjLhU X-Received: by 10.28.8.144 with SMTP id 138mr1566615wmi.8.1499846711150; Wed, 12 Jul 2017 01:05:11 -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.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 12 Jul 2017 01:05:10 -0700 (PDT) From: Benjamin Gaignard To: benjamin.gaignard@linaro.org Cc: linaro-kernel@lists.linaro.org, Thomas Gleixner , Ingo Molnar , x86@kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 02/22] x86: intel-mid: vrtc: stop using rtc deprecated functions Date: Wed, 12 Jul 2017 10:04:22 +0200 Message-Id: <1499846682-14093-3-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: Thomas Gleixner CC: Ingo Molnar CC: x86@kernel.org CC: linux-kernel@vger.kernel.org --- arch/x86/platform/intel-mid/intel_mid_vrtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 1.9.1 diff --git a/arch/x86/platform/intel-mid/intel_mid_vrtc.c b/arch/x86/platform/intel-mid/intel_mid_vrtc.c index 5802486..a177081 100644 --- a/arch/x86/platform/intel-mid/intel_mid_vrtc.c +++ b/arch/x86/platform/intel-mid/intel_mid_vrtc.c @@ -94,7 +94,7 @@ int vrtc_set_mmss(const struct timespec *now) int year; int retval = 0; - rtc_time_to_tm(now->tv_sec, &tm); + rtc_time64_to_tm(now->tv_sec, &tm); if (!rtc_valid_tm(&tm) && tm.tm_year >= 72) { /* * tm.year is the number of years since 1900, and the From patchwork Wed Jul 12 08:04:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 107470 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp608186obm; Wed, 12 Jul 2017 01:14:16 -0700 (PDT) X-Received: by 10.84.131.163 with SMTP id d32mr2810074pld.16.1499847256805; Wed, 12 Jul 2017 01:14:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499847256; cv=none; d=google.com; s=arc-20160816; b=wsPEQu4eLFzhnfVbqpvNX8VcbLiUKj4Nv+0GkejH95y1BiKAzgis1ECCfLBK4cl3Md 1rU3XLjyMXyf/CM+koPDfKKmB/Sl2vEjVKo953FTmjraRG4hDkFBLY8vbwTDJaXDLuGb dgt2nhYoowHX7E1EysBz3xEB0aSp4szIXRr5oRcDsej4vrBxj4rVuQhAMYRIBa/nFd8D iVe9MpK8zwhg3LPj/Hl9vPKp2CnodJCEHG9ce0m5uWCBdYQFhT1cm2/6bBH/fWlRFKQ+ Jo46HxwfjkZ1mSpSBv+XhDI2FR9WnlXjqjxRK9I+60hSZ5SPMGT8eep9FY7YGGZwnanG 6vdQ== 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=Y4alZgmbP1FU4zXeViMBkJuR+Kxas4DFeRz9P8c+pXs=; b=pQDpMQXsp+5vkFEbSSjDCyDNiynEg99s+z+yIkPD9ND09e/hBV7zkXWB+kXgdqr+CM Xb2548hAiiyCaqXZiaJKZ+g5vkpe4sd8bko3tKsH9u9c6GZlY3oKfWMf7hm3cPCaDNeK hPtkZj3wYoWU7EEuELW7Rw5bySYhUFfQyTC6n95f9RS+KUM1DfJj+ZuIpyNYOapJB8Pg 5Np4dFt2IrI6y+5BamF93G8Sb2FVewkCirewc0TUrPack7V1vBB9bsaFhtPgWg+Hicyy dekRGsVVJePkXI/+PE6BZjpkL86rqQM9hNx2yAdKB1MtiMPWxO8HgGRUxj1Q//SjUmnn uJZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=keNCbJYN; 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 b5si1487832plk.410.2017.07.12.01.14.16; Wed, 12 Jul 2017 01:14:16 -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=keNCbJYN; 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 S933887AbdGLIOH (ORCPT + 25 others); Wed, 12 Jul 2017 04:14:07 -0400 Received: from mail-wr0-f179.google.com ([209.85.128.179]:35666 "EHLO mail-wr0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756904AbdGLIFO (ORCPT ); Wed, 12 Jul 2017 04:05:14 -0400 Received: by mail-wr0-f179.google.com with SMTP id k67so22360122wrc.2 for ; Wed, 12 Jul 2017 01:05:13 -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=Y4alZgmbP1FU4zXeViMBkJuR+Kxas4DFeRz9P8c+pXs=; b=keNCbJYND2yo9Yts8GtDAGu3vO6gAvffkAIgXR+Id/tjUB8CfXZsJZoQiMnhW05skm pphXc4ATvWJnB/mmfF4yvH9Qwlm/KErBdukUQiN+5WazTXYkP3ymSORBH8w6fnmpFFch Wdh22N3Ccq8HGyMjjycK8f752y6wq4u7GM+8o= 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=Y4alZgmbP1FU4zXeViMBkJuR+Kxas4DFeRz9P8c+pXs=; b=lrYwP01NttsQ8/Pxkpah6wJVnZyqH3MtGPcC3k0VK7aqIH3sSlrUT3U7b/83aFN6LR 0OIefS4fM86uWvS7UGuAO4BvUiK2kvLzmT89N6HxMLwtpIJXsFEYfbV5jPpDp/i/SstL gEsxROtAhlE6SqWbAUYiUyh0d0tpm64t7WjrWd8iNOunMv7hNE4hFDlb9YuHVZ/D3Pd+ SpATX1a68pzQY8UjOY10vXjJcDsdCkQCubM5IeHSyKGu3GKKfazWVKBI+nqUboAYd/ST ssutUzTrByIGbFt+eRKCMCLzK7W+nxT0b0W72Ps9V9gMRln9KwcyHjJZXY4unUVSFOFE +Nkw== X-Gm-Message-State: AIVw111McC7ukS08P0xgfSyCCL04CuxsBKHZ7FV9qrGGEvo77JGFLnYA p/beYD2XxXOZv02g X-Received: by 10.28.199.200 with SMTP id x191mr1528934wmf.94.1499846712641; Wed, 12 Jul 2017 01:05:12 -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.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 12 Jul 2017 01:05:12 -0700 (PDT) From: Benjamin Gaignard To: benjamin.gaignard@linaro.org Cc: linaro-kernel@lists.linaro.org, Michael Chan , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 03/22] net: broadcom: stop using rtc deprecated functions Date: Wed, 12 Jul 2017 10:04:23 +0200 Message-Id: <1499846682-14093-4-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: Michael Chan CC: netdev@vger.kernel.org CC: linux-kernel@vger.kernel.org --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 1.9.1 Acked-by: Michael Chan diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index b56c54d..9fef202 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -4703,7 +4703,7 @@ int bnxt_hwrm_fw_set_time(struct bnxt *bp) return -EOPNOTSUPP; do_gettimeofday(&tv); - rtc_time_to_tm(tv.tv_sec, &tm); + rtc_time64_to_tm(tv.tv_sec, &tm); bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_FW_SET_TIME, -1, -1); req.year = cpu_to_le16(1900 + tm.tm_year); req.month = 1 + tm.tm_mon; From patchwork Wed Jul 12 08:04: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: 107469 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp608096obm; Wed, 12 Jul 2017 01:14:09 -0700 (PDT) X-Received: by 10.84.217.29 with SMTP id o29mr2801485pli.117.1499847248922; Wed, 12 Jul 2017 01:14:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499847248; cv=none; d=google.com; s=arc-20160816; b=HssITv4ua6n3qJUDtQKeTO+mMQTKx1vns3qqGsTF4Ox3ajRSYprSr5vkk/2ig19cYK t/oC3PkLnYjh6LnRpULlurkXHOyZK1YbhztYd7VmJFErDrr9xzjv5S0gkf8zVrjx8Gc4 VrlMJn/EkpPM/IZOC2yDUMDNLJRW1sErfjG8a9FeCuulC0ewxkVFBQL+A1S1pITu8T01 cbJT3kyCIQByEpqZgkMGcyubGtncKIXYSfp4Mm0szUyF8gv3IT2O1osXS27rRLjz59Xm UFwKqeSHQt3N7zOrC7yNv0PtstmsMc0A97mBAUeUN7PV6g4ZppFJRGN3/0IFMdDZgvnS 1BRg== 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=knrXV4XWozqmvDOGcatTWVg+/U3qFeoVrOrvDZ6fKdc=; b=S1WL4RbTmtqB1qq2uqNCWE5fvEvvLf8muGm4PmLe+uV4YSsvxtqof/FJUPq5GQVImV P+6N5vAE6ecMdG6z23sT4WZLIOp1Ai4vKG+wNOsXzAwnxCm1BnPNmnJ9o/AFbeJC9NpC VVH3okEnZAc/JyU+6WB/QpyqEG8W+A2fNIXPrI5Q/QdV+OTwk0KbGfd0ukQXUndo4XLv X5yhq4be5CGNLk4G+OevszWbQ/w1lH7gfXYDXqLG2Av/kDliRThl6++mVVpJ41pDjG8J eW+FZCVpoFeA6n+QaDV8KVWWEzIvsB69vOiHQNWDhh9LQxEpFsHF3gH4nfjbxRVPYHot /YYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=PWjvSbwY; 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 s134si1429359pgs.503.2017.07.12.01.14.08; Wed, 12 Jul 2017 01:14: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=PWjvSbwY; 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 S933882AbdGLINk (ORCPT + 25 others); Wed, 12 Jul 2017 04:13:40 -0400 Received: from mail-wr0-f175.google.com ([209.85.128.175]:35692 "EHLO mail-wr0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756982AbdGLIFQ (ORCPT ); Wed, 12 Jul 2017 04:05:16 -0400 Received: by mail-wr0-f175.google.com with SMTP id k67so22361222wrc.2 for ; Wed, 12 Jul 2017 01:05:15 -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=knrXV4XWozqmvDOGcatTWVg+/U3qFeoVrOrvDZ6fKdc=; b=PWjvSbwYTzWXcL//fsCYtCspIhUWtTijQrImeMD8rv+o1eWVB6J9KF5ffftQgqdKiW l3mdqhmkOihcFpBavdjFDj0cR0tGECRbvBBGK9bVpw+v53Ch+0aJYICPEKzG3dSL47sm i3H5sVE367SndT3PVEjXB2LONzHWknT4343Rk= 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=knrXV4XWozqmvDOGcatTWVg+/U3qFeoVrOrvDZ6fKdc=; b=NTx9xONQWXZqUYWA2yPE+Bu8d/YyXjHL+ZADgAQSZWoJt9/J25qXjNVoeVXH21plQF 12bLsf5xfahNVDGJK0di+Ps5gSL7q4WAuPJnGUtcqLnQMsh3y/3+xrIsbCrmYZs3cigH 97Ol/hN5lSf26363/y0ndTSKGz2FCRCANMVzYETFbq0wSx4esBQjkZn2fb9BN9pCdp1/ 8rcjiaS56I2PHVqX+EDlFOtje/I8XoIsJ7eIT2eHwf4xBcmquaaiJ7TxJTWGZA0UXvYy Pg3+sQlVvKaJZ/d4aFyfjaH6PidSpmDkOE7wStaVCjjvEcxmSJSTn01BIbl/9c/8gaBy 0vCA== X-Gm-Message-State: AIVw111ux/XRsfiZAroegWtF1q5KQXWecdhx4HWUK+RflLTtWnAwZTJe o4nYLzuKj+ML6mUV X-Received: by 10.28.127.14 with SMTP id a14mr1574684wmd.91.1499846714473; Wed, 12 Jul 2017 01:05:14 -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.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 12 Jul 2017 01:05:13 -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 04/22] rtc: ab-b5ze-s3: stop using rtc deprecated functions Date: Wed, 12 Jul 2017 10:04:24 +0200 Message-Id: <1499846682-14093-5-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-ab-b5ze-s3.c | 45 +++++++++++++------------------------------- 1 file changed, 13 insertions(+), 32 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-ab-b5ze-s3.c b/drivers/rtc/rtc-ab-b5ze-s3.c index a319bf1..ce37997 100644 --- a/drivers/rtc/rtc-ab-b5ze-s3.c +++ b/drivers/rtc/rtc-ab-b5ze-s3.c @@ -328,7 +328,7 @@ static int _abb5zes3_rtc_read_timer(struct device *dev, struct abb5zes3_rtc_data *data = dev_get_drvdata(dev); struct rtc_time rtc_tm, *alarm_tm = &alarm->time; u8 regs[ABB5ZES3_TIMA_SEC_LEN + 1]; - unsigned long rtc_secs; + unsigned long long rtc_secs; unsigned int reg; u8 timer_secs; int ret; @@ -352,9 +352,7 @@ static int _abb5zes3_rtc_read_timer(struct device *dev, goto err; /* ... convert to seconds ... */ - ret = rtc_tm_to_time(&rtc_tm, &rtc_secs); - if (ret) - goto err; + rtc_secs = rtc_tm_to_time64(&rtc_tm); /* ... add remaining timer A time ... */ ret = sec_from_timer_a(&timer_secs, regs[1], regs[2]); @@ -362,7 +360,7 @@ static int _abb5zes3_rtc_read_timer(struct device *dev, goto err; /* ... and convert back. */ - rtc_time_to_tm(rtc_secs + timer_secs, alarm_tm); + rtc_time64_to_tm(rtc_secs + timer_secs, alarm_tm); ret = regmap_read(data->regmap, ABB5ZES3_REG_CTRL2, ®); if (ret) { @@ -383,7 +381,7 @@ static int _abb5zes3_rtc_read_alarm(struct device *dev, { struct abb5zes3_rtc_data *data = dev_get_drvdata(dev); struct rtc_time rtc_tm, *alarm_tm = &alarm->time; - unsigned long rtc_secs, alarm_secs; + unsigned long long rtc_secs, alarm_secs; u8 regs[ABB5ZES3_ALRM_SEC_LEN]; unsigned int reg; int ret; @@ -414,13 +412,8 @@ static int _abb5zes3_rtc_read_alarm(struct device *dev, alarm_tm->tm_year = rtc_tm.tm_year; alarm_tm->tm_mon = rtc_tm.tm_mon; - ret = rtc_tm_to_time(&rtc_tm, &rtc_secs); - if (ret) - goto err; - - ret = rtc_tm_to_time(alarm_tm, &alarm_secs); - if (ret) - goto err; + rtc_secs = rtc_tm_to_time64(&rtc_tm); + alarm_secs = rtc_tm_to_time64(alarm_tm); if (alarm_secs < rtc_secs) { if (alarm_tm->tm_mon == 11) { @@ -477,7 +470,7 @@ static int _abb5zes3_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) { struct abb5zes3_rtc_data *data = dev_get_drvdata(dev); struct rtc_time *alarm_tm = &alarm->time; - unsigned long rtc_secs, alarm_secs; + unsigned long long rtc_secs, alarm_secs; u8 regs[ABB5ZES3_ALRM_SEC_LEN]; struct rtc_time rtc_tm; int ret, enable = 1; @@ -486,13 +479,8 @@ static int _abb5zes3_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) if (ret) goto err; - ret = rtc_tm_to_time(&rtc_tm, &rtc_secs); - if (ret) - goto err; - - ret = rtc_tm_to_time(alarm_tm, &alarm_secs); - if (ret) - goto err; + rtc_secs = rtc_tm_to_time64(&rtc_tm); + alarm_secs = rtc_tm_to_time64(alarm_tm); /* If alarm time is before current time, disable the alarm */ if (!alarm->enabled || alarm_secs <= rtc_secs) { @@ -511,9 +499,7 @@ static int _abb5zes3_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) rtc_tm.tm_mon += 1; } - ret = rtc_tm_to_time(&rtc_tm, &rtc_secs); - if (ret) - goto err; + rtc_secs = rtc_tm_to_time64(&rtc_tm); if (alarm_secs > rtc_secs) { dev_err(dev, "%s: alarm maximum is one month in the " @@ -597,7 +583,7 @@ static int abb5zes3_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) { struct abb5zes3_rtc_data *data = dev_get_drvdata(dev); struct rtc_time *alarm_tm = &alarm->time; - unsigned long rtc_secs, alarm_secs; + unsigned long long rtc_secs, alarm_secs; struct rtc_time rtc_tm; int ret; @@ -606,13 +592,8 @@ static int abb5zes3_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) if (ret) goto err; - ret = rtc_tm_to_time(&rtc_tm, &rtc_secs); - if (ret) - goto err; - - ret = rtc_tm_to_time(alarm_tm, &alarm_secs); - if (ret) - goto err; + rtc_secs = rtc_tm_to_time64(&rtc_tm); + alarm_secs = rtc_tm_to_time64(alarm_tm); /* Let's first disable both the alarm and the timer interrupts */ ret = _abb5zes3_rtc_update_alarm(dev, false); From patchwork Wed Jul 12 08:04:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 107468 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp607695obm; Wed, 12 Jul 2017 01:13:37 -0700 (PDT) X-Received: by 10.98.196.86 with SMTP id y83mr54970992pff.129.1499847217142; Wed, 12 Jul 2017 01:13:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499847217; cv=none; d=google.com; s=arc-20160816; b=lreJtsVZLR3s5CDj0ftpgDaA6Bwvavu5cS3risSp2tG9bABxEfqvQ5h6lRkS/5hjFX Gar0jsZ4hS6/QYl39fxCPoyjEH4NTJxNRgxse1HhIuKKU2y5AGslfgsK3SaGG0zF9RI8 zY5G7E9fge9EKHLFg2dAL5dW4VdRJdye+ZFVpaFTpC9nTtS327l04yaOee2DVHt6R6DG mbxSxWeYHmQT+gcTaorxSfx4Al7e26Bjc2P2zbc4SYgxyLUQHkcQEolMtfq0/pf5pgR+ 1hckMgA3IT03o/5D/Mf4sqd0OWQMTyfwJHXlpy8NbDVXG+U18oh3ydCs91iLTIliwzsh fZug== 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=b27L2g3zH0Lqd6ThWdTn9hL3+nwV/qZ7X51iRfc7y+0=; b=GXbE+zkEGzy8YVKFsM3eV4wWLj/7nroWEV1m06zlLcY7pldzf1XIxIoVZ3VsVpoFpG GxOrD+VvD0WayhvfilOWHt+z8ICNddyhCVWZnzjq5YLCMXb1nPZAZAGqrT62ko4ZVUxN AbvfRodagS0/MlstI8JMVMjSltbJ9i2rAsMRCGhZyb0efbVZOnUnLPXken5duqNBqzyg zLvYLJKeg5hj1ZnDAmYenfIUpTVfIU5AJhIT+cUytvD/7WYoQWrM0bHLUxm6b3RE1cWR Z5u4aJfHEMnZtdtGSICFGxuJdpWblHh2rnJBtLSUGFJr+8/FZqRBqTf2GlYXLy8PiyyZ eBzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=ASw6PkKM; 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 m17si1451304pgn.86.2017.07.12.01.13.36; Wed, 12 Jul 2017 01:13:37 -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=ASw6PkKM; 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 S933854AbdGLINS (ORCPT + 25 others); Wed, 12 Jul 2017 04:13:18 -0400 Received: from mail-wr0-f174.google.com ([209.85.128.174]:34179 "EHLO mail-wr0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756997AbdGLIFS (ORCPT ); Wed, 12 Jul 2017 04:05:18 -0400 Received: by mail-wr0-f174.google.com with SMTP id 77so22539779wrb.1 for ; Wed, 12 Jul 2017 01:05:17 -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=b27L2g3zH0Lqd6ThWdTn9hL3+nwV/qZ7X51iRfc7y+0=; b=ASw6PkKMgsF+9BQP86W8Txyl57lSNDU4e0ed1ujKlHHXebcv9/VjNT69ijVNOjx0k8 QqxSTfaiNERzEluq5k1BX7IZwpeK1CwiRRvcVeB0jtpZ8ydxombZNvRJLjTUG+cY01ty 9FV645z94QFBGRdwsqWW/KqZWDFYmvMVNoG5s= 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=b27L2g3zH0Lqd6ThWdTn9hL3+nwV/qZ7X51iRfc7y+0=; b=TQY47s2wsRvlR0GyMZxwuBaaD9ckdos2uY8YIclueg1ieuTlHXcH/TNDv6QgxMuOgg 2dkzCSibSceKVyrutKaweCJUzofF1uDcV9PG/ERz2K5RPeWmTRVxC5HeUNjykscVhnxs Rp1r0sgkw3DKSpklN3YrFiAH9bi6RcsquWNOvJavx5rVx2hrBdTVwELfZKmx3q2110/Z suIp/lrXVGMdRSOaQ6bNiZkwC+DF+xIvTfi3xwTTg5opN9W1BumGTgyQ5GvSFS0VugAw zTcTbc9ypjVe+lvb6TCqj6GaSZxzaEtxxgOB/bpFxI4ThAbkqxSD+O/MDSY/o44Q3B0G xPKg== X-Gm-Message-State: AIVw112YDefYf6G6W3pbLOXwwbDl/saRMKQ8Vea3P+jYONgGuct7t/Pn c0E9jLiVmriiDe/5 X-Received: by 10.28.222.214 with SMTP id v205mr1565023wmg.68.1499846716631; Wed, 12 Jul 2017 01:05:16 -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.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 12 Jul 2017 01:05:15 -0700 (PDT) From: Benjamin Gaignard To: benjamin.gaignard@linaro.org Cc: linaro-kernel@lists.linaro.org, Linus Walleij , Alessandro Zummo , Alexandre Belloni , rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 05/22] rtc: ab8500: stop using rtc deprecated functions Date: Wed, 12 Jul 2017 10:04:25 +0200 Message-Id: <1499846682-14093-6-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. version 2: - fix compilation issues by using do_div() Signed-off-by: Benjamin Gaignard Acked-by: Linus Walleij CC: Linus Walleij CC: Alessandro Zummo CC: Alexandre Belloni CC: rtc-linux@googlegroups.com CC: linux-kernel@vger.kernel.org CC: linux-arm-kernel@lists.infradead.org --- drivers/rtc/rtc-ab8500.c | 53 +++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 28 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-ab8500.c b/drivers/rtc/rtc-ab8500.c index 24a0af6..4b8696f 100644 --- a/drivers/rtc/rtc-ab8500.c +++ b/drivers/rtc/rtc-ab8500.c @@ -71,7 +71,7 @@ /* Calculate the seconds from 1970 to 01-01-2000 00:00:00 */ static unsigned long get_elapsed_seconds(int year) { - unsigned long secs; + unsigned long long secs; struct rtc_time tm = { .tm_year = year - 1900, .tm_mday = 1, @@ -81,7 +81,7 @@ static unsigned long get_elapsed_seconds(int year) * This function calculates secs from 1970 and not from * 1900, even if we supply the offset from year 1900. */ - rtc_tm_to_time(&tm, &secs); + secs = rtc_tm_to_time64(&tm); return secs; } @@ -89,7 +89,7 @@ static int ab8500_rtc_read_time(struct device *dev, struct rtc_time *tm) { unsigned long timeout = jiffies + HZ; int retval, i; - unsigned long mins, secs; + unsigned long long mins, secs; unsigned char buf[ARRAY_SIZE(ab8500_rtc_time_regs)]; u8 value; @@ -130,7 +130,7 @@ static int ab8500_rtc_read_time(struct device *dev, struct rtc_time *tm) /* Add back the initially subtracted number of seconds */ secs += get_elapsed_seconds(AB8500_RTC_EPOCH); - rtc_time_to_tm(secs, tm); + rtc_time64_to_tm(secs, tm); return rtc_valid_tm(tm); } @@ -138,7 +138,7 @@ static int ab8500_rtc_set_time(struct device *dev, struct rtc_time *tm) { int retval, i; unsigned char buf[ARRAY_SIZE(ab8500_rtc_time_regs)]; - unsigned long no_secs, no_mins, secs = 0; + unsigned long long no_secs, secs = 0; if (tm->tm_year < (AB8500_RTC_EPOCH - 1900)) { dev_dbg(dev, "year should be equal to or greater than %d\n", @@ -147,7 +147,7 @@ static int ab8500_rtc_set_time(struct device *dev, struct rtc_time *tm) } /* Get the number of seconds since 1970 */ - rtc_tm_to_time(tm, &secs); + secs = rtc_tm_to_time64(tm); /* * Convert it to the number of seconds since 01-01-2000 00:00:00, since @@ -155,18 +155,16 @@ static int ab8500_rtc_set_time(struct device *dev, struct rtc_time *tm) */ secs -= get_elapsed_seconds(AB8500_RTC_EPOCH); - no_mins = secs / 60; - - no_secs = secs % 60; + no_secs = do_div(secs, 60); /* Make the seconds count as per the RTC resolution */ no_secs = no_secs * COUNTS_PER_SEC; buf[4] = no_secs & 0xFF; buf[3] = (no_secs >> 8) & 0xFF; - buf[2] = no_mins & 0xFF; - buf[1] = (no_mins >> 8) & 0xFF; - buf[0] = (no_mins >> 16) & 0xFF; + buf[2] = secs & 0xFF; + buf[1] = (secs >> 8) & 0xFF; + buf[0] = (secs >> 16) & 0xFF; for (i = 0; i < ARRAY_SIZE(ab8500_rtc_time_regs); i++) { retval = abx500_set_register_interruptible(dev, AB8500_RTC, @@ -185,7 +183,7 @@ static int ab8500_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) int retval, i; u8 rtc_ctrl, value; unsigned char buf[ARRAY_SIZE(ab8500_rtc_alarm_regs)]; - unsigned long secs, mins; + unsigned long long secs, mins; /* Check if the alarm is enabled or not */ retval = abx500_get_register_interruptible(dev, AB8500_RTC, @@ -214,7 +212,7 @@ static int ab8500_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) /* Add back the initially subtracted number of seconds */ secs += get_elapsed_seconds(AB8500_RTC_EPOCH); - rtc_time_to_tm(secs, &alarm->time); + rtc_time64_to_tm(secs, &alarm->time); return rtc_valid_tm(&alarm->time); } @@ -230,7 +228,7 @@ static int ab8500_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) { int retval, i; unsigned char buf[ARRAY_SIZE(ab8500_rtc_alarm_regs)]; - unsigned long mins, secs = 0, cursec = 0; + unsigned long long secs = 0, cursec = 0; struct rtc_time curtm; if (alarm->time.tm_year < (AB8500_RTC_EPOCH - 1900)) { @@ -240,7 +238,7 @@ static int ab8500_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) } /* Get the number of seconds since 1970 */ - rtc_tm_to_time(&alarm->time, &secs); + secs = rtc_tm_to_time64(&alarm->time); /* * Check whether alarm is set less than 1min. @@ -248,7 +246,7 @@ static int ab8500_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) * return -EINVAL, so UIE EMUL can take it up, incase of UIE_ON */ ab8500_rtc_read_time(dev, &curtm); /* Read current time */ - rtc_tm_to_time(&curtm, &cursec); + cursec = rtc_tm_to_time64(&curtm); if ((secs - cursec) < 59) { dev_dbg(dev, "Alarm less than 1 minute not supported\r\n"); return -EINVAL; @@ -260,11 +258,11 @@ static int ab8500_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) */ secs -= get_elapsed_seconds(AB8500_RTC_EPOCH); - mins = secs / 60; + do_div(secs, 60); - buf[2] = mins & 0xFF; - buf[1] = (mins >> 8) & 0xFF; - buf[0] = (mins >> 16) & 0xFF; + buf[2] = secs & 0xFF; + buf[1] = (secs >> 8) & 0xFF; + buf[0] = (secs >> 16) & 0xFF; /* Set the alarm time */ for (i = 0; i < ARRAY_SIZE(ab8500_rtc_alarm_regs); i++) { @@ -281,7 +279,7 @@ static int ab8540_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) { int retval, i; unsigned char buf[ARRAY_SIZE(ab8540_rtc_alarm_regs)]; - unsigned long mins, secs = 0; + unsigned long long secs = 0; if (alarm->time.tm_year < (AB8500_RTC_EPOCH - 1900)) { dev_dbg(dev, "year should be equal to or greater than %d\n", @@ -290,18 +288,17 @@ static int ab8540_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) } /* Get the number of seconds since 1970 */ - rtc_tm_to_time(&alarm->time, &secs); + secs = rtc_tm_to_time64(&alarm->time); /* * Convert it to the number of seconds since 01-01-2000 00:00:00 */ secs -= get_elapsed_seconds(AB8500_RTC_EPOCH); - mins = secs / 60; - buf[3] = secs % 60; - buf[2] = mins & 0xFF; - buf[1] = (mins >> 8) & 0xFF; - buf[0] = (mins >> 16) & 0xFF; + buf[3] = do_div(secs, 60); + buf[2] = secs & 0xFF; + buf[1] = (secs >> 8) & 0xFF; + buf[0] = (secs >> 16) & 0xFF; /* Set the alarm time */ for (i = 0; i < ARRAY_SIZE(ab8540_rtc_alarm_regs); i++) { From patchwork Wed Jul 12 08:04:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 107467 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp607343obm; Wed, 12 Jul 2017 01:13:13 -0700 (PDT) X-Received: by 10.84.129.106 with SMTP id 97mr2771874plb.246.1499847193816; Wed, 12 Jul 2017 01:13:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499847193; cv=none; d=google.com; s=arc-20160816; b=wkBKT3mg28Qt1oxTpJA+3JV+9yD+nth/fkycYk/cW2YLZG4Nr51nnYlYTLkJP7ZoZA DgTHCEWbPSiRwhPHDC56C7nJiNpmFcUCRoIhrZ0Oc3lACzrfGI1r1+47dz/EO0p7p3lr lWCzTEt6yeUk6il3M7J6tEpNOXUbAYdm5X0VcyR4mkrQwus9vhfBvp91F5EKQQvBzOaP 8sPPzpDtLtLE0EDmx+jTQvrq5xE5oIoTl4A0z28vZjyb3E3ao8ty5b0xmn1X1YS0XXvS uy+pPIK20l1AtT5WY0v9vZIxP8m/X72QgUq264nosFj/JDdIPzNUAG1rZUNs8bFkTeQo DAzQ== 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=UR6J7sJF7kRQPXONmmHnu3IbCBG3e1GTdTzr/jWs6Hk=; b=pNiVrZWNVKw/mthnDpqwgrUapYd39SKB0Q+QIN/hgHoxAp5x8ic0uLi9aoClnJuBr4 i3WNRaZiP969fSVhiLVGuG1Od4RcAjbx7eooc0HIMVEYSJjl6AWB2ksk/5BMexMHvcNQ fesCCyDeCmUq0Zr1xnJME9fcmY8L4jFa30LZiOPdMQ2lLJd2bs3Hv5VMrpA/zB8+YLM3 YSdqgHmUdyThAvhoNsI7mTSEuPovA1ob14qkBtc/r5xzjJjYPoQcf6l2jXhvAin3nSrc Xm08JZyxGx+wDdSLq9dWFbjyJGiuTNuezR4qJHyrLe6Z+3gFIIlcg9lPY5W+3w5VZoy/ fRxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=cKTXu8vv; 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 u91si1454738plb.334.2017.07.12.01.13.13; Wed, 12 Jul 2017 01:13:13 -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=cKTXu8vv; 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 S933842AbdGLIMz (ORCPT + 25 others); Wed, 12 Jul 2017 04:12:55 -0400 Received: from mail-wr0-f171.google.com ([209.85.128.171]:35744 "EHLO mail-wr0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757003AbdGLIFT (ORCPT ); Wed, 12 Jul 2017 04:05:19 -0400 Received: by mail-wr0-f171.google.com with SMTP id k67so22363582wrc.2 for ; Wed, 12 Jul 2017 01:05:19 -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=UR6J7sJF7kRQPXONmmHnu3IbCBG3e1GTdTzr/jWs6Hk=; b=cKTXu8vvkC9mSVgebRGHmHuBTAkDOyy65PWkmvjz0F1PjiaVf4Ll7rwVKDCHFc9O39 +q/wqH/UXv/BPRcuNE4xdsbSnyLk0Q5qeXrpvrk8wW2zZkfwCeDLXbZ9a4TSNnLQZO0e 192dGYrq0jBjNNNi6OQRwktcDKITvhK8myQPo= 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=UR6J7sJF7kRQPXONmmHnu3IbCBG3e1GTdTzr/jWs6Hk=; b=l74vA3Yc0iQ/c0QhCUXj72Jf7Xwc9etKJ092dgD/R5nHNSLYr/DCYkjlaAfXUy+BGV aN8oNhBv1ySkF/L3EIg0ghR2ge0JlMEj2e8UTzK7KI/GhetHJkyPT4pTHqkiraInz/mE IVLUWgmc9+p41hI70a7CohhiPkIR4UbKd2kePxrKUJskIyZk2sUIRjD/STRGgYnpYYxk iBb3X7bHxO0+h88PRLGAcX6JWtPQjJuvRISp5RRK/90Cc69dTB2tagcJDUNghLKKCnnE LL6OkHayaTy82u4ysDj/Dygp+bJjDkbA7N4Ydy7Ef+VhMD8yeEFdeJMW/b0rQnxF3zGA HUZg== X-Gm-Message-State: AIVw111uoK7LrYfZ5Wa22mJrNTNqUTE+39A3m8vYXOgplwMKxLBH/LAO XZD5oyqa6qqWM2kF X-Received: by 10.223.128.80 with SMTP id 74mr2259266wrk.9.1499846718301; Wed, 12 Jul 2017 01:05:18 -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.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 12 Jul 2017 01:05:17 -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 06/22] rtc: cpcap: stop using rtc deprecated functions Date: Wed, 12 Jul 2017 10:04:26 +0200 Message-Id: <1499846682-14093-7-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. version 2: - fix compilation issues by using do_div() 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-cpcap.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-cpcap.c b/drivers/rtc/rtc-cpcap.c index 3a0333e..e92b346 100644 --- a/drivers/rtc/rtc-cpcap.c +++ b/drivers/rtc/rtc-cpcap.c @@ -58,24 +58,23 @@ struct cpcap_rtc { static void cpcap2rtc_time(struct rtc_time *rtc, struct cpcap_time *cpcap) { unsigned long int tod; - unsigned long int time; + unsigned long long time; tod = (cpcap->tod1 & TOD1_MASK) | ((cpcap->tod2 & TOD2_MASK) << 8); time = tod + ((cpcap->day & DAY_MASK) * SECS_PER_DAY); - rtc_time_to_tm(time, rtc); + rtc_time64_to_tm(time, rtc); } static void rtc2cpcap_time(struct cpcap_time *cpcap, struct rtc_time *rtc) { - unsigned long time; + unsigned long long time, tod; - rtc_tm_to_time(rtc, &time); - - cpcap->day = time / SECS_PER_DAY; - time %= SECS_PER_DAY; - cpcap->tod2 = (time >> 8) & TOD2_MASK; - cpcap->tod1 = time & TOD1_MASK; + time = rtc_tm_to_time64(rtc); + tod = do_div(time, SECS_PER_DAY); + cpcap->day = time; + cpcap->tod2 = (tod >> 8) & TOD2_MASK; + cpcap->tod1 = tod & TOD1_MASK; } static int cpcap_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled) 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; From patchwork Wed Jul 12 08:04:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 107465 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp606770obm; Wed, 12 Jul 2017 01:12:29 -0700 (PDT) X-Received: by 10.84.195.3 with SMTP id i3mr2729886pld.65.1499847149349; Wed, 12 Jul 2017 01:12:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499847149; cv=none; d=google.com; s=arc-20160816; b=MKNOVPI4WQwmNs95p394sxoyKsF9pU7E6Hm1sgIdtBc/KlrA3kY81XazRooPPEJD/v 0Tg0PnuF3ehBOwUJz8z7d+cp/A0BjU0Kz+oR8YuO16NWZnyzG/oPAUdVdqcLQx/mdufE snhhDEobsvenyHQ6kH1s5wsAFutpRBiDJGT0gTtkf0ItPDU6i+xoZXzlr4dsSBNSksv/ hp+hCa3E4xK2lXcIPbI19Ozb0foiuZR+0Ym/P0/vwidoTLpzCdSAWfnfJ5+EjGxx1C7p qxhMNUy+ITEI1F4A4MxaYxrrHSSjWDnhxKsBWgg3/mzoYeAFrui67I9OXcdNigFrpZ+C 6xIg== 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=xQZnvb6WkHY7uiUpIFUonTnxXqndHkNZi2qqU6KJSMU=; b=FRm53rPzBXdokQc96QKkTGYrF8tiG/DzpQ3hCndTktUiOhe1CTB2eStDyrtrqg+6/4 fx6gUpCNElFEfX8IksKE+muILjzmnbXZhC5a0ubTrLpz12v8eO9fYf0CndtIew6b0TEt UZEPV9z7UJou+fQUPVKm51JasGbMGwTLEzTTMiPgsXOF3bFFbtKu6RAtezF1nKudGAZd SKwjP5xT0sCUWy75iYCe6FsrgvMPjKiGBrYRNyEsFxYOoSY67URL4UDBYmqwP8L8r6wn 5SyqUfsHn9uYdCistMK8koG6hkacVWvHGYs8dWjKyj7GlLcfDg5rWZzYdLaQA6dFK0lI BbaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=g8Z2sWUj; 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 102si1560734plf.448.2017.07.12.01.12.29; Wed, 12 Jul 2017 01:12:29 -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=g8Z2sWUj; 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 S933830AbdGLIMU (ORCPT + 25 others); Wed, 12 Jul 2017 04:12:20 -0400 Received: from mail-wr0-f180.google.com ([209.85.128.180]:32902 "EHLO mail-wr0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757016AbdGLIFX (ORCPT ); Wed, 12 Jul 2017 04:05:23 -0400 Received: by mail-wr0-f180.google.com with SMTP id r103so22505536wrb.0 for ; Wed, 12 Jul 2017 01:05:22 -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=xQZnvb6WkHY7uiUpIFUonTnxXqndHkNZi2qqU6KJSMU=; b=g8Z2sWUjNq17qhKuSL6/q9ijtotEc6y51g90Zjh0PVwYlN4GK/GiQE2pk2xfC+Z4k9 Rle7AWFSdSa3eIFnBmK6Iebh93HCOrxcZn6t9nsqwFdxPgxVs3jHFqiseQKwme4uWoBj 4c1Spg8e+6TG4xXzBzUAAbKXtTtVoGNCCBZd8= 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=xQZnvb6WkHY7uiUpIFUonTnxXqndHkNZi2qqU6KJSMU=; b=a7qDFs1uAgNF9Jw3tjKzSQUUQxn/yxs603+WYE/tHieb8P79or8yz1+oQ6CdKQPjiJ kXGmt0dvVXhV15jxqZ0MOCx3qcjdVjvNdOwlCM08amPtRhGnr11lqq+x+1hhkcBgN2QJ gvGIJSq+vB+aF5kAmxB6nWQlVwgg3f2xjjUKdajNvCV0JKr/yPr0msIx1XZJrCCl3H6D 4OJZdlLajGLDsysh4xdL5wQaIYxqPAOOdKFdGFBxtr7pw32xYRT4MRab8RyT9YGY9nA7 5KLUa2CTAoywkn2WymHJjEATEt0WquK1pwjgDMxal80qKrfSwNFURiUH6bEA3giv5JH2 3QvQ== X-Gm-Message-State: AIVw111kzjfyrMMXovzFQs5/Ccd+/lT9TyzUiDAt1G/hQJYZHJX20EJW V5CE5i1WAC8K5heX X-Received: by 10.28.184.87 with SMTP id i84mr1548763wmf.22.1499846721715; Wed, 12 Jul 2017 01:05:21 -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.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 12 Jul 2017 01:05:21 -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 08/22] rtc: ds1305: stop using rtc deprecated functions Date: Wed, 12 Jul 2017 10:04:28 +0200 Message-Id: <1499846682-14093-9-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-ds1305.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-ds1305.c b/drivers/rtc/rtc-ds1305.c index 72b2293..b41168b 100644 --- a/drivers/rtc/rtc-ds1305.c +++ b/drivers/rtc/rtc-ds1305.c @@ -324,23 +324,20 @@ static int ds1305_set_alarm(struct device *dev, struct rtc_wkalrm *alm) { struct ds1305 *ds1305 = dev_get_drvdata(dev); struct spi_device *spi = ds1305->spi; - unsigned long now, later; + unsigned long long now, later; struct rtc_time tm; int status; u8 buf[1 + DS1305_ALM_LEN]; /* convert desired alarm to time_t */ - status = rtc_tm_to_time(&alm->time, &later); - if (status < 0) - return status; + later = rtc_tm_to_time64(&alm->time); /* Read current time as time_t */ status = ds1305_get_time(dev, &tm); if (status < 0) return status; - status = rtc_tm_to_time(&tm, &now); - if (status < 0) - return status; + + now = rtc_tm_to_time64(&tm); /* make sure alarm fires within the next 24 hours */ if (later <= now) From patchwork Wed Jul 12 08:04:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 107466 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp607102obm; Wed, 12 Jul 2017 01:12:53 -0700 (PDT) X-Received: by 10.84.231.194 with SMTP id g2mr2857246pln.5.1499847173084; Wed, 12 Jul 2017 01:12:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499847173; cv=none; d=google.com; s=arc-20160816; b=Jn1Avx7hl4JZVcUFiQPcqGKkNWT0rG6Khj5o/OtoFnlRsqhn17zgm9oxnA1KSGwYm7 vDlAXEdb4EmkWFRbZw5bj8wBf4HQoXV8DDN7RA9wDCDbtK+tOKkAx0cJE5k7f7jM8Ly0 dkMrt/f4KlSd4VSYxQtMJcLUq03XuJIXTQ37rQPLVgbWMarZFW4WULtQxqPcbTYGFUcv LN/uUuL7Awj8tpYp1rElXxLweyvS1Bs8wicAPy9UH36NiKK3TTJWgGg7GK0CpqO7MHT3 NLUfkTYxwcjebxppSugpqXwYQmWiq+e4rKUGit3a5YPZOND1dAcrLDU13+E/NtQ/ZcZn 2nUg== 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=4lcbBNywt7fnw0wGji3xZ9HK+BTNE3a/hn32F8xnPw0=; b=XD0EPyz1iEcFzHiAuM9EUIOzqA3U36trwazH84uqqoPafAQuLUvq+zQIdVsCfceyeK 3+lxsxznKz9v3JDUxQkX3eNriFaDvnn8UCaabRwQRdOXCvsSIhe566gdhtMhVZt+NO2p CVQeWn170s9nSk9bLxuEoi2VDwU9rHVO/0TQqX3L9qCQQiGkg9rmQZYbi1iI9qHkw22L xilpsAX0i9Hd6Iho+rM8CBNOw/fbigMjix1Wbr8ozgfJys9Bv7Jc2WlB+QR+xtdm4LNx fnCGUqAvKsHgZ4QEmb8sQRkrnLTz6+vZ4Bg9xEJpImLwqmzu91ocXKx8F4xm8G8lwgC+ bA7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=FVCOCdW/; 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 e13si1465943pgu.2.2017.07.12.01.12.52; Wed, 12 Jul 2017 01:12:53 -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=FVCOCdW/; 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 S933804AbdGLIMS (ORCPT + 25 others); Wed, 12 Jul 2017 04:12:18 -0400 Received: from mail-wr0-f180.google.com ([209.85.128.180]:34277 "EHLO mail-wr0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757018AbdGLIFY (ORCPT ); Wed, 12 Jul 2017 04:05:24 -0400 Received: by mail-wr0-f180.google.com with SMTP id 77so22544174wrb.1 for ; Wed, 12 Jul 2017 01:05: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=4lcbBNywt7fnw0wGji3xZ9HK+BTNE3a/hn32F8xnPw0=; b=FVCOCdW/TDsJtbPdPD4cSd6tuCJv1/Vjj5ARcaDuDAu3LABsCtv/JYyKCOmsuxVawr K2qA8yziJlX3Kz8kzIRaC7KSDrMV62s6xCO5/Q6llJPey1iLEjI8lt9fKHvtchGbJ1IP CKttqO9BoIrob18EDELilRs5y7o4yib33RMiw= 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=4lcbBNywt7fnw0wGji3xZ9HK+BTNE3a/hn32F8xnPw0=; b=dndsuXwRWOHfamq6w28qqIebnyf1RLA00WjAEWUYuraiOUhUrUG/bGHcQBt+5lS580 7K7AvD9N35EKtaFabmeXp+7hvQVUdWgMMYmbbuSXZg2+aRJnr9vRslkYlKmrQsoFiAdm h+2++oqnBgURkfvpAwO12596Xc3bdnu4lvdrMHH2ooTvPjUQMVUxL/BFu7upwW5Ka8CK 0nkBpb008gtdHsMg71LZoT843j+3m9ctmOYb8x/RiWnvNE3kE5v1BNiEw7bqlZtEHJ08 SBJ60X7KkRCr9L8wpUtiGuP3e1KbIpywsXm6DRNL2DpJExUpy2wF/lKHIxyiTcwpGfLB TTPA== X-Gm-Message-State: AIVw1133x7Id9e74145qFc48XODPGVIin1PaagfcaGAQlGkQ7pmeSUrF VOJmdQ5FI9YmG42d X-Received: by 10.223.170.138 with SMTP id h10mr2204561wrc.153.1499846723358; Wed, 12 Jul 2017 01:05:23 -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.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 12 Jul 2017 01:05:22 -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 09/22] rtc: ds1511: stop using rtc deprecated functions Date: Wed, 12 Jul 2017 10:04:29 +0200 Message-Id: <1499846682-14093-10-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-ds1511.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-ds1511.c b/drivers/rtc/rtc-ds1511.c index 1b2dcb5..3744114 100644 --- a/drivers/rtc/rtc-ds1511.c +++ b/drivers/rtc/rtc-ds1511.c @@ -279,7 +279,7 @@ static int ds1511_rtc_read_time(struct device *dev, struct rtc_time *rtc_tm) if (rtc_valid_tm(rtc_tm) < 0) { dev_err(dev, "retrieved date/time is not valid.\n"); - rtc_time_to_tm(0, rtc_tm); + rtc_time64_to_tm(0, rtc_tm); } return 0; } From patchwork Wed Jul 12 08:04:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 107460 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp603067obm; Wed, 12 Jul 2017 01:07:55 -0700 (PDT) X-Received: by 10.99.185.25 with SMTP id z25mr2571483pge.273.1499846875738; Wed, 12 Jul 2017 01:07:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499846875; cv=none; d=google.com; s=arc-20160816; b=lkFbvUq5YrW71+S0EeRCjxP8AmNTJ84Xf49mf3zEYABMwe4GopHs9p72jM1XgZ1YdE 21z2CLw9xJ2Fqr5Lm/5udii+h5uRtWHhF2t0c6kPq3dcJdP99xoo5GbNsABS/SW+lU35 YB0PGtw0cBIjse9v6cfXCnuSSJExyJBosHyMC4WBrANmqPnoP/HRvKi580GkBkkpny4V q3l1WDk4AXOZQbY817slt4gV/Ji2w3rpAYre3qh8rM8usKwpEsZHc7y1kWf//hAueZvX D475wTyo+UswJHPRFYXG7dsnBvJ7s/bGAoswHG74QxDR+T/3n5yIE+a7MUduhP0cBxNQ azxQ== 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=a8OvcgxX7DKilQxXn0w3WL5mzEKXYuDNJJmY/pe4xdM=; b=WpfDvZhnSghyyge2gDuic/p3L3EoaAzNcpynAU4GML8opLRZYmHzMjE4fhodE5No1z L0c/yHGwB06WHauWmawPhn9SoiWfvgtxvzRWbJ59zIjTefb4ZD+jA6ZFgOcftFA3yUMH 4Cu1v8p7q6uHtgc3nc7nSLL91U6uNxX5PGJlGlJAT+qx1h/D2zITq7l0D0WduCp7UgNb f/0S15VKP2qDjytMxulIWTqZPPHPWU8MEY+wNJC6urPfObNMN9TgoXdUAT0HxsMRF5Yk a4wlHO0kCX6fayT29yBIT27gMGWdv0k1DlbNZofUNZmZuH76VAF0mpozpY6zzuUYFQlV 5Opg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=eeUjkykM; 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 g21si1375728pfg.344.2017.07.12.01.07.55; Wed, 12 Jul 2017 01:07:55 -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=eeUjkykM; 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 S933477AbdGLIHs (ORCPT + 25 others); Wed, 12 Jul 2017 04:07:48 -0400 Received: from mail-wr0-f172.google.com ([209.85.128.172]:32945 "EHLO mail-wr0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757095AbdGLIFv (ORCPT ); Wed, 12 Jul 2017 04:05:51 -0400 Received: by mail-wr0-f172.google.com with SMTP id r103so22507512wrb.0 for ; Wed, 12 Jul 2017 01:05:45 -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=a8OvcgxX7DKilQxXn0w3WL5mzEKXYuDNJJmY/pe4xdM=; b=eeUjkykMUufZ2St5XEt6KOKJ7S4haznSFe9diqJTigOXGb+NWRkqfpH8hxfqk5iNX/ Qy8J8RGLoehJ+F0WgIVlFpdkmL/xYcrVDGAHmV9fIngGSb57SE7rz1bDNh4BgxSE4Q2w AailrFLBmjK/m4MKfpeXU2sCAfcqkGzEX7260= 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=a8OvcgxX7DKilQxXn0w3WL5mzEKXYuDNJJmY/pe4xdM=; b=fQVi4TkLhghpEkzQzeFcgZhPcbUrhflNZpXS42aK/S/0QIQNflh7xkQjELWXmCQXdD QPsTvrWntpL0ZIUWvQic+hfYKtbBisLBGwprt2ZoTVnbLK7HXJai1LHkjdR4A/qzhnq+ 0pjB+n93C4ooSAl4f4sTVYOeRau0+g8YBCVp6mM8n+RcthLENXrUjXHlRZqgXyfyIQvJ MPcjmONJfqZZfnhmD/jCoJ7KOj8tS2yc8LpPxW3BKuUyAwqv5Q8esjA89DaUbVeuEk3/ SvnjbCkGLEos1fmQg6xzB3OknVyTyvacafnpxGSxXDSbbiaI7bZM+eRTMq5UmKJzZ29B Rs1g== X-Gm-Message-State: AIVw1112aP4yaYnRcMfhgDQ2x6JepAVcr9N7kbZP1rJBTU/GVO6rp/Gb maXMtR25s4BNLTX/ X-Received: by 10.28.67.6 with SMTP id q6mr1626839wma.6.1499846724999; Wed, 12 Jul 2017 01:05:24 -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.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 12 Jul 2017 01:05:24 -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 10/22] rtc: ds1553: stop using rtc deprecated functions Date: Wed, 12 Jul 2017 10:04:30 +0200 Message-Id: <1499846682-14093-11-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-ds1553.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-ds1553.c b/drivers/rtc/rtc-ds1553.c index 9961ec6..dc08366 100644 --- a/drivers/rtc/rtc-ds1553.c +++ b/drivers/rtc/rtc-ds1553.c @@ -129,7 +129,7 @@ static int ds1553_rtc_read_time(struct device *dev, struct rtc_time *tm) if (rtc_valid_tm(tm) < 0) { dev_err(dev, "retrieved date/time is not valid.\n"); - rtc_time_to_tm(0, tm); + rtc_time64_to_tm(0, tm); } return 0; } From patchwork Wed Jul 12 08:04:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 107452 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp601227obm; Wed, 12 Jul 2017 01:05:45 -0700 (PDT) X-Received: by 10.84.216.28 with SMTP id m28mr2707374pli.275.1499846745393; Wed, 12 Jul 2017 01:05:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499846745; cv=none; d=google.com; s=arc-20160816; b=EJ+XmMKbwQ7aTk2Myq5YD6C/BnzaajEkygPyOIU/vxlvU3Gc9IP6iXcS1mnDkAgYXK GK9fHZcSDiVgCxPcQuSgIySYG9yytKnFvdl+IeVGqeTApOZ86WszDq3VKveNIuF97k+T mBUNNpuXk2itQg4Kd09D0abLP+fVCb+MffsY2qCVZmPtJnQTPR2FaJPhcUT/5z1G5aA/ yqVLHGU+LvfDmV5NHaEXD18/NTva/CXXWlXZB2Gal0n/FzM7ngiH13IhdBG235wnta91 PL0iyAs71k0MU7iXbBmCCmy2OQWnd0mwDYIlE6f67m0cW9uo0n7eCYsXGqrWo26CHS0c 2MkQ== 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=zXII0zO7QokUmEbsAtI2Xd+ZAzl1PcCW94AR09ahDVw=; b=rNRVLRGHkmKldFfZCmJ9JWAzHrJ3wa1qeHiHT2Z8mOAsJf6p7EqO0rZhI/4BgFV0gg K5dP9dLj2SWAd5iMsd3M4RSy/RDA+JbS1D8Nn4FFdfb5Jw7B0Pg4sLQeQxjBQVPlXGE+ Qeclx1KCFKo5le7oLeSvz0em9MC4hOgM3BCmS/TJLL5z3/rpxR9tGtsl/8vN4Sh7tO3G Rjo6RCdlkmZqXr+4bcWiBkr3UxcmL7z80miDmjTBYBg0KviCeLuoBfhX4aUI3MFiJZBW ohYWQtV3yQ9kJt3Inj8fkJkGd2MfEnrjIamF+CmingcdMrjO+FRvE7Dy2K5dfduif7a3 lHKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=Y1YykQ7d; 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.45; Wed, 12 Jul 2017 01:05:45 -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=Y1YykQ7d; 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 S1757050AbdGLIFc (ORCPT + 25 others); Wed, 12 Jul 2017 04:05:32 -0400 Received: from mail-wr0-f176.google.com ([209.85.128.176]:34325 "EHLO mail-wr0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757033AbdGLIF2 (ORCPT ); Wed, 12 Jul 2017 04:05:28 -0400 Received: by mail-wr0-f176.google.com with SMTP id 77so22546207wrb.1 for ; Wed, 12 Jul 2017 01:05: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=zXII0zO7QokUmEbsAtI2Xd+ZAzl1PcCW94AR09ahDVw=; b=Y1YykQ7dNhsp0DeQn/yVlTDeK1puAdwtw97mEAJPNmRzVe9D9EW1Uog0nGs6aBUeAw yJtv4ZQfT5/x6pwBfEm6WVQ0vJhH+o/URW2KMwjamoAylxMwkVO16O8gkpi5jxBQuiF1 umNNuDgI+zqD9vFxVbE579yWJcffKqguCKs8Y= 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=zXII0zO7QokUmEbsAtI2Xd+ZAzl1PcCW94AR09ahDVw=; b=E7BEkNkBt01HXlN4Q5n97lUHY3Op/O+ciEmpYLmVWas4telX1U+1LiVMe1840FeQAx qUbsxTd342Sc9oQfh4CMfv6/SLKCIjEbkE02l2Q5Hk4FwVe0YK4FWtjrUc/fvFBqXP1Z PlRyPQ3NHT9ah2RlbuJKQCCTE9ih4N71yJPaVfmB+wNjh9h/YMd6yMMJv7cIsjrF8+wr 1f53zznk7iOjoY0lRhidgaOh/KQZNhd6B7mAl/DUC+MJ9bv505U3I6HDLgY4gP4IqOBj WRLe7WAzvyDHLpMcAXqd1+wlfMci9IiFEfwG7sPavYwL9rledYK0IYs9mmPytgm3sBb4 a+Sw== X-Gm-Message-State: AIVw113T4gtVAXOXuvHtuNEcP5AtgNyATmlK09XAzOTk3TkKk50hgQDv GGs72exbTzlDrVT9 X-Received: by 10.223.151.51 with SMTP id r48mr2012282wrb.189.1499846726713; Wed, 12 Jul 2017 01:05:26 -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.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 12 Jul 2017 01:05:26 -0700 (PDT) From: Benjamin Gaignard To: benjamin.gaignard@linaro.org Cc: linaro-kernel@lists.linaro.org, Hans Ulli Kroll , Alessandro Zummo , Alexandre Belloni , rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 11/22] rtc: gemini: stop using rtc deprecated functions Date: Wed, 12 Jul 2017 10:04:31 +0200 Message-Id: <1499846682-14093-12-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: Hans Ulli Kroll CC: Alessandro Zummo CC: Alexandre Belloni CC: rtc-linux@googlegroups.com CC: linux-kernel@vger.kernel.org CC: linux-arm-kernel@lists.infradead.org --- drivers/rtc/rtc-ftrtc010.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-ftrtc010.c b/drivers/rtc/rtc-ftrtc010.c index af8d6be..6328913 100644 --- a/drivers/rtc/rtc-ftrtc010.c +++ b/drivers/rtc/rtc-ftrtc010.c @@ -74,7 +74,7 @@ static int ftrtc010_rtc_read_time(struct device *dev, struct rtc_time *tm) struct ftrtc010_rtc *rtc = dev_get_drvdata(dev); unsigned int days, hour, min, sec; - unsigned long offset, time; + unsigned long long offset, time; sec = readl(rtc->rtc_base + FTRTC010_RTC_SECOND); min = readl(rtc->rtc_base + FTRTC010_RTC_MINUTE); @@ -84,7 +84,7 @@ static int ftrtc010_rtc_read_time(struct device *dev, struct rtc_time *tm) time = offset + days * 86400 + hour * 3600 + min * 60 + sec; - rtc_time_to_tm(time, tm); + rtc_time64_to_tm(time, tm); return 0; } @@ -93,12 +93,12 @@ static int ftrtc010_rtc_set_time(struct device *dev, struct rtc_time *tm) { struct ftrtc010_rtc *rtc = dev_get_drvdata(dev); unsigned int sec, min, hour, day; - unsigned long offset, time; + unsigned long long offset, time; if (tm->tm_year >= 2148) /* EPOCH Year + 179 */ return -EINVAL; - rtc_tm_to_time(tm, &time); + time = rtc_tm_to_time64(tm); sec = readl(rtc->rtc_base + FTRTC010_RTC_SECOND); min = readl(rtc->rtc_base + FTRTC010_RTC_MINUTE); From patchwork Wed Jul 12 08:04:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 107453 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp601451obm; Wed, 12 Jul 2017 01:06:01 -0700 (PDT) X-Received: by 10.98.211.89 with SMTP id q86mr54017947pfg.37.1499846761389; Wed, 12 Jul 2017 01:06:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499846761; cv=none; d=google.com; s=arc-20160816; b=DWLu88M/scS0CZ3EdzZvtvsRTRZM+BttwPVmtlIU7gzfk2DTcGiWiDvUWFEvJyjrhj ziF7/Nlow8J1cLCzfodYbxXnP11qGAWY3x/PKuF8NkicJDtVb7Zbw7fD1BXCHDvyAU54 Lq3GxluoNwvwBDZBq77NWlbTadnHSN6xIkAU2FZXkaUgRmv3JD5wYRP/BzekKqKT5CBm obTvAFrLiiGz1jkWbyaKn6q8iwS8j7IAskX9riUEGVZORxTq/tM9EH2J0NkL+WAbQrvE 1BysGFC0HcFConysF+GELszmtmUEWhq+/FRornbkpVnh5lpnLwGqjVUoFRnCDqEKP6U8 +3Ig== 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=IWUzzH7lGhWLaolb0AnsGNeRwUZZ6DM10Q5haRCbzS8=; b=PPNqivzGI4+XT/V6HXKkK3bdhx0rjv6+NYRMFQAFFF477vG0ZMDrvsoL1MlhtkCGwK qU/Ugkxd5Zr7qI6NBVTWvc0Haz0TNYn0F1iDY3YKlILB3MTKqubhH7RG+hqr2Im+x12N ITwmksQSidPQ/IEpA+7KGNWyrc8MngP2iT/1v162npRMvl39EK0SqGMNjfN6BSXXjbMU Bqamm8RsuTQ8vzVI4a7UHCHeWCtJ5MMUmJXISW8L7gZg5kz02o7HPkb5Oqes1Uui0tuC m2owlSSgIcbeU5ULySsxigWEBzKs3zLDf1VNpKNiDocl4OMuc3s7Bkifp65068bH8khq sd1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=T9N4pg7p; 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 e21si1435857pga.184.2017.07.12.01.06.01; Wed, 12 Jul 2017 01:06:01 -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=T9N4pg7p; 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 S1757073AbdGLIFl (ORCPT + 25 others); Wed, 12 Jul 2017 04:05:41 -0400 Received: from mail-wr0-f170.google.com ([209.85.128.170]:33005 "EHLO mail-wr0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756970AbdGLIFf (ORCPT ); Wed, 12 Jul 2017 04:05:35 -0400 Received: by mail-wr0-f170.google.com with SMTP id r103so22510029wrb.0 for ; Wed, 12 Jul 2017 01:05:34 -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=IWUzzH7lGhWLaolb0AnsGNeRwUZZ6DM10Q5haRCbzS8=; b=T9N4pg7pSjRuu0IZD3huxSXWCU/kzHkcFfS0y9cbOwNSHC+hQZFb/1/O9/LFjFgaET tIJeI5A1kmIX5SJumhm0X7MIN+ftfKPBF+y5o8Vr1dPya13zKjdqcUgZJ4KUW26NFk2J 5OXCxBTn1fYTKyvcZMiZhpmhvDMB8aFNzOJxU= 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=IWUzzH7lGhWLaolb0AnsGNeRwUZZ6DM10Q5haRCbzS8=; b=o/0iGnpnSAzZn+YJ+FAxgtBhKBG2NwgNDHkz8iZkvKNC1duj6iKHXyr0OzcvUBs4vI 7IQkS1Nnl5SJ0UBlRhgvygnpn4Qfsm8uGLMyi3D4PSBj9pGlWHuJsMZhQTaHl5GaSQo1 fip1IFNCAYQmodI4jdmyzVALHWAzBdFtXvxuILOI09tDJJHJ0QzQ/uTzRfBUhux6cFqw L5TK5mp5tmMdj+k9k9dH8KRe/OQHfMfFq3bxH+2pqL1zUOWY7qL3NbfQoVFBeVVBnhAs sh+SOuDJJAN4EhWDmS5TWDNMiLfrcnmaLM0z24Mt0LwDCaLEVttBeUpmoLxebFaKwI4C zq8Q== X-Gm-Message-State: AIVw113d8WQWkl7uq3Dn5rO0hqe21BgGLabuijxfJj26KAxY4C7i53e5 /SdWDPUnBKHnJkXP X-Received: by 10.28.153.81 with SMTP id b78mr1527383wme.85.1499846728921; Wed, 12 Jul 2017 01:05:28 -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.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 12 Jul 2017 01:05:27 -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 12/22] rtc: mv: stop using rtc deprecated functions Date: Wed, 12 Jul 2017 10:04:32 +0200 Message-Id: <1499846682-14093-13-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-mv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-mv.c b/drivers/rtc/rtc-mv.c index 79bb286..fce4658 100644 --- a/drivers/rtc/rtc-mv.c +++ b/drivers/rtc/rtc-mv.c @@ -127,7 +127,7 @@ static int mv_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm) if (rtc_valid_tm(&alm->time) < 0) { dev_err(dev, "retrieved alarm date/time is not valid.\n"); - rtc_time_to_tm(0, &alm->time); + rtc_time64_to_tm(0, &alm->time); } alm->enabled = !!readl(ioaddr + RTC_ALARM_INTERRUPT_MASK_REG_OFFS); From patchwork Wed Jul 12 08:04:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 107464 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp606171obm; Wed, 12 Jul 2017 01:11:38 -0700 (PDT) X-Received: by 10.84.216.28 with SMTP id m28mr2729570pli.275.1499847098008; Wed, 12 Jul 2017 01:11:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499847098; cv=none; d=google.com; s=arc-20160816; b=YHqSlAhjV56Y3A5qQppiR/GUL4zJqA1qaAxFQ0RnGwq8RRhfOhei8z4BT3brtEhjMW V7G6jGPAIHIlcFKySm8CsDHJsNKkvfZqm9uZkHIoi5jdh5S2FIqqcW2tgB3u01DZXGty bnCaH08rXgqIbYizE33A60LxRO3qrNsaqJsSGFGKHK9TNNQV+vPnDU1O5ZfzHCyCXWes a+/jixE3uPpq74tY5ibIZkJTu5/piyQ5MpuXIMppA9FvIBW/qTFN3K6lfJ+wOE2JIeg4 1pPbTlszZmXlr+hJQJoLE3OuMaDXQoSZ7A7LcOa+1hDXCcInXemgDmjw97Uvufq8ied/ XrTQ== 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=zc06aOWP15P1ICI/HhIDyt0ckkJQmcRwGlFQtluYMEQ=; b=X5aloLx5iRqdwhm/cP9rsH/ljiKiX7ya9yYX0i0llY0PRtyGZfq/Lg4tgj+MuVOsuF hKR4yE1bpTgqQBJXsSGK+W56AS+/XszMaKyC7bWL9V4vAiiJ07wOwM+dgElWqXVBbB7p mm4XQLAxjZVY7nxFJW89KM0Y8l5pibJdDtAkldAwj8La21QHgCFVn4IacywqEU1heisS qjfxNJTUbR+8sjMhfTeMXEVDZf5ufaOIFFOD/1NWnEUWqXLfxCiJUPCCEEr0bQGIt9ky NBsCTS1Kn2Xg4eYnheCj8pNj1WNOciTTcq4Ltk50F0eHPikPeEWimhyMrVr5AylcSTao dUQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=TP260OU3; 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 a62si1396280pfj.336.2017.07.12.01.11.37; Wed, 12 Jul 2017 01:11:37 -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=TP260OU3; 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 S933775AbdGLILT (ORCPT + 25 others); Wed, 12 Jul 2017 04:11:19 -0400 Received: from mail-wr0-f175.google.com ([209.85.128.175]:34889 "EHLO mail-wr0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757033AbdGLIFh (ORCPT ); Wed, 12 Jul 2017 04:05:37 -0400 Received: by mail-wr0-f175.google.com with SMTP id k67so22370761wrc.2 for ; Wed, 12 Jul 2017 01:05:36 -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=zc06aOWP15P1ICI/HhIDyt0ckkJQmcRwGlFQtluYMEQ=; b=TP260OU3J5ty4JVP4dxGiLV0n5OnLpYpF/ztwqBZb4zGuZw4WWCYn6hI8/VfPoxSHK 5uOZCLrUWkXuIylofHFvkiufXMwNIOrdb82OdY9byFcFYKwU7LnU1YiLEq/Xj4CJjaKK 67EB+BLkB+/rEUWTHGeqCAJt6Tpj4Vz7hdedk= 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=zc06aOWP15P1ICI/HhIDyt0ckkJQmcRwGlFQtluYMEQ=; b=nL8hgkwDXZjGgBXHEHeRI50hgmIJmfoj5Hl9RZ0yd+bbwGPNxtLRo+B2lDv8m9GGFK bVYAkJB1qJhzl2nWzfwN6hfhZwACbBWh5tLqy71EmFo2Jj9DzXN6eAjUD+3pHDCW6q3o NdX1kcwpo3A30W0gpdGdnoz7xCCnU3rPZ+rWZ8h/Ilov3+olkPpOoP6EZAbac7xycMBk a33qH21JAUx3krseX5Au4nD3hd3L07eHilQAwVBJHRqsIsUakJAi/Hln444VyV4nRzrF k48px9e7lvLrqlG4Y1JGkP8KuFwjaysBZBTKDIZfEymYL34jV3z5x/yZRCsumnlD33Fq 0GsA== X-Gm-Message-State: AIVw110MEsvNjgDuSKXdLBXIZq3UOhEIELtDxUriWM0V5QnNdhsttD7M faGBuOdjAUJjG5pW X-Received: by 10.28.149.209 with SMTP id x200mr1604983wmd.91.1499846730557; Wed, 12 Jul 2017 01:05:30 -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.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 12 Jul 2017 01:05:29 -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 13/22] rtc: omap: stop using rtc deprecated functions Date: Wed, 12 Jul 2017 10:04:33 +0200 Message-Id: <1499846682-14093-14-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. For the same reasons use set_mmss64 callback instead of set_mmss 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-omap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c index 13f7cd1..8aa3957 100644 --- a/drivers/rtc/rtc-omap.c +++ b/drivers/rtc/rtc-omap.c @@ -432,7 +432,7 @@ static void omap_rtc_power_off(void) { struct omap_rtc *rtc = omap_rtc_power_off_rtc; struct rtc_time tm; - unsigned long now; + unsigned long long now; u32 val; rtc->type->unlock(rtc); @@ -443,8 +443,8 @@ static void omap_rtc_power_off(void) /* set alarm two seconds from now */ omap_rtc_read_time_raw(rtc, &tm); bcd2tm(&tm); - rtc_tm_to_time(&tm, &now); - rtc_time_to_tm(now + 2, &tm); + now = rtc_tm_to_time64(&tm); + rtc_time64_to_tm(now + 2, &tm); if (tm2bcd(&tm) < 0) { dev_err(&rtc->rtc->dev, "power off failed\n"); From patchwork Wed Jul 12 08:04:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 107462 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp604871obm; Wed, 12 Jul 2017 01:10:06 -0700 (PDT) X-Received: by 10.99.60.28 with SMTP id j28mr2555097pga.18.1499847006437; Wed, 12 Jul 2017 01:10:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499847006; cv=none; d=google.com; s=arc-20160816; b=Q0/dI089Lzg7lukbyxJ6kWwv2wRRl+Q1rlwKxPiNsxrqDyZkF0s2/SWO3YFHc3Dotm G2X2yNRIpISiZ7jjkqBHWw99HJuIsaUHlgUjKaBKnGw1F3gWlQtwGf/JyjbQmFhFrOQA xbdylVJROaKW+UCv101KVfVTefNZpLbCZDMJiwRfAhvYwBaRheb9grFY18XNvsqHlZSB N4HAZubQ5PwZwUkzbcVuUrTfSaPqpE9g97F+oGqb4YgVkkesaPeRANcwds3KE0dSWzTK auRZekQwS/QIDIn4gzSpOLNdZhSJsLruuY9l3HrdxzXJmymMSFfiQeVlOE8IHIgn3q7K 4tvQ== 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=Gbqqqpi/ld7LejpxceT76DgIPCsFOhIVfhDvPHgIiYQ=; b=eKCDniQ6jXA2d3qfTzyNv+3UZAtmPtXz9WycbJhOn+O7v7JK8Lia/GbrbYEHTykxsI PdgYY3Ae9KxczE50AYHF1z3AZ7MOFtOAGM+jlyjb8YxdH9VK19VxlihWVzOrICA+CbFn 5k/Top7xLHRuHPiUSZ+FPEV/w5+3sWwLXTc+jiHwOpnzB+jv5JYytAKC3bolOOIOGj5k 459Aiy+1NMU37tUXKjGfbnM64O3vm732uz3ykIaKEDcNgoLnNUzsLShHXYJ3FQEfwT4a Q2Ptow/FACjek81nR/MD/3DgSBu2spvWVqtGtGdc4QYoSidz2RSfg5Tv8bIA5TwI0nM9 0SlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=FPEyWgJM; 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 71si1418278plb.627.2017.07.12.01.10.06; Wed, 12 Jul 2017 01:10:06 -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=FPEyWgJM; 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 S933667AbdGLIJ1 (ORCPT + 25 others); Wed, 12 Jul 2017 04:09:27 -0400 Received: from mail-wr0-f170.google.com ([209.85.128.170]:33049 "EHLO mail-wr0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757055AbdGLIFs (ORCPT ); Wed, 12 Jul 2017 04:05:48 -0400 Received: by mail-wr0-f170.google.com with SMTP id r103so22511887wrb.0 for ; Wed, 12 Jul 2017 01:05:38 -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=Gbqqqpi/ld7LejpxceT76DgIPCsFOhIVfhDvPHgIiYQ=; b=FPEyWgJMCkZc9VhARmtarRWZ7qK8FlrYkPE7ye+4cBS7BsmrpRW0r5VYuvaJ2xGLft CMCs6PIgwGPxNwNHv6yge/izEXm/ij2dh2xMm6DrYED06b1PIqKKfpWS3PIha67sC449 S3rLLAA9s4hvx2Ms8Bq77eK5jHXlxokCggsDY= 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=Gbqqqpi/ld7LejpxceT76DgIPCsFOhIVfhDvPHgIiYQ=; b=IyGY+0Sv5709mFDkGmBEnOHDEA5Eoe3uPPLm7kMX6h+PtpR8iP+5sJP8fvdeKY62iM z6Nf1ktbHxEIf95PUnF6/3whFBI1UwRN/elrf1F+Llsf4BbFP4CWhhi1vDQ10dPIWzDy gHk3c5TijYb1RJtvr2bJblM+sln21zTepy5exdw1xt3OqtEMjXsAZprIF5ybkwFDL8NW KQqWq0rCXHYXmFAU1/lIhSDqeJkECMEKzDMtw8oPuj2reINUvWnhrhc5fi8tzCvgu7uA F9OxUDqPCpuTXkioBjDOhfW/T34k4cKCAXUQLFjV3HNAQnsZNIWx9mCwEk6mr3idqwMe 1GaA== X-Gm-Message-State: AIVw111EB045AcU6PXxRZkW68iRJ5CfOYWv8mfAx7uKbj2ObLxO2xO8N qIIY9oTZx2n2lDCx X-Received: by 10.28.139.145 with SMTP id n139mr1547656wmd.53.1499846732107; Wed, 12 Jul 2017 01:05:32 -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.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 12 Jul 2017 01:05:31 -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 14/22] rtc: pcap: stop using rtc deprecated functions Date: Wed, 12 Jul 2017 10:04:34 +0200 Message-Id: <1499846682-14093-15-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. version 2: - fix compilation issues by using do_div() 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-pcap.c | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-pcap.c b/drivers/rtc/rtc-pcap.c index c443324..65aa6e2 100644 --- a/drivers/rtc/rtc-pcap.c +++ b/drivers/rtc/rtc-pcap.c @@ -46,7 +46,7 @@ static int pcap_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) struct platform_device *pdev = to_platform_device(dev); struct pcap_rtc *pcap_rtc = platform_get_drvdata(pdev); struct rtc_time *tm = &alrm->time; - unsigned long secs; + unsigned long long secs; u32 tod; /* time of day, seconds since midnight */ u32 days; /* days since 1/1/1970 */ @@ -56,7 +56,7 @@ static int pcap_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) ezx_pcap_read(pcap_rtc->pcap, PCAP_REG_RTC_DAYA, &days); secs += (days & PCAP_RTC_DAY_MASK) * SEC_PER_DAY; - rtc_time_to_tm(secs, tm); + rtc_time64_to_tm(secs, tm); return 0; } @@ -66,16 +66,14 @@ static int pcap_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) struct platform_device *pdev = to_platform_device(dev); struct pcap_rtc *pcap_rtc = platform_get_drvdata(pdev); struct rtc_time *tm = &alrm->time; - unsigned long secs; - u32 tod, days; + unsigned long long secs; + u32 tod; - rtc_tm_to_time(tm, &secs); + secs = rtc_tm_to_time64(tm); - tod = secs % SEC_PER_DAY; + tod = do_div(secs, SEC_PER_DAY); ezx_pcap_write(pcap_rtc->pcap, PCAP_REG_RTC_TODA, tod); - - days = secs / SEC_PER_DAY; - ezx_pcap_write(pcap_rtc->pcap, PCAP_REG_RTC_DAYA, days); + ezx_pcap_write(pcap_rtc->pcap, PCAP_REG_RTC_DAYA, secs); return 0; } @@ -84,7 +82,7 @@ static int pcap_rtc_read_time(struct device *dev, struct rtc_time *tm) { struct platform_device *pdev = to_platform_device(dev); struct pcap_rtc *pcap_rtc = platform_get_drvdata(pdev); - unsigned long secs; + unsigned long long secs; u32 tod, days; ezx_pcap_read(pcap_rtc->pcap, PCAP_REG_RTC_TOD, &tod); @@ -93,21 +91,19 @@ static int pcap_rtc_read_time(struct device *dev, struct rtc_time *tm) ezx_pcap_read(pcap_rtc->pcap, PCAP_REG_RTC_DAY, &days); secs += (days & PCAP_RTC_DAY_MASK) * SEC_PER_DAY; - rtc_time_to_tm(secs, tm); + rtc_time64_to_tm(secs, tm); return rtc_valid_tm(tm); } -static int pcap_rtc_set_mmss(struct device *dev, unsigned long secs) +static int pcap_rtc_set_mmss64(struct device *dev, time64_t secs) { struct platform_device *pdev = to_platform_device(dev); struct pcap_rtc *pcap_rtc = platform_get_drvdata(pdev); u32 tod, days; - tod = secs % SEC_PER_DAY; + days = div_s64_rem(secs, SEC_PER_DAY, &tod); ezx_pcap_write(pcap_rtc->pcap, PCAP_REG_RTC_TOD, tod); - - days = secs / SEC_PER_DAY; ezx_pcap_write(pcap_rtc->pcap, PCAP_REG_RTC_DAY, days); return 0; @@ -135,7 +131,7 @@ static int pcap_rtc_alarm_irq_enable(struct device *dev, unsigned int en) .read_time = pcap_rtc_read_time, .read_alarm = pcap_rtc_read_alarm, .set_alarm = pcap_rtc_set_alarm, - .set_mmss = pcap_rtc_set_mmss, + .set_mmss64 = pcap_rtc_set_mmss64, .alarm_irq_enable = pcap_rtc_alarm_irq_enable, }; From patchwork Wed Jul 12 08:04:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 107454 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp601463obm; Wed, 12 Jul 2017 01:06:01 -0700 (PDT) X-Received: by 10.84.143.129 with SMTP id 1mr661662plz.185.1499846761823; Wed, 12 Jul 2017 01:06:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499846761; cv=none; d=google.com; s=arc-20160816; b=jIiRV66Nx93Np9/JaJKyUgIu/O+8OG0xsaPSTUzHDQZLdJGaVu64MU8wZ9IxxgvZmo 2KdUQKuKPGDT1SvM7DP+3xsnVvk5CeA+kk7cvA28EbodsZt/MofDCYKFQ/CG83vINuC+ 8n+RgPDL2kgfHaoA6J03GiRFl4T1ua5gSRmk8p2ZBO9EuTkKbdYqGjFy9QtBHmZFw+gM qNXagWdV1mY+tJ3IEWLZTq77ywFKIbMDbao3u1TCY+8qM3is3NDFQHwustKztSA52aBZ +53yBhw9INxuBN8mDITT3fAFKz+Iz572HsrxgUDmpx4IrbfoFyV8yNAjIio0IuKMaLso Jo2w== 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=PkpBNtHW9s2hAcMDA2kDZOafTxLz6igq0gdWD3j/TSQ=; b=lz6+Vt26thfjsLBX3fIyko/YQHi0tE960Ehap5Jf++EKQhlpjxipKBcBgKfHw4kcqs HBui9t4gHFYthTfYRpuIDAt5FtRX9AgepGxiXIInI0zyzBzVFyKfW8w/r6L45rnGsMYU K1DRG/QeKOxAoPITpBfMSrUiwwrQy1kqZ7bmyK2Wjn4C/yYjWGpe9xyIkuuA0m4ycN7G k8LNujl+rB+WI7KDcmJml++puFFgKWyO7RZggUYLbKI6LKYcYkoGi84ou5xiNWZI0Ika hMiqy8xlGkPCutPuoSPG1SqaoGKTH01KNN7/NVBmQyBxJKOlV03dFhjp7LdLweBdVrln v4RQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=kljxM6dc; 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 e21si1435857pga.184.2017.07.12.01.06.01; Wed, 12 Jul 2017 01:06:01 -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=kljxM6dc; 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 S1757089AbdGLIFp (ORCPT + 25 others); Wed, 12 Jul 2017 04:05:45 -0400 Received: from mail-wr0-f171.google.com ([209.85.128.171]:34931 "EHLO mail-wr0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756967AbdGLIFe (ORCPT ); Wed, 12 Jul 2017 04:05:34 -0400 Received: by mail-wr0-f171.google.com with SMTP id k67so22372608wrc.2 for ; Wed, 12 Jul 2017 01:05:34 -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=PkpBNtHW9s2hAcMDA2kDZOafTxLz6igq0gdWD3j/TSQ=; b=kljxM6dcIi6YLB2S73ZIAamseKv4EV8lEEae0j5GVTeXJwPeJFQIbxEAraMqwxJCiu u38B0tvUcZcnUuSrzaftipNaPmeFZx7vnxwwA+woKHRggG0OEwZJzFgUKjg4fb9tDR4P SIzM6Ij4wL3InIUHz13G5uSOuTKs4VgKovB3A= 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=PkpBNtHW9s2hAcMDA2kDZOafTxLz6igq0gdWD3j/TSQ=; b=JzGKTj+Vi+4xaP1sclJfIKmuquRtsDyRWaLlhdjSiOzH2CyUD/hu3qPNyz9JUbPfER SueJAKNBCaey4OG4FizAUXZgWcuXiB8+ltEPwMJ2OqafxDqC6Wyq41H8pN+d45rhattK PRmFO6/biASuHkwdiynCR3qvzKbjr/bLmm4nhLMEJAsTnudqpM43dhuf1oT+X3CEyY/4 36h1mclnOEnKeUkYiSxhMOzgCs+GAdEX5ClttciNfHg/8zq6cdaclQsD7dOuwsn5FaIZ CBm7IDDIDiOWr5AzvcChxOroRDN7u/OVgGeWyIdNIKqw5MXilH2h4Qc6Kf7i9e8sx9xV Or+A== X-Gm-Message-State: AIVw112pkMk1BPTEc2jpen8FIe5KIut6MhNc3JIsiHImkkgiy0VC8JkR /9S3IyRRxGRc0EqX X-Received: by 10.28.64.196 with SMTP id n187mr1556089wma.94.1499846733676; Wed, 12 Jul 2017 01:05:33 -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.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 12 Jul 2017 01:05:33 -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 15/22] rtc: rs5c348: stop using rtc deprecated functions Date: Wed, 12 Jul 2017 10:04:35 +0200 Message-Id: <1499846682-14093-16-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-rs5c348.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-rs5c348.c b/drivers/rtc/rtc-rs5c348.c index 9a30698..f82c0bc 100644 --- a/drivers/rtc/rtc-rs5c348.c +++ b/drivers/rtc/rtc-rs5c348.c @@ -137,7 +137,7 @@ struct rs5c348_plat_data { if (rtc_valid_tm(tm) < 0) { dev_err(&spi->dev, "retrieved date/time is not valid.\n"); - rtc_time_to_tm(0, tm); + rtc_time64_to_tm(0, tm); } return 0; @@ -183,7 +183,7 @@ static int rs5c348_probe(struct spi_device *spi) dev_warn(&spi->dev, "voltage-low detected.\n"); if (ret & RS5C348_BIT_XSTP) dev_warn(&spi->dev, "oscillator-stop detected.\n"); - rtc_time_to_tm(0, &tm); /* 1970/1/1 */ + rtc_time64_to_tm(0, &tm); /* 1970/1/1 */ ret = rs5c348_rtc_set_time(&spi->dev, &tm); if (ret < 0) goto kfree_exit; From patchwork Wed Jul 12 08:04:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 107463 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp605554obm; Wed, 12 Jul 2017 01:10:52 -0700 (PDT) X-Received: by 10.84.135.101 with SMTP id 92mr2752356pli.56.1499847052412; Wed, 12 Jul 2017 01:10:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499847052; cv=none; d=google.com; s=arc-20160816; b=iiwIZKJKGFoLV1T5ORs5Of6oHUKG8IlupyhU/yaJlHsTxYxQOuqHG0TgYBzn/+ho4l n7IFrCDutoqsLxWEU+iHbMaQICRqN5LPE+vQsOjN+4L/tbn/zdOpPLcL49pSGliPGM+P +t4gxPVL8EpUcsFD1b+RTPQDntQJrmUgMVU0H+rT1HHIShDveLtletzrZ5ylid7CBrJx VJiXzQpqloIVnhVf5J/lUzhvuL5xjPlP23NI7VPvR/ZA/pT427pg9opL9T2pI/jtIrjn //Eo8koZdW4/laS9IB8mFuQtdQ/V4jKVDwOtC9iu8BN4MybVlXazXdrZwVITZhGYfZR5 WZdw== 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=wzFhvPIyqtc2AfxnVd+cc9LS4EyfKga8xmCqCbt7jEA=; b=WxQf1o19dlDLi4RuGymKSV/j5B2GxVfm0SKP0KdV9jTQv5CJ6OLWs6dOlLqPvbFtop JuGdnsfOtdYkqOXlJBSFCiyPhOc3hNnqVTpbtH430OlzSy6wP0vxbAZ8akMK7SDYc6D4 kIvslSzTMpZ1sazJgPkW29wytRgu4PD2AJQdQd3h+klHPXRtMb8GVSi7HPkQyES3B3j/ zyFB2YkwW4TBR8VsSM9+WcQKLkdpOT1MtJpMw9s4bJ0WI/JTfagTM5aA43pL18lwxrWm 8rxNEl1rWdUc+Vi5h8JgWHVsYfiZ78ypKmrhxcD2h1K8cg6PxCti50vkwTZ+NrG1tp20 QTpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=dLalJBRK; 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 v89si1409653pfj.370.2017.07.12.01.10.52; Wed, 12 Jul 2017 01:10:52 -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=dLalJBRK; 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 S933746AbdGLIK3 (ORCPT + 25 others); Wed, 12 Jul 2017 04:10:29 -0400 Received: from mail-wr0-f175.google.com ([209.85.128.175]:36760 "EHLO mail-wr0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757071AbdGLIFl (ORCPT ); Wed, 12 Jul 2017 04:05:41 -0400 Received: by mail-wr0-f175.google.com with SMTP id c11so22380195wrc.3 for ; Wed, 12 Jul 2017 01:05:36 -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=wzFhvPIyqtc2AfxnVd+cc9LS4EyfKga8xmCqCbt7jEA=; b=dLalJBRKD6xEw70Ox3Tr7QboV+VawrvOIk4+cg+s0lLaQdBw2HknG2ts1dwIXY8V+A nX5ymMPPCHLrjqftF+SNhWP+4RmVfXa3KsB+Mbq8GM/bPQyMoBcp6yM9TZxBGmuzAbAy dOBw2QJRUc5uNC9r29FCoenxd8QZGjDFe90hI= 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=wzFhvPIyqtc2AfxnVd+cc9LS4EyfKga8xmCqCbt7jEA=; b=ktBrexWpXlB4kMBcL+9frfexGQXsGNb7k0M/GoeyvlIdFrD8/wnupbiKjoF/oeWVw9 cpD1ikEisdiKt8juwEGBErbeT+hE+2QAABkgB/Em3axTA8el4KAlDuMZeewZBqslfpjb qMOuAp0muQxNWrIGwhmNloMm07VA5zq7DroMSdW/y3J1OPqcnQD1An4T1HOYIbC6omd3 R/8Xzl+XLDNj2plXCytkWIHw83pCpwaEffL0VzzJWTwbNsYxn37W9EWx4WR0bMw7l4HR 0/Klylk24tzaNTHB/sxXYaVxFQqePSfz4Plmb25jwju3c6tb/qJPUSIY1oa0QprJTyY/ iBeg== X-Gm-Message-State: AIVw111qqD0EJ02GJyJBUPo+OhZqAN8C3abXFn7DBYY0xfN629A6kGBW pl+k8FyFaurjz4bD X-Received: by 10.223.145.10 with SMTP id j10mr1928783wrj.172.1499846735285; Wed, 12 Jul 2017 01:05:35 -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.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 12 Jul 2017 01:05:34 -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 16/22] rtc: sh: stop using rtc deprecated functions Date: Wed, 12 Jul 2017 10:04:36 +0200 Message-Id: <1499846682-14093-17-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-sh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-sh.c b/drivers/rtc/rtc-sh.c index 6c2d398..f65da1e 100644 --- a/drivers/rtc/rtc-sh.c +++ b/drivers/rtc/rtc-sh.c @@ -694,7 +694,7 @@ static int __init sh_rtc_probe(struct platform_device *pdev) /* reset rtc to epoch 0 if time is invalid */ if (rtc_read_time(rtc->rtc_dev, &r) < 0) { - rtc_time_to_tm(0, &r); + rtc_time64_to_tm(0, &r); rtc_set_time(rtc->rtc_dev, &r); } From patchwork Wed Jul 12 08:04:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 107461 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp604476obm; Wed, 12 Jul 2017 01:09:38 -0700 (PDT) X-Received: by 10.99.140.7 with SMTP id m7mr2638768pgd.49.1499846978313; Wed, 12 Jul 2017 01:09:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499846978; cv=none; d=google.com; s=arc-20160816; b=Ycc4JZ3bd9ARELAF2GjgkudliVTupc9D9y0evrRnT08MA8Fpz0+MeKyNAJHzsPn9rN sdNywCGwnlPzx4SsKghiSH3uDqK3Qh7P9ZQ0tlNOKTEm9vh4iPhWxCN4+Zn8LBLwvveD EtEiR9Rj+87+hgUqE6BXWYyWBVi0sFKjkV8MCvsA9dsIRSsTaDxpIb9fEjwxIl6Nh0at qOaDCvsHajMclNzjbSwxkwbMIjOFCzMPMDKzyPDd26Qw8VX89MjeLa1D8n+Gp0pxpXjD EbJWPZsskfqMioYw9/RnMopXgzoOQlb1rIiuSM6dycHL9t3QhtwKkjzps67yRsynDWEH 6N1Q== 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=aBh/3iKDfE3lB5q51PrewX5zCw8dBpIQ6MbdXIEf5kg=; b=TRvL0nydfHtq+6V1JXzumHJoZHy1W59VMNDwcVlmzPQRaGK8+9uslekcyXRCxGo4Sa u1d4GKmaDChinMcSKbq6TlGive5r3Vs9fdNtdC8mheloUXpwnbeqF37pAd8dmed+kDck 3r+4lyzy81ZRJjndzVIjnMGMstVkNNbw460sKq4QWtSwe9UgOTBenr6ej510C8/OHCS/ 6uBDCK7GyvfwL8XYht8wJbXOu3FJOflHnOl+aYIvMZhcPqidn//wsgXkEMkz+frViWFE WNVX7RUlDCHDbtL4pM9hL/CTXZwBinVWsBdkDShwvbKZrHaI8h06H5bBIeQ8pH4aCKCf Lz1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=YzLjX0DI; 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 p15si1422755pli.605.2017.07.12.01.09.37; Wed, 12 Jul 2017 01:09:38 -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=YzLjX0DI; 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 S933700AbdGLIJ3 (ORCPT + 25 others); Wed, 12 Jul 2017 04:09:29 -0400 Received: from mail-wr0-f180.google.com ([209.85.128.180]:36787 "EHLO mail-wr0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756967AbdGLIFs (ORCPT ); Wed, 12 Jul 2017 04:05:48 -0400 Received: by mail-wr0-f180.google.com with SMTP id c11so22381372wrc.3 for ; Wed, 12 Jul 2017 01:05:43 -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=aBh/3iKDfE3lB5q51PrewX5zCw8dBpIQ6MbdXIEf5kg=; b=YzLjX0DIRKb6pQT3YhK4KtEfGVTZuqELzo8j+13jHgiNEs26Ldv9qnHzRvgF2w55BB pAYbaEeFMYt2LL7hEZr6mH8NOI1hd4/K7fTcS7YeqYvtcH5KMocBQQIj8O+txxjBZBXU SBWewNg5G+2cj3Wq4j/nqZANJuq/Di0Hfz334= 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=aBh/3iKDfE3lB5q51PrewX5zCw8dBpIQ6MbdXIEf5kg=; b=XML4RHO3VerjzEWOzQ0NtFFDYQID2v2d7Icb0tsvFteA2m/ZGomDJb7ia+VF7qgFlq eBT+/7DyOshX9XRkhthPH0BKwCMWzrkJy0RBv0nSEIS4lHOCso247lW+H40sI+v99+F+ ZsxntUBQ35643Ah2ltIIcGbxztXCZb4eek3ev2IfVoMSVeMjRkk+L+aROPrHZEPOFbbA I47416785yT/SINJoOq/KiHty7mnIDVclv0CBeYsTZ+oMnLWGQVXrvOZqPmnc/e/IY4C HqhxQvP4ltwrP9jI7uctDtGxqtXjg5zaPxGrRdg+DbzygA5rNsI+8Cqg37XeLi+H7GqQ x02A== X-Gm-Message-State: AIVw1129Y4EOhCHkdlxmnOuiGC1qSxX0cdy5+jaaIKzIRFk+zHv+xyAS VBe+kBFkwDcmhnmk X-Received: by 10.223.173.143 with SMTP id w15mr2168928wrc.113.1499846737279; Wed, 12 Jul 2017 01:05:37 -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.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 12 Jul 2017 01:05:36 -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 17/22] rtc: snvs: stop using rtc deprecated functions Date: Wed, 12 Jul 2017 10:04:37 +0200 Message-Id: <1499846682-14093-18-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-snvs.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-snvs.c b/drivers/rtc/rtc-snvs.c index d8ef9e0..774048e 100644 --- a/drivers/rtc/rtc-snvs.c +++ b/drivers/rtc/rtc-snvs.c @@ -121,9 +121,9 @@ static int snvs_rtc_enable(struct snvs_rtc_data *data, bool enable) static int snvs_rtc_read_time(struct device *dev, struct rtc_time *tm) { struct snvs_rtc_data *data = dev_get_drvdata(dev); - unsigned long time = rtc_read_lp_counter(data); + unsigned long long time = rtc_read_lp_counter(data); - rtc_time_to_tm(time, tm); + rtc_time64_to_tm(time, tm); return 0; } @@ -131,9 +131,9 @@ static int snvs_rtc_read_time(struct device *dev, struct rtc_time *tm) static int snvs_rtc_set_time(struct device *dev, struct rtc_time *tm) { struct snvs_rtc_data *data = dev_get_drvdata(dev); - unsigned long time; + unsigned long long time; - rtc_tm_to_time(tm, &time); + time = rtc_tm_to_time64(tm); /* Disable RTC first */ snvs_rtc_enable(data, false); @@ -154,7 +154,7 @@ static int snvs_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) u32 lptar, lpsr; regmap_read(data->regmap, data->offset + SNVS_LPTAR, &lptar); - rtc_time_to_tm(lptar, &alrm->time); + rtc_time64_to_tm((u64)lptar, &alrm->time); regmap_read(data->regmap, data->offset + SNVS_LPSR, &lpsr); alrm->pending = (lpsr & SNVS_LPSR_LPTA) ? 1 : 0; @@ -179,9 +179,9 @@ static int snvs_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) { struct snvs_rtc_data *data = dev_get_drvdata(dev); struct rtc_time *alrm_tm = &alrm->time; - unsigned long time; + unsigned long long time; - rtc_tm_to_time(alrm_tm, &time); + time = rtc_tm_to_time64(alrm_tm); regmap_update_bits(data->regmap, data->offset + SNVS_LPCR, SNVS_LPCR_LPTA_EN, 0); rtc_write_sync_lp(data); From patchwork Wed Jul 12 08:04:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 107459 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp603062obm; Wed, 12 Jul 2017 01:07:55 -0700 (PDT) X-Received: by 10.99.109.69 with SMTP id i66mr2585562pgc.187.1499846875278; Wed, 12 Jul 2017 01:07:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499846875; cv=none; d=google.com; s=arc-20160816; b=P5OHpnxbd58EXeL3dn0vsAD7MCYwvmE3WSusakYHpnA8BD10cXakxTxc9OX6kJ91f5 7YzM1Ebodi6bvgKS/cMNfWnXBvW8ssy3QnE2mXqqFYMhndk/tXGJuKMO5KcG8uN528k0 Gee/BfIt9EQw4AYsec+CHtPXfJuzf5a4MU1n0slAV2Ci+P0U7KyNrIer1aPHPRZ3vsGz 3Irhse1gzPOpMguTFYfxxIO11hxwTwBss/HGM4ZxuSf7wEACSbFUrwg/GmDNXGxqU6V3 NxI8hC59oMYPSP7LgCRCO963Trs1u07jG8LOKYgeNdcbzqet7ecbuhkcIfUWs4sPc7oZ 1sjw== 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=NA7WUoeTISGrobwDc6NzfTZVXtfmkzzFiRsU/agjCR4=; b=Wl624w7HcK8SQP1XZm+ganIRxJwdi07TKrRBS6HniTPXRA4BVW5d+PtaGi1NT1kxOk eCjd6iBe3quGiopxI9mIIHccqa4VwLHsPGoVQjcwwqhYf7gdJRdj8d00gMZbZe9e3ddW PbN8eD55Jmmx2qptYCW6jpy7lZh1l/pRJWvoqcSTPW2cfEaRJp9sXSrdlv6vG6LlFKvL rsEEhwWuxL1Zvy9JRTZ2oSQtbtJS5FafaImBs3tf/I5n7Wa4uM2e+CVeTn4iwP6jy40A U721GF2Ha8GMvDyp/Sjextf6fTATDq2OJfW9eTheUQibsGj6fI6rdHXunzRHHFts2txQ NQxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=W08VhBXP; 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 g21si1375728pfg.344.2017.07.12.01.07.54; Wed, 12 Jul 2017 01:07:55 -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=W08VhBXP; 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 S933418AbdGLIHq (ORCPT + 25 others); Wed, 12 Jul 2017 04:07:46 -0400 Received: from mail-wr0-f173.google.com ([209.85.128.173]:35021 "EHLO mail-wr0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757097AbdGLIFv (ORCPT ); Wed, 12 Jul 2017 04:05:51 -0400 Received: by mail-wr0-f173.google.com with SMTP id k67so22376538wrc.2 for ; Wed, 12 Jul 2017 01:05:51 -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=NA7WUoeTISGrobwDc6NzfTZVXtfmkzzFiRsU/agjCR4=; b=W08VhBXPIcPw3SPOqEB5OEr3Z1gEGcoviE3hhCgOlFXC457ZxXpQnr2RB1Mj46oIc4 1UHN2/08TjuySITv9CL2mCgF8PN74BFWccg+k+bEyVg6J3YiYoBe4ng4n7HD/aqS6VlE MdMgso8zLhz7Bv812dMfGCLDaqfPtFsi8fG6g= 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=NA7WUoeTISGrobwDc6NzfTZVXtfmkzzFiRsU/agjCR4=; b=By3Wnu8VGhiYafQ7L39UdKLt3giyB3JIdkovbYuuzH9RLYGrrBjUvGHTQ0vDWm1OIB 6wEgYxLTduINPF60+xs+oEKd2FSBxIrSDbJMLhW5PrJtDEBGSV5Gq/cRvwvdEtiFFw7/ iPsFVE1ymbt268D/FyMCgQKJh5mw8bRbJ6U/SwpGEJpEVZdnNttg1djxxh2n8T1Fc0lC 2/XMes67LJgrBo6MSiI41uOZD4iwafoGfRN9tliIllD4iFCVUzw6TLliA0su6GCUFlR3 Qv4sVRlUnm+rLTDx/4wFlXS/3hC6x5dXGCbRGLqOxoWFYIPRsXdMlTeg24XG5VJm8cW9 3v6A== X-Gm-Message-State: AIVw113A543y2M7f9Nornv3aq9KLrK8yTSBNCkEMn0hlRcYID0MFcd8n 9JOtsltxxATVUZXU X-Received: by 10.28.208.69 with SMTP id h66mr1551062wmg.66.1499846739348; Wed, 12 Jul 2017 01:05:39 -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.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 12 Jul 2017 01:05:38 -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 18/22] rtc: stk17ta8: stop using rtc deprecated functions Date: Wed, 12 Jul 2017 10:04:38 +0200 Message-Id: <1499846682-14093-19-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-stk17ta8.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-stk17ta8.c b/drivers/rtc/rtc-stk17ta8.c index a456cb6..5a0dca9 100644 --- a/drivers/rtc/rtc-stk17ta8.c +++ b/drivers/rtc/rtc-stk17ta8.c @@ -131,7 +131,7 @@ static int stk17ta8_rtc_read_time(struct device *dev, struct rtc_time *tm) if (rtc_valid_tm(tm) < 0) { dev_err(dev, "retrieved date/time is not valid.\n"); - rtc_time_to_tm(0, tm); + rtc_time64_to_tm(0, tm); } return 0; } From patchwork Wed Jul 12 08:04:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 107458 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp602189obm; Wed, 12 Jul 2017 01:06:55 -0700 (PDT) X-Received: by 10.84.217.217 with SMTP id d25mr2782444plj.145.1499846815903; Wed, 12 Jul 2017 01:06:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499846815; cv=none; d=google.com; s=arc-20160816; b=tKF4kRp0EHpfuN4DMUbtRjB2uf3b+R9ekG6/utVgj68paSUWb/rLjv3ItmEgIjWXCK n0jwwIc/XfRurXuJLPUpsBds2Kdez8LLaGIRts9DGR4xAzLYqKN8QRCmenRgUOIuyMVx WUDtEa7nRV1dxTlCHUBxo+OvcSmkcS+mXuFivu1bi+b9TcZdLtz+D2NdUOlF0PQHu3DG E4/MC/cKSCPAmycJVSNYmnmFmILxaxpbRKy7HEB5AHv/GFIoKyFBCLnKJLhXpZ5cWU1C aKdg43d/bjaH2XxNfFretCxvCNSxfXNJy+J3klXEtDLcjs9mGQcQevaV13UlUwIo7m3s UvnQ== 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=N5o21xjhsfYiOkiAvAc8xDLniSaY3M4Z9yubD+7kWIo=; b=IvbRe/8j5g3ZGOiXqYPaEeDu9ER758SwL0e336h0ewezfhIACG9yDv/a9hwfQaWe2i 15y6HFpgX8TLqGY8oZfInRYTVcV3sLH5h4aixTbrW3YxltEFgouiMPIc1Y9anKFVIc/x 7m2O0Njz0dftYwA/STyGSYu/L1thXJY9PoLQzjM7zlt/+gG85t9F49cO+DKAeAfikA28 UZzXlEQpWuUW+kmCDZuCcIEjSF3QMwcyuKhtm/ECpKQFI9rPjHRtwZCEcRZlH4t1iG5k oBdxShEeTfaMA4a5z4i+Ix6PY8A74iZl326OoOKxyHCXU1DMFez3oht+M6evLh6UQxhc Byng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=AKvhkiyA; 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 79si1468065pgf.431.2017.07.12.01.06.55; Wed, 12 Jul 2017 01:06:55 -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=AKvhkiyA; 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 S1757186AbdGLIGw (ORCPT + 25 others); Wed, 12 Jul 2017 04:06:52 -0400 Received: from mail-wr0-f175.google.com ([209.85.128.175]:33181 "EHLO mail-wr0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757105AbdGLIFw (ORCPT ); Wed, 12 Jul 2017 04:05:52 -0400 Received: by mail-wr0-f175.google.com with SMTP id r103so22517760wrb.0 for ; Wed, 12 Jul 2017 01:05:47 -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=N5o21xjhsfYiOkiAvAc8xDLniSaY3M4Z9yubD+7kWIo=; b=AKvhkiyAVxHnk5dXCEV/gD9uZJ62hwSILkoG8fCyOd2TRzhXpK7jxvP67gwpDMH6jZ RnHnD1U9vmr61JGuK52jL0bBwbfuFJPD4SB1j3Wi6dhd1BlSkssaBxJtqCmGo9UPTx2/ WwOF7PWPVuM0VgPdHTFODHqdW2/PbQKMXfXF4= 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=N5o21xjhsfYiOkiAvAc8xDLniSaY3M4Z9yubD+7kWIo=; b=DG02Xv4xiKEtER/i7w53KU/NsnmF+/4y+jZ6/NEr2Ar/zGGJ+n9+57Gh7TQERmrbHS qLYABUZzdcDNvnz1y5/DwkugMHQLvsQwJPJQ80UCjISutDEWG1H9Xnt05dfzljTpn+8Q dxnXTYQjRGqJ7FQtT35RAJT+57Ek9HjF06boikp3zi/g/RE1j4jfuTElrwnRiV/clR63 t8yzUIE12WcsPDqW17zhf3OmLtm37tJ4cO7uq2ZoJQ7QN4Amy/dKfG/GZkAA33U801UJ qEcP04h5L/Ji+X1FuV9CrB+tcw1Mnk2ffQ/ja/rLPHr4kRIu7dvdgQw1LfYxv0QZABJf A1PQ== X-Gm-Message-State: AIVw11178FAq274gW2Fe264V+BpkzKvHqGEqTxLSjTn3h4ojoAcYk5il 4vugJ3+hAbHiyBh2 X-Received: by 10.28.175.135 with SMTP id y129mr1549411wme.87.1499846741458; Wed, 12 Jul 2017 01:05:41 -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.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 12 Jul 2017 01:05:40 -0700 (PDT) From: Benjamin Gaignard To: benjamin.gaignard@linaro.org Cc: linaro-kernel@lists.linaro.org, Maxime Ripard , Chen-Yu Tsai , Alessandro Zummo , Alexandre Belloni , rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 19/22] rtc: sun6i: stop using rtc deprecated functions Date: Wed, 12 Jul 2017 10:04:39 +0200 Message-Id: <1499846682-14093-20-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: Maxime Ripard CC: Chen-Yu Tsai CC: Alessandro Zummo CC: Alexandre Belloni CC: rtc-linux@googlegroups.com CC: linux-kernel@vger.kernel.org CC: linux-arm-kernel@lists.infradead.org --- drivers/rtc/rtc-sun6i.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-sun6i.c b/drivers/rtc/rtc-sun6i.c index 39cbc12..9928f74 100644 --- a/drivers/rtc/rtc-sun6i.c +++ b/drivers/rtc/rtc-sun6i.c @@ -120,7 +120,7 @@ struct sun6i_rtc_dev { struct device *dev; void __iomem *base; int irq; - unsigned long alarm; + unsigned long long alarm; struct clk_hw hw; struct clk_hw *int_osc; @@ -342,7 +342,7 @@ static int sun6i_rtc_getalarm(struct device *dev, struct rtc_wkalrm *wkalrm) wkalrm->enabled = !!(alrm_en & SUN6I_ALRM_EN_CNT_EN); wkalrm->pending = !!(alrm_st & SUN6I_ALRM_EN_CNT_EN); - rtc_time_to_tm(chip->alarm, &wkalrm->time); + rtc_time64_to_tm(chip->alarm, &wkalrm->time); return 0; } @@ -352,9 +352,9 @@ static int sun6i_rtc_setalarm(struct device *dev, struct rtc_wkalrm *wkalrm) struct sun6i_rtc_dev *chip = dev_get_drvdata(dev); struct rtc_time *alrm_tm = &wkalrm->time; struct rtc_time tm_now; - unsigned long time_now = 0; - unsigned long time_set = 0; - unsigned long time_gap = 0; + unsigned long long time_now = 0; + unsigned long long time_set = 0; + unsigned long long time_gap = 0; int ret = 0; ret = sun6i_rtc_gettime(dev, &tm_now); @@ -363,8 +363,8 @@ static int sun6i_rtc_setalarm(struct device *dev, struct rtc_wkalrm *wkalrm) return -EINVAL; } - rtc_tm_to_time(alrm_tm, &time_set); - rtc_tm_to_time(&tm_now, &time_now); + time_set = rtc_tm_to_time64(alrm_tm); + time_now = rtc_tm_to_time64(&tm_now); if (time_set <= time_now) { dev_err(dev, "Date to set in the past\n"); return -EINVAL; From patchwork Wed Jul 12 08:04:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 107455 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp601700obm; Wed, 12 Jul 2017 01:06:19 -0700 (PDT) X-Received: by 10.98.82.87 with SMTP id g84mr54105730pfb.232.1499846779076; Wed, 12 Jul 2017 01:06:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499846779; cv=none; d=google.com; s=arc-20160816; b=xPAWqH6DhRAo6SSnr9eIlV7FCeCtQh7y48ZMJeNXSCI2qNRe98p0MPMO9sbLLglVFj IEYCnGRVxsZTMncoLMRQ8zigJS6c+tcF58gCsIJ67QJk/nynEdgQzsI3q4ch0TaIMk9o /4vA4eW88rnSB0z+0eWkaI+ktodvRpK1z1Fx36xI5O/L4kJUJUasbvw6Idad3iTLhn4p dA2FJWfvQ9nSA1sECXR5SCeKznS9sPEMU7iPDhEfg5c5rJkXaWGWsV6ct9FpVjw8H8cK By0OZbUQXn61KQg9aGZFwapJg393cBy1m9j5z5tLn2zjaFP+biUL9t5qkhDvorUgqBhG nnxw== 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=nXSvKHZC0uw7fNls4d/gmz382B6CA2g17RyXA6IvGFg=; b=FxWyxHwEn4jgU9+ZywIBPMteM/Zq7/AOyu1T/6aKvXGyvgZ+IVR9IOjSXT3JZEHw8w JoR9qJpnLNzOEIM6lx3NELvhJsGnMU6ZaMZG+W+giqMfieR8cdcwnHo3kZVYcJNOTMZ3 aOWDXATx2K66KI1oI/5ljXPM0ZzjkJgHWq1EX+QBbGh2MbmjwHJh950pJHXBXwB+kbJC D2vetF4ZPYVnBIjLn9zAf8efhpjoKvlQXbiclbvWOZ2KvOKp+T8TeJL8bAG11Bx6uAhq Lnoyv9DkC9IE3dejB/7V1c9ysXOAY0ttdozes6XvXSjPKwIQ8NaF4RQgYW2f4HAdAOgK DyAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=PfavbCMR; 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 v10si1482343plk.122.2017.07.12.01.06.18; Wed, 12 Jul 2017 01:06:19 -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=PfavbCMR; 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 S1757130AbdGLIF5 (ORCPT + 25 others); Wed, 12 Jul 2017 04:05:57 -0400 Received: from mail-wr0-f182.google.com ([209.85.128.182]:33204 "EHLO mail-wr0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757081AbdGLIFo (ORCPT ); Wed, 12 Jul 2017 04:05:44 -0400 Received: by mail-wr0-f182.google.com with SMTP id r103so22518707wrb.0 for ; Wed, 12 Jul 2017 01:05:43 -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=nXSvKHZC0uw7fNls4d/gmz382B6CA2g17RyXA6IvGFg=; b=PfavbCMRMa64KSLaYmdw+e1tX2FUr3WfFpaOFSx1Qz94sNdQATdtU3IRgGGD70wEAU tikfnMUu0yUFRVJey7yooa3Z8t/eLKvCKhYsvnG0hDWyCJpbtYzB05+2qY9RyuAuGYbG DkxZZvQMERFy7HWcCOr7QmRzEOFLsrWdmlNx0= 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=nXSvKHZC0uw7fNls4d/gmz382B6CA2g17RyXA6IvGFg=; b=OHBjeYft7yIU/xDjpfB9002+nFGEbmrxXlLUTZAiJ7Xh4NVgY8fGgMMGkA+0la6E70 qu/WlQaiImxHY3lnfdApQMph19uB3/DJaVJZIvfcPgwgg6VZr8OvRIkOx4IJkKFYsXLx 7RjePsXq1d2EkmU1ffCD2bYNMxa1W/NB915TMZ1nkCuXT7rmXgqslFDepnuXdDDVO//4 hlZEgFK63qk+oAdh7B5CMMUnCedgI5cvTIOWOtQci5idIiOboDBhlDHDrXVBatYuNYBz CfQEdoK68IG32LJmsrJnHq07kqWtd+qNJL0CVjoeaQh30x84sYGX3w6rm4Sys6U2Zvue 7Y/A== X-Gm-Message-State: AIVw111rQsfI3YJhHUJO77Ce0rnfIQo+RgAUoN3QqrqzEVkQj1VHIucF kl0zIhU4djlEFUGR X-Received: by 10.223.149.99 with SMTP id 90mr2253453wrs.46.1499846743153; Wed, 12 Jul 2017 01:05:43 -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.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 12 Jul 2017 01:05:42 -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 20/22] rtc: sysfs: stop using rtc deprecated functions Date: Wed, 12 Jul 2017 10:04:40 +0200 Message-Id: <1499846682-14093-21-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-sysfs.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-sysfs.c b/drivers/rtc/rtc-sysfs.c index e364550..8b97def 100644 --- a/drivers/rtc/rtc-sysfs.c +++ b/drivers/rtc/rtc-sysfs.c @@ -72,9 +72,10 @@ retval = rtc_read_time(to_rtc_device(dev), &tm); if (retval == 0) { - unsigned long time; - rtc_tm_to_time(&tm, &time); - retval = sprintf(buf, "%lu\n", time); + unsigned long long time; + + time = rtc_tm_to_time64(&tm); + retval = sprintf(buf, "%llu\n", time); } return retval; @@ -132,7 +133,7 @@ wakealarm_show(struct device *dev, struct device_attribute *attr, char *buf) { ssize_t retval; - unsigned long alarm; + unsigned long long alarm; struct rtc_wkalrm alm; /* Don't show disabled alarms. For uniformity, RTC alarms are @@ -145,8 +146,8 @@ */ retval = rtc_read_alarm(to_rtc_device(dev), &alm); if (retval == 0 && alm.enabled) { - rtc_tm_to_time(&alm.time, &alarm); - retval = sprintf(buf, "%lu\n", alarm); + alarm = rtc_tm_to_time64(&alm.time); + retval = sprintf(buf, "%llu\n", alarm); } return retval; @@ -157,8 +158,8 @@ const char *buf, size_t n) { ssize_t retval; - unsigned long now, alarm; - unsigned long push = 0; + unsigned long long now, alarm; + unsigned long long push = 0; struct rtc_wkalrm alm; struct rtc_device *rtc = to_rtc_device(dev); const char *buf_ptr; @@ -170,7 +171,7 @@ retval = rtc_read_time(rtc, &alm.time); if (retval < 0) return retval; - rtc_tm_to_time(&alm.time, &now); + now = rtc_tm_to_time64(&alm.time); buf_ptr = buf; if (*buf_ptr == '+') { @@ -181,7 +182,7 @@ } else adjust = 1; } - retval = kstrtoul(buf_ptr, 0, &alarm); + retval = kstrtoull(buf_ptr, 0, &alarm); if (retval) return retval; if (adjust) { @@ -197,7 +198,7 @@ return retval; if (alm.enabled) { if (push) { - rtc_tm_to_time(&alm.time, &push); + push = rtc_tm_to_time64(&alm.time); alarm += push; } else return -EBUSY; @@ -212,7 +213,7 @@ */ alarm = now + 300; } - rtc_time_to_tm(alarm, &alm.time); + rtc_time64_to_tm(alarm, &alm.time); retval = rtc_set_alarm(rtc, &alm); return (retval < 0) ? retval : n; From patchwork Wed Jul 12 08:04:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 107457 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp601950obm; Wed, 12 Jul 2017 01:06:34 -0700 (PDT) X-Received: by 10.84.224.206 with SMTP id k14mr2729266pln.72.1499846794694; Wed, 12 Jul 2017 01:06:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499846794; cv=none; d=google.com; s=arc-20160816; b=S6iaE4UeM2CbO501824UtQtdO8IQUTd3/xKZ7RMA7ssOAgjrLLLF+c3iN80ujBXGfG NnEZiRjKGgZx4DuEsvKI02vhZbc4afyDuxpbn4B4+5kmxcaHCIX+6/4OkSc4boenjeMH 222i9yx7lzHvcDGmm7+3errCTfk/AOQ3lpFH6ME6k0NF1gjrEMQZozSmgevD/f5aBqhZ AbcweFRJ8ck/dpcmAz9HRYAcHKXPM4yXgs2+GD2OkDA3tAs4daepvMqwCBUCzEeeXLmg RDOaO6BYvcUdpEr2QBoljJ8j3zOiMUrwZ6utCHh2F/oOwbeNLiui4im22K47JIa72ZD6 V3Tg== 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=iqQr83CJ1dqKj7bTHVC8gxIYGU/LCXCyQ9F13lG7xSU=; b=ARQa8GyhVDpcFuujn3ZNl72PCG/Y63NaeTduxe2y3XUlWXxcZTyTwfg1jR/j+GbmWy L+6OOhb5kUcgh+ZcKq3NyRn68UpxMUHQG0ANSU0Oh1HgBYM6cO2zWfqldbt5wJFhH72y PQjN7vbU1DawWWnU2Guc0JC2XtWJEfQh5yqZEVwpsOE5g/azwqw2JAHZhJpKZMZc6hQn zBPXBgyAr9yaNhuMsO/NEuAKkrkH/6Ayw4IPxlD6q30lMuZwptpq7CfKxNH6quCvGjUF qiKMjVJHeX6p0N30Ifaja25lwv6j9DoKRxq4dlxJgzP8iMALCstAxdvmu6jT5oRMF8z0 IopQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=CiRSfqqv; 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 79si1468065pgf.431.2017.07.12.01.06.34; Wed, 12 Jul 2017 01:06:34 -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=CiRSfqqv; 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 S1757115AbdGLIFx (ORCPT + 25 others); Wed, 12 Jul 2017 04:05:53 -0400 Received: from mail-wr0-f173.google.com ([209.85.128.173]:35079 "EHLO mail-wr0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757090AbdGLIFq (ORCPT ); Wed, 12 Jul 2017 04:05:46 -0400 Received: by mail-wr0-f173.google.com with SMTP id k67so22379018wrc.2 for ; Wed, 12 Jul 2017 01:05:45 -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=iqQr83CJ1dqKj7bTHVC8gxIYGU/LCXCyQ9F13lG7xSU=; b=CiRSfqqvX7LxMCnDTHOOkKbOvFPsK8ZIAgk7xYiuVPg7AR5QjroP5vfmZ1dWLLJQB/ /OG+nyNYv0xaduRdwV8xAl6Hshh2guhnjbKulySTaFYn7wbsRcN+9KcJfb1UrFH6p7tH UGFjaP2dQiuRwLxyzUfR/Ec1yHt1p/s2UFTiM= 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=iqQr83CJ1dqKj7bTHVC8gxIYGU/LCXCyQ9F13lG7xSU=; b=D7mnq/nqzWxRwRkney1FPcu5YqUVzX2QJ76r6rfeL8uw6lObbFCsdq4vdVII04Fxq6 fg02TnbSiGSyH8YFwKgLznaqtCAlZDGctt3mBd5rIriFObwr5XUIbN90qKpKdrb1lbsB XZ129dgDtD2XMGp0+p1/JGyddBkEFwuix/Hx2anuRhRWlqMiv+FoYpbxHaZz3ltJOWhl /Z6XRwIeqSUkOaMjGonkUEfPr0Vyk+wXz/GCWmybcBLXGwTJ3n6EYp60f5YZl6SOf+Hf 3ylrGqlbHHGiYiQr4hyGNkuLKPXdAkZJGGxKQl5oxX7jhUNVIp1EN3glnVFlPMDv63QL /idQ== X-Gm-Message-State: AIVw11147BSMSU528exqItvrFocQfRxFX9J3VGUWNB2isgMHXlUwiReD rGUPmcbektGFejiG4IWnOQ== X-Received: by 10.28.139.145 with SMTP id n139mr1548382wmd.53.1499846744789; Wed, 12 Jul 2017 01:05:44 -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.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 12 Jul 2017 01:05:44 -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 21/22] rtc: test: stop using rtc deprecated functions Date: Wed, 12 Jul 2017 10:04:41 +0200 Message-Id: <1499846682-14093-22-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. For the same reasons use set_mmss64 callback instead of set_mmss Since only set_mmss64 be will used remove module parameter. 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-test.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-test.c b/drivers/rtc/rtc-test.c index 3a2da4c..6a460e3 100644 --- a/drivers/rtc/rtc-test.c +++ b/drivers/rtc/rtc-test.c @@ -13,10 +13,6 @@ #include #include -static int test_mmss64; -module_param(test_mmss64, int, 0644); -MODULE_PARM_DESC(test_mmss64, "Test struct rtc_class_ops.set_mmss64()."); - static struct platform_device *test0 = NULL, *test1 = NULL; static int test_rtc_read_alarm(struct device *dev, @@ -44,12 +40,6 @@ static int test_rtc_set_mmss64(struct device *dev, time64_t secs) return 0; } -static int test_rtc_set_mmss(struct device *dev, unsigned long secs) -{ - dev_info(dev, "%s, secs = %lu\n", __func__, secs); - return 0; -} - static int test_rtc_proc(struct device *dev, struct seq_file *seq) { struct platform_device *plat_dev = to_platform_device(dev); @@ -70,7 +60,7 @@ static int test_rtc_alarm_irq_enable(struct device *dev, unsigned int enable) .read_time = test_rtc_read_time, .read_alarm = test_rtc_read_alarm, .set_alarm = test_rtc_set_alarm, - .set_mmss = test_rtc_set_mmss, + .set_mmss64 = test_rtc_set_mmss64, .alarm_irq_enable = test_rtc_alarm_irq_enable, }; @@ -111,11 +101,6 @@ static int test_probe(struct platform_device *plat_dev) int err; struct rtc_device *rtc; - if (test_mmss64) { - test_rtc_ops.set_mmss64 = test_rtc_set_mmss64; - test_rtc_ops.set_mmss = NULL; - } - rtc = devm_rtc_device_register(&plat_dev->dev, "test", &test_rtc_ops, THIS_MODULE); if (IS_ERR(rtc)) {