From patchwork Tue Jun 20 09:35:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 105943 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1274615qgd; Tue, 20 Jun 2017 02:37:22 -0700 (PDT) X-Received: by 10.98.72.198 with SMTP id q67mr28714867pfi.23.1497951441965; Tue, 20 Jun 2017 02:37:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497951441; cv=none; d=google.com; s=arc-20160816; b=o/pyEBjdzmY2CFA1LbfbQvLnBwtfCrlKq7DSB+MxcYb3WqYERxsMFpoG4pcPDQufkc 5g8+ogysPEzhUsNSFrVly8KVjzqgZTz5gOPJ1QH8C7glsvfSvQ01mrqGhrzrd9GmOYie TQffnXiacjM+rgwFjBNBX042/D0Jk96iHzrEnuPYpVh0t8hBjwkKCmDeuAqcKjAHXZ3I d0PhiwRf7dH1zlDvf2v7/2Il4unYX1f2KFQWaGOd5jx+GA1oSbqoPCoZcrbu/kOIoG7y bT+tzeZSHwk4SxCKnAoQ+c1q0pJSPd+fCnKz7nOGmS6/1vgDnuazRAGxY8z64dIMKnRM swtQ== 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=XXuG4PiAg+3rwFzypppHFdeZ1Ueb1qIMtTtY9tPAwel6Riq34jSx+Ms95yxq2vAyPj Dhe/0taJiDtbQwvja0loRA4THLbzteL2osmgVdF++yES9bwkmo+aAd9nK5T5beHP3BbS 0rpwqTv8WxLRpmBx5A3G4R2viZupWQ77A1Eukjbwmzj6kmc4db9QwoVb2OzzQus78RcT ZU8Et5TIDAs4+KRplgkkfmIaegeOTFD4aJlEp0rdL1WF2AIgfYbg4dA70CikoF/r3PiL twtbWI8DdZkt+B51YdNYZmpEXshRyqPHM820UHHFKlgCleYfYLrWaAAjKbM5hs5IS9IG JVRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=br2Z5HOI; 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 e22si11613529plj.251.2017.06.20.02.37.21; Tue, 20 Jun 2017 02:37:21 -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=br2Z5HOI; 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 S1752646AbdFTJhG (ORCPT + 25 others); Tue, 20 Jun 2017 05:37:06 -0400 Received: from mail-wm0-f43.google.com ([74.125.82.43]:37395 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752227AbdFTJhA (ORCPT ); Tue, 20 Jun 2017 05:37:00 -0400 Received: by mail-wm0-f43.google.com with SMTP id d73so14606956wma.0 for ; Tue, 20 Jun 2017 02:36:59 -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=br2Z5HOI35ATnFiedgVHD95YuXVd67gvbapiV2o9wSCauM44HBTRq4JudB4EZ69EBC UlZLaMQWLXczKt8yeU5SxhZICZAK0qtv7ULLEm4qsauFkBjE+P0XypE9fAtBg3EEn5X3 XW8M16THN24O0bD7xVkuqlmM5GrUfWK2EGxL8= 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=qaJ+iwgXg+bEx5PIYz2T747AnocV4adjS5LsSK5uLqOOmQ5vPrp9UVWLdAoV7bpqdi SC2G53vd+1PHYjHo9FoIcOIGXffP7LAjntfuiqRpK+d2PhEFNBTo47oUeE2AWMwZ6mkG h58QG/eXTX70FrKIeXDitJdZmC/0XHUC9OWrUpR52Jbmp277/iJHpCDaOVK7tBBXkP0r 5UqK+p+hbcb7E9vU5g0r/qkoIhPoVhZuo4Mcd2B7/Xb6J5eI/LCbaSk/S9n9vogqNHVH eEHH5FGkYbFmy6M6u5GNW3VP/DWsc1rVVK1p4iFpNaVqidQB45OIGe3GM7DAKISvHhv9 HdAA== X-Gm-Message-State: AKS2vOwqtji5KWMmT1oYiHZdDNVYJk2FgEdF4ylk2whRogi8xSv5cyuX 3eo5gNNRsor6aE/s X-Received: by 10.28.197.195 with SMTP id v186mr2086360wmf.13.1497951418891; Tue, 20 Jun 2017 02:36:58 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.36.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:36:58 -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 01/51] x86: rtc: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:09 +0200 Message-Id: <1497951359-13334-2-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. Signed-off-by: Benjamin Gaignard CC: 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 Tue Jun 20 09:35:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 105993 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1282778qgd; Tue, 20 Jun 2017 03:02:09 -0700 (PDT) X-Received: by 10.101.86.11 with SMTP id l11mr30007279pgs.202.1497952929201; Tue, 20 Jun 2017 03:02:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497952929; cv=none; d=google.com; s=arc-20160816; b=MQAStaH2pdRSgMvP/bZMRtdM8JPWRODTw/Eg2twc3Z5mMEJ73pGM+ss9l/wflcbdQ6 4DJTWlbS3fhjYnUCI3/ZXFlv380FQqv7lVAo57bZ6WkpQm3kNhM8jvg+6+L3eMa/aU7N hQFhivnIVl21mW3u5M4A4qDe4pqONeU/mDistJ7THmCbyuNGWEMCq+YUQWVRPF+bBLm6 SoPsqjAS07VhSGlYMc5Rbe1UniWh9XphOciVjV6e/5iS4fvwnm3KgIOgQS5nsQSnpRhO j4iIQkRderpLmPp+AOgCleP2+/aC7qtMbQioCcy77OUzkkLQlqEvMEzQ8k2tI+qjAP6A EXRA== 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=UyT1iYkU0g62h909H46N2vYy5Bt5hRQHmcGaYcR92DMJ0pAOjsR+9qKPn3qWlN+1A4 b7jGvYywuQeK8tpGAFANjdihSA66oed+fXPmYZYla/U3sDulyB4SKqW0Two5FW2e41EI 3tgmp6e07pk6RFE7+ACAouA4/9yq/MaqnrYUCcqrUmZCIRFfmo3qYoigCqH/+6Svrudm 8g+mDbWrYcdaKUO2iWQYNu6QFOpFvbN6uInnNz7b/6SByrKg/V/m9sNumJd9UEsjhkKc P2kktw+U4s3nyn1srjf5mJowQvsc6Mr8/qmZlHf6+ql44KHARYx54cjmPDb/ANpLwxNX 2dxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=k2XqjD+J; 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 m1si11608803pld.361.2017.06.20.03.02.08; Tue, 20 Jun 2017 03:02:09 -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=k2XqjD+J; 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 S1752227AbdFTKB7 (ORCPT + 25 others); Tue, 20 Jun 2017 06:01:59 -0400 Received: from mail-wm0-f54.google.com ([74.125.82.54]:38183 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752230AbdFTJhB (ORCPT ); Tue, 20 Jun 2017 05:37:01 -0400 Received: by mail-wm0-f54.google.com with SMTP id u195so14549186wmd.1 for ; Tue, 20 Jun 2017 02:37:01 -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=k2XqjD+JnbbG9NQMAOMwqufjFFc6KhoqztEnkMbTlejwEFrvnI0FgMz6t5ofXw8Apz bx18G0gD5pi0O4k0i0FyuJvottlGkVeTSxNlkCWWlk8Vtzu/hGgJN9JNFpLTh+ULFAdJ dQbYIUNjo2pl8+nq77/AARrH71Vc7vlZR/GNc= 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=dB+G42lIbHiOfPijbJFL9foEnry0JkaEREhxQRVffLLtunu7S/cBMRg1nglO0Eu5yN WsaYMA9r5lWF9i781WNP72WNdKdeXYtbBYJ2+GGpSZJS/YyRvS3F8J7cerF6vF3cbxOJ VDXp9Qani+OUXVhuNYMXIw0XY4LHHYsrbsJGmcPZ8yGRrStYEpPE3bEHXyQFRiwkPw/y CCksiP/6buIOk013LNWg60PXCyWA/ia+inEKg1zBEkTIfTAMNp8RCUcQgupytFbBIhJd 3fKLbiwKPDD3PIHd3FNQjNasbFhpuR/YaKdVHUIJC2VACCyKAiTN2U6nrdkfamuDFdh2 qgmw== X-Gm-Message-State: AKS2vOzED+funydDhyuNjPi2c9TPdbIh+aQAZMT0+wscoRE9Nmj4zYky 8meIjV+GRtcAcSoM X-Received: by 10.28.45.5 with SMTP id t5mr2139528wmt.50.1497951420525; Tue, 20 Jun 2017 02:37:00 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.36.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:37:00 -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 02/51] x86: intel-mid: vrtc: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:10 +0200 Message-Id: <1497951359-13334-3-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. Signed-off-by: Benjamin Gaignard CC: 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 Tue Jun 20 09:35:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 105992 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1282400qgd; Tue, 20 Jun 2017 03:01:27 -0700 (PDT) X-Received: by 10.99.117.89 with SMTP id f25mr12454881pgn.5.1497952887390; Tue, 20 Jun 2017 03:01:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497952887; cv=none; d=google.com; s=arc-20160816; b=fCpVYD5Q+Qb9KMxlyw0tS/1nDuV/G04kWTAtPp3cXxz9vIt05CFcfvQUOrAq0c9TvG wGoY75vT8iX9IoDFuY4chHjflg/v3fnyVXJIlKQZClaId2V8A68ZYC6OZbo4p1Zs2AUz TlG6qlopmfLo7nmusGLjO7/2mEPRYkwh6VEXVeFLqJFRHQV6ziPQ1nwXjdBTZsnHmAxv 2mfG8ZP757TF0VLaN85crfBrpg8corDz9hbquwerkAng+PF/0zIFG09Gpls4jXMjoV+4 8SOXVrQ1qeT93jqT3tMuKmkifyWD1HHU3fB45/15wTQ+TA/kE2ew86TKubtpoHR8XfJD 7uvA== 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=L2bU/R+42AC+hh1K2Uobp6uzFqKTg2P5oASEJNbbBGeIPAf22IU55oKSgvCZ/VM5p/ 5AD3DsyqiYAPmO+YN888UVxMarzZPCWwFyXxfATK0YOT0TvjOleA1cYfarPLQVfC4Toz opSRlx5EwE1hOBPyVFJk/5QRyjrJ3ZhUi5iG8aFypwaY121p54t7U9P2liL93EtqUW3i tDBnq75qe4y6dcimhp/gQDKsjCXSb3PLlX9iQtx+YLbPIKlE7uGYac9ZUEUxoAL4zCUj W4RnQeqZhs1Beh0PeB9+6QNinaufAn0FIp/Kd2LLK9Je31AUhp2/jNXDI/k6dtjBzt9g VRFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=QcXovNAj; 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 g13si11911022pln.618.2017.06.20.03.01.26; Tue, 20 Jun 2017 03:01:27 -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=QcXovNAj; 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 S1752362AbdFTKBD (ORCPT + 25 others); Tue, 20 Jun 2017 06:01:03 -0400 Received: from mail-wm0-f44.google.com ([74.125.82.44]:37434 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752586AbdFTJhE (ORCPT ); Tue, 20 Jun 2017 05:37:04 -0400 Received: by mail-wm0-f44.google.com with SMTP id d73so14608516wma.0 for ; Tue, 20 Jun 2017 02:37:03 -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=QcXovNAjjLK5u+CE5l+O53AYesGdeWIrTuwh0csD2XOjNbqYNEDqVSngjCIWGS1hJ4 D8/LCGf4/DGoq63rhORER483QdEmCqElk3PqRSLZ67TYtx6DkQQ1J8Zxg2R3rfW8mIKN Zer8VI2gTE/oMiWpFYlt7DjeWX3gbJ+1Lv4r8= 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=DsAVbyQNzMcyckVIRFYP3pfdX+4OaOM/Ec3rwj/fKNoM5kiRNYwC1/F+ch3N1aUdEH UDGb6OKTRpVOtqgf8xObZQFOiFKPXSUQXGYdS3PHw1acqM5HLY6BJvLaqwfx2vmxWqKH j6R5IFv6Rp4PvFCbwcjdyw2xPOIhvyeEIbWpvE0oFPhC+fIkSzvHX80bQKZnm28zMmfK /HrWt1oSohl3ocKn9atbbeKKNN9dJTckvmtL52Y1pfb66AcK/9CPGPjaWZJZjKZWb5lJ IlW5/n/Umv2y/Mg800IboKrEEmZWHOqvFFcmZL6+i1CrPW6FwgsW+kMLL4NgX3PfW2Xn 6+UA== X-Gm-Message-State: AKS2vOxolFDPnVGfm/OQtZ9KenRHz84VHcQkkyM6q0YPaqvgVq+NtEN0 mXyQOKxmaO51k1Zr X-Received: by 10.28.208.207 with SMTP id h198mr2043704wmg.40.1497951422622; Tue, 20 Jun 2017 02:37:02 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.37.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:37:02 -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 03/51] net: broadcom: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:11 +0200 Message-Id: <1497951359-13334-4-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. Signed-off-by: Benjamin Gaignard CC: 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 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 Tue Jun 20 09:35:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 105944 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1274621qgd; Tue, 20 Jun 2017 02:37:22 -0700 (PDT) X-Received: by 10.98.31.215 with SMTP id l84mr29746154pfj.179.1497951442382; Tue, 20 Jun 2017 02:37:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497951442; cv=none; d=google.com; s=arc-20160816; b=seo4g9nCoumJ1PlhAcxVVPhEp231qKaVJGiRnxMYHjuhobuEiecSuaa/TekDnuZCTg ZZwY7HnAsDVdIxnpOePs5DzKB7jnjXsRaLz2iI0zMp5cMv7MvSfPBfl4GE68tML/O1XV Qjxnp8ePT6gKRriSkJc14qPAHsSqhMTaSCVEf63HclFFM2euVM4PV8CSY61vMflSM/DI Ac8SoDZAvQCp1DGjWXpsQIxsaXtgcj7VPBkMIGXkX5wTX7lwAFdlRpHAtneyJoUXkYzz EncLuNfcoD2gZQyJluJO6B9vzZ+kp20pmbOOCmAG6oF+0ItDHxsv/vUhT+RrzZhLsxi4 baQA== 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=sSqHxla2fyZS6kmmrek5gFxN2ricbQ0MfwlP3DmpAlk=; b=mONF8GJk+AtyA4bP+G506a0SoFA5MuVhDncAQU2oo405jAs5VWgYH/OziZG9XaFcN6 tnMkfaVMiXXO99h7REO86jW6XbJh+YglGtQnRkh2GzlXgmwoscPBcmU7Fdmuy6kJIFDA bNXXGKFyUkBmRH4VmDglLQaxIKuSixh/ds5nHLygo6YoyX40dUdy4H5Pu13gQHtxQ13g mKIiYCyVZjpzAS8R0fQ+SI5cjhCg0Sdd4j+NfucmgASVhaSz7wMKEyAZNZakYWnqabAu o6FSPaQWafwyd9Hab+bDQYl/CSDGTHMiqTFSUFcS5O9IU/BtdmNGJcjB4E7OJGrY5TWO I5kQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=cReZ9NAL; 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 e22si11613529plj.251.2017.06.20.02.37.22; Tue, 20 Jun 2017 02:37:22 -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=cReZ9NAL; 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 S1752691AbdFTJhK (ORCPT + 25 others); Tue, 20 Jun 2017 05:37:10 -0400 Received: from mail-wm0-f44.google.com ([74.125.82.44]:33010 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752085AbdFTJhG (ORCPT ); Tue, 20 Jun 2017 05:37:06 -0400 Received: by mail-wm0-f44.google.com with SMTP id u185so5609083wmd.0 for ; Tue, 20 Jun 2017 02:37:05 -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=sSqHxla2fyZS6kmmrek5gFxN2ricbQ0MfwlP3DmpAlk=; b=cReZ9NALqLToWTRPxs6Q25/p+4en5teL3ChX3uvUVJpIkQD8f05HVSwN7VpFhJxEIE 4AH+HXoOCPJUHxRQownk1Ihm8RQRFmnPdaV2vsaiyPqGlWw9BZvQRc4GtXsqD7K8S5f3 N415qpSV1f5fM7fnUmG7pJ5ZVRXF3+OXr6ZTA= 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=sSqHxla2fyZS6kmmrek5gFxN2ricbQ0MfwlP3DmpAlk=; b=PfE8SIKeAz8h1pAC3BpN9lB0WTEKXSkTkjcHoDd/h0L8kQfvp4KiCV6CtdvYpvGQG5 HrmWb0MH2e/3WYICOvkb15LwCxkHp6WP3KARo4v9Dc0Upo0QkrG09xBmYvGuvLiCHx13 wJXGnfXjFOEFhfuPnNM0pJvHep10rFPQizCSe19W7XuY+iM5F9kuOkY0gQFlLTXYdsQ7 DkEkml7F2wMHooRJ7TETeJsNtiuO9E2Xjoc0fPv/9nW7jo5iiLkYeAZprVFeb+l58JNG lptDpdhIC2kGU6zlIsk9l7F4diGOAHnMm6Ejs56tgYSgsvxs2MgTBtlMgnyLh8QPSBp4 BXXg== X-Gm-Message-State: AKS2vOweMmGddvQp3ia0JEnK88wxUjlZe/ujY/M0v0Ed+SKU5tH4gzm3 S+CgdjeqHPnwOnvF X-Received: by 10.28.229.6 with SMTP id c6mr1940184wmh.49.1497951425026; Tue, 20 Jun 2017 02:37:05 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.37.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:37:04 -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 04/51] rtc: 88pm80x: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:12 +0200 Message-Id: <1497951359-13334-5-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. Signed-off-by: Benjamin Gaignard CC: Alessandro Zummo CC: Alexandre Belloni CC: rtc-linux@googlegroups.com CC: linux-kernel@vger.kernel.org --- drivers/rtc/rtc-88pm80x.c | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-88pm80x.c b/drivers/rtc/rtc-88pm80x.c index 466bf7f..1898e9b 100644 --- a/drivers/rtc/rtc-88pm80x.c +++ b/drivers/rtc/rtc-88pm80x.c @@ -90,8 +90,8 @@ static int pm80x_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled) static void rtc_next_alarm_time(struct rtc_time *next, struct rtc_time *now, struct rtc_time *alrm) { - unsigned long next_time; - unsigned long now_time; + unsigned long long next_time; + unsigned long long now_time; next->tm_year = now->tm_year; next->tm_mon = now->tm_mon; @@ -100,13 +100,13 @@ static void rtc_next_alarm_time(struct rtc_time *next, struct rtc_time *now, next->tm_min = alrm->tm_min; next->tm_sec = alrm->tm_sec; - rtc_tm_to_time(now, &now_time); - rtc_tm_to_time(next, &next_time); + now_time = rtc_tm_to_time64(now); + next_time = rtc_tm_to_time64(next); if (next_time < now_time) { /* Advance one day */ next_time += 60 * 60 * 24; - rtc_time_to_tm(next_time, next); + rtc_time64_to_tm(next_time, next); } } @@ -114,7 +114,7 @@ static int pm80x_rtc_read_time(struct device *dev, struct rtc_time *tm) { struct pm80x_rtc_info *info = dev_get_drvdata(dev); unsigned char buf[4]; - unsigned long ticks, base, data; + unsigned long long ticks, base, data; regmap_raw_read(info->map, PM800_RTC_EXPIRE2_1, buf, 4); base = (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0]; dev_dbg(info->dev, "%x-%x-%x-%x\n", buf[0], buf[1], buf[2], buf[3]); @@ -123,9 +123,9 @@ static int pm80x_rtc_read_time(struct device *dev, struct rtc_time *tm) regmap_raw_read(info->map, PM800_RTC_COUNTER1, buf, 4); data = (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0]; ticks = base + data; - dev_dbg(info->dev, "get base:0x%lx, RO count:0x%lx, ticks:0x%lx\n", + dev_dbg(info->dev, "get base:0x%llx, RO count:0x%llx, ticks:0x%llx\n", base, data, ticks); - rtc_time_to_tm(ticks, tm); + rtc_time64_to_tm(ticks, tm); return 0; } @@ -133,20 +133,20 @@ static int pm80x_rtc_set_time(struct device *dev, struct rtc_time *tm) { struct pm80x_rtc_info *info = dev_get_drvdata(dev); unsigned char buf[4]; - unsigned long ticks, base, data; + unsigned long long ticks, base, data; if ((tm->tm_year < 70) || (tm->tm_year > 138)) { dev_dbg(info->dev, "Set time %d out of range. Please set time between 1970 to 2038.\n", 1900 + tm->tm_year); return -EINVAL; } - rtc_tm_to_time(tm, &ticks); + ticks = rtc_tm_to_time64(tm); /* load 32-bit read-only counter */ regmap_raw_read(info->map, PM800_RTC_COUNTER1, buf, 4); data = (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0]; base = ticks - data; - dev_dbg(info->dev, "set base:0x%lx, RO count:0x%lx, ticks:0x%lx\n", + dev_dbg(info->dev, "set base:0x%llx, RO count:0x%llx, ticks:0x%llx\n", base, data, ticks); buf[0] = base & 0xFF; buf[1] = (base >> 8) & 0xFF; @@ -161,7 +161,7 @@ static int pm80x_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) { struct pm80x_rtc_info *info = dev_get_drvdata(dev); unsigned char buf[4]; - unsigned long ticks, base, data; + unsigned long long ticks, base, data; int ret; regmap_raw_read(info->map, PM800_RTC_EXPIRE2_1, buf, 4); @@ -171,10 +171,10 @@ static int pm80x_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) regmap_raw_read(info->map, PM800_RTC_EXPIRE1_1, buf, 4); data = (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0]; ticks = base + data; - dev_dbg(info->dev, "get base:0x%lx, RO count:0x%lx, ticks:0x%lx\n", + dev_dbg(info->dev, "get base:0x%llx, RO count:0x%llx, ticks:0x%llx\n", base, data, ticks); - rtc_time_to_tm(ticks, &alrm->time); + rtc_time64_to_tm(ticks, &alrm->time); regmap_read(info->map, PM800_RTC_CONTROL, &ret); alrm->enabled = (ret & PM800_ALARM1_EN) ? 1 : 0; alrm->pending = (ret & (PM800_ALARM | PM800_ALARM_WAKEUP)) ? 1 : 0; @@ -185,7 +185,7 @@ static int pm80x_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) { struct pm80x_rtc_info *info = dev_get_drvdata(dev); struct rtc_time now_tm, alarm_tm; - unsigned long ticks, base, data; + unsigned long long ticks, base, data; unsigned char buf[4]; int mask; @@ -199,15 +199,15 @@ static int pm80x_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) regmap_raw_read(info->map, PM800_RTC_COUNTER1, buf, 4); data = (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0]; ticks = base + data; - dev_dbg(info->dev, "get base:0x%lx, RO count:0x%lx, ticks:0x%lx\n", + dev_dbg(info->dev, "get base:0x%llx, RO count:0x%llx, ticks:0x%llx\n", base, data, ticks); - rtc_time_to_tm(ticks, &now_tm); - dev_dbg(info->dev, "%s, now time : %lu\n", __func__, ticks); + rtc_time64_to_tm(ticks, &now_tm); + dev_dbg(info->dev, "%s, now time : %llu\n", __func__, ticks); rtc_next_alarm_time(&alarm_tm, &now_tm, &alrm->time); /* get new ticks for alarm in 24 hours */ - rtc_tm_to_time(&alarm_tm, &ticks); - dev_dbg(info->dev, "%s, alarm time: %lu\n", __func__, ticks); + ticks = rtc_tm_to_time64(&alarm_tm); + dev_dbg(info->dev, "%s, alarm time: %llu\n", __func__, ticks); data = ticks - base; buf[0] = data & 0xff; @@ -255,7 +255,7 @@ static int pm80x_rtc_probe(struct platform_device *pdev) struct pm80x_rtc_info *info; struct device_node *node = pdev->dev.of_node; struct rtc_time tm; - unsigned long ticks = 0; + unsigned long long ticks = 0; int ret; if (!pdata && !node) { @@ -320,7 +320,7 @@ static int pm80x_rtc_probe(struct platform_device *pdev) goto out_rtc; } } - rtc_tm_to_time(&tm, &ticks); + ticks = rtc_tm_to_time64(&tm); info->rtc_dev = devm_rtc_device_register(&pdev->dev, "88pm80x-rtc", &pm80x_rtc_ops, THIS_MODULE); From patchwork Tue Jun 20 09:35:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 105991 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1281398qgd; Tue, 20 Jun 2017 02:59:07 -0700 (PDT) X-Received: by 10.98.7.204 with SMTP id 73mr29941076pfh.175.1497952747257; Tue, 20 Jun 2017 02:59:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497952747; cv=none; d=google.com; s=arc-20160816; b=QquR8g7wfMaf0MWRPuw1uTzmJQTiMvsTs2u0COrF5HvkyOPt0WmF7LRX5BgRZWs7Ke UAEtIugbg8LuR+4OXM8u8t4uRiCObJukx/I7kUKLrYOa+1ulI5Shtd1uB1XBS5DhNiij lRYqvzevJ7XPGSdwfNDMHBXl76nvBmCiuhj8jhvZm6v9FQRWTm4DDNLXyJ2xbCNSLauz DQYL+cPEX0m7a8WvKdWtglhmg5dDu5z/TOSKjwxqoSuF2fGSkjwmhOVXHsVHlBVs2a/m Udc9sRjgM2Ou1kA0BC3F6B++/p61TRJiKYItdTp3neDDgEZPmP37F1ujxpVzvgzm/QKz DREQ== 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=wGNV1XIwJ451jYKQCJDCwamKxUc85B6gwDdg3z1bx/c=; b=TnrXpQjV1AdacOqKFiRNHZbEbWWupIRN6u+U5XASO2cX3Mum3pEM5LEe1e9S4b/upV AEvmLN+6icr6zQcJLVagL554JjKp5U0e5nxjiBNbStl0w5PSRtZWzArlHrdz1OFtO/EM jTFOgRyLJcDew+othL7CdhnehxqCh6zxIRWLppjMzLi4L7241ZH4wpOHtUfZODlBTeHZ eqj0gGD4i8P4NRJ8z5rqv3yfSEFuBz4/Ft5PIIT63u7vJS668NNgGC3wHRgosweb9lxI OBB7p3WDzXxhv+eYRBzwz1qMzbWpidJv0sAOG+tic8AYjRlQvdYacLsoz9bsOuCdXGMX ENcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=Wg+LkZgs; 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 p23si2770503pli.431.2017.06.20.02.59.06; Tue, 20 Jun 2017 02:59:07 -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=Wg+LkZgs; 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 S1752052AbdFTJ6f (ORCPT + 25 others); Tue, 20 Jun 2017 05:58:35 -0400 Received: from mail-wr0-f173.google.com ([209.85.128.173]:36668 "EHLO mail-wr0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752647AbdFTJhI (ORCPT ); Tue, 20 Jun 2017 05:37:08 -0400 Received: by mail-wr0-f173.google.com with SMTP id c11so32940735wrc.3 for ; Tue, 20 Jun 2017 02:37:07 -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=wGNV1XIwJ451jYKQCJDCwamKxUc85B6gwDdg3z1bx/c=; b=Wg+LkZgsSffaPTViELQW2uoKUUIqjIFTJaXhidYx7VcgQ9bM69OhZjr8Op+019hz8z U+57xVd9QIbkryeNU2e9/u57iEwFd7O/3oirzdOq8AbGkYGaBBbyb8rl/A3+8YOt5MeC Zosso2WT7WNsln64YmSNRc+SD4XBjeO6D9Uls= 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=wGNV1XIwJ451jYKQCJDCwamKxUc85B6gwDdg3z1bx/c=; b=Uym4ikR8bb4nellbiQwTo4GqIo0UX8snLVTyNhPvhZDxHemfrLptyPAPf1dbnvZ6UY tr6kuFF1bAQZESXbqiz2ooOQiBnUvQq+8+n/4AkRdlecuPWlJqjITuRQ+7GuzrTMGHfZ ogGquJ+6ZFrr/8XSIMhFUJCIh4SyivKxtpAlVeoDwCmRkE6QEtE9nwFAlYRG3QcdOatI 6bgU2E0J5pRcCQCqOm/lg03KuMLU06xYMmqeeHknQTLUDcQCSHkX6ECqmjIxk0uZjxqY Md6hCInYzwjmVubPu+u5z3YddUHuIdAxdjDdhBbF91ryWgYsFupFwgfPRAHo/Qm/w8FV TETg== X-Gm-Message-State: AKS2vOyJt8nFQZay535fqlwtcWuizTWqOm/gwLZTt+R60y+FSXmlzsAr A1I+roBX0RDYw+RiPEpKiQ== X-Received: by 10.223.170.7 with SMTP id p7mr21052009wrd.72.1497951426936; Tue, 20 Jun 2017 02:37:06 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.37.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:37:06 -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 05/51] rtc: 88pm860x: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:13 +0200 Message-Id: <1497951359-13334-6-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. Signed-off-by: Benjamin Gaignard CC: Alessandro Zummo CC: Alexandre Belloni CC: rtc-linux@googlegroups.com CC: linux-kernel@vger.kernel.org --- drivers/rtc/rtc-88pm860x.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-88pm860x.c b/drivers/rtc/rtc-88pm860x.c index 19e53b3..0d20ede 100644 --- a/drivers/rtc/rtc-88pm860x.c +++ b/drivers/rtc/rtc-88pm860x.c @@ -86,8 +86,8 @@ static int pm860x_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled) static void rtc_next_alarm_time(struct rtc_time *next, struct rtc_time *now, struct rtc_time *alrm) { - unsigned long next_time; - unsigned long now_time; + unsigned long long next_time; + unsigned long long now_time; next->tm_year = now->tm_year; next->tm_mon = now->tm_mon; @@ -96,13 +96,13 @@ static void rtc_next_alarm_time(struct rtc_time *next, struct rtc_time *now, next->tm_min = alrm->tm_min; next->tm_sec = alrm->tm_sec; - rtc_tm_to_time(now, &now_time); - rtc_tm_to_time(next, &next_time); + now_time = rtc_tm_to_time64(now); + next_time = rtc_tm_to_time64(next); if (next_time < now_time) { /* Advance one day */ next_time += 60 * 60 * 24; - rtc_time_to_tm(next_time, next); + rtc_time64_to_tm(next_time, next); } } @@ -110,7 +110,7 @@ static int pm860x_rtc_read_time(struct device *dev, struct rtc_time *tm) { struct pm860x_rtc_info *info = dev_get_drvdata(dev); unsigned char buf[8]; - unsigned long ticks, base, data; + unsigned long long ticks, base, data; pm860x_page_bulk_read(info->i2c, REG0_ADDR, 8, buf); dev_dbg(info->dev, "%x-%x-%x-%x-%x-%x-%x-%x\n", buf[0], buf[1], @@ -121,10 +121,10 @@ static int pm860x_rtc_read_time(struct device *dev, struct rtc_time *tm) pm860x_bulk_read(info->i2c, PM8607_RTC_COUNTER1, 4, buf); data = (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0]; ticks = base + data; - dev_dbg(info->dev, "get base:0x%lx, RO count:0x%lx, ticks:0x%lx\n", + dev_dbg(info->dev, "get base:0x%llx, RO count:0x%llx, ticks:0x%llx\n", base, data, ticks); - rtc_time_to_tm(ticks, tm); + rtc_time64_to_tm(ticks, tm); return 0; } @@ -133,7 +133,7 @@ static int pm860x_rtc_set_time(struct device *dev, struct rtc_time *tm) { struct pm860x_rtc_info *info = dev_get_drvdata(dev); unsigned char buf[4]; - unsigned long ticks, base, data; + unsigned long long ticks, base, data; if ((tm->tm_year < 70) || (tm->tm_year > 138)) { dev_dbg(info->dev, "Set time %d out of range. " @@ -141,13 +141,13 @@ static int pm860x_rtc_set_time(struct device *dev, struct rtc_time *tm) 1900 + tm->tm_year); return -EINVAL; } - rtc_tm_to_time(tm, &ticks); + ticks = rtc_tm_to_time64(tm); /* load 32-bit read-only counter */ pm860x_bulk_read(info->i2c, PM8607_RTC_COUNTER1, 4, buf); data = (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0]; base = ticks - data; - dev_dbg(info->dev, "set base:0x%lx, RO count:0x%lx, ticks:0x%lx\n", + dev_dbg(info->dev, "set base:0x%llx, RO count:0x%llx, ticks:0x%llx\n", base, data, ticks); pm860x_page_reg_write(info->i2c, REG0_DATA, (base >> 24) & 0xFF); @@ -164,7 +164,7 @@ static int pm860x_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) { struct pm860x_rtc_info *info = dev_get_drvdata(dev); unsigned char buf[8]; - unsigned long ticks, base, data; + unsigned long long ticks, base, data; int ret; pm860x_page_bulk_read(info->i2c, REG0_ADDR, 8, buf); @@ -175,10 +175,10 @@ static int pm860x_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) pm860x_bulk_read(info->i2c, PM8607_RTC_EXPIRE1, 4, buf); data = (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0]; ticks = base + data; - dev_dbg(info->dev, "get base:0x%lx, RO count:0x%lx, ticks:0x%lx\n", + dev_dbg(info->dev, "get base:0x%llx, RO count:0x%llx, ticks:0x%llx\n", base, data, ticks); - rtc_time_to_tm(ticks, &alrm->time); + rtc_time64_to_tm(ticks, &alrm->time); ret = pm860x_reg_read(info->i2c, PM8607_RTC1); alrm->enabled = (ret & ALARM_EN) ? 1 : 0; alrm->pending = (ret & (ALARM | ALARM_WAKEUP)) ? 1 : 0; @@ -189,7 +189,7 @@ static int pm860x_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) { struct pm860x_rtc_info *info = dev_get_drvdata(dev); struct rtc_time now_tm, alarm_tm; - unsigned long ticks, base, data; + unsigned long long ticks, base, data; unsigned char buf[8]; int mask; @@ -204,13 +204,13 @@ static int pm860x_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) pm860x_bulk_read(info->i2c, PM8607_RTC_COUNTER1, 4, buf); data = (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0]; ticks = base + data; - dev_dbg(info->dev, "get base:0x%lx, RO count:0x%lx, ticks:0x%lx\n", + dev_dbg(info->dev, "get base:0x%llx, RO count:0x%llx, ticks:0x%llx\n", base, data, ticks); - rtc_time_to_tm(ticks, &now_tm); + rtc_time64_to_tm(ticks, &now_tm); rtc_next_alarm_time(&alarm_tm, &now_tm, &alrm->time); /* get new ticks for alarm in 24 hours */ - rtc_tm_to_time(&alarm_tm, &ticks); + ticks = rtc_tm_to_time64(&alarm_tm); data = ticks - base; buf[0] = data & 0xff; @@ -314,7 +314,7 @@ static int pm860x_rtc_probe(struct platform_device *pdev) struct pm860x_rtc_pdata *pdata = NULL; struct pm860x_rtc_info *info; struct rtc_time tm; - unsigned long ticks = 0; + unsigned long long ticks = 0; int ret; pdata = dev_get_platdata(&pdev->dev); @@ -367,7 +367,7 @@ static int pm860x_rtc_probe(struct platform_device *pdev) return ret; } } - rtc_tm_to_time(&tm, &ticks); + ticks = rtc_tm_to_time64(&tm); if (pm860x_rtc_dt_init(pdev, info)) { if (pdata && pdata->sync) { pdata->sync(ticks); From patchwork Tue Jun 20 09:35:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 105990 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1281070qgd; Tue, 20 Jun 2017 02:58:00 -0700 (PDT) X-Received: by 10.84.231.134 with SMTP id g6mr34568712plk.86.1497952679898; Tue, 20 Jun 2017 02:57:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497952679; cv=none; d=google.com; s=arc-20160816; b=YLQDBvIUQk4GKb31FTEBA+ufMcdN/k/cTT5V/roZ+tLDuufG3j9gPNwO0KhZSv3lCx DYZZu7/qFmZcwjvhQMgZHIVwhmUbU4AwnwhaQleZJ5ln9tr/mBANN0RJsLMLBv9XTLVf c5icsmK8SqolzMIsL+majExcVIxgLbgNmuPjsjXtS65UHmOhxbQuBEDcjrtAhbahO70C iN/OHxEuUV0AiMFRAruBAOvcx7paqI4y95z6HN6v5Eb3dVR4V0Ti61VLwMoHbclBGq09 1FZtsup8zRSiTCqB85qG4x68CpXb0jrjzGaFnK4Sq8zXlwvskXKRx5+VJ2vyhZ28e+wA spFQ== 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=0MafvGYKUSwvNziiSCKhMVmbih2EgwVRCEvwZs0j3SdZ1eomRJVRWKQ/Yg7PAXNaYE OOKi0w8a5Dx57A8A0zHoLb6oR7vEW85LB4urziIdu0uK6pStBlKiCdhLDy7xPcHUmDfy zr+0LtTX8c4gxuBcduA+QF9G5EYQiIe/UJQwCGrqRrk2SHP83Y3/LqdgngcVV2WyRLhw O9l2v4MNn1atJ4UBcqd2GLXE8aaFAswu85fdNvMD4hyrEcfnX5hQ2XLJykkk62XJC4uI 3gRrDKDTIViK/2yAduebar/HwkuFymRjO/dlmVFIc5FbY+q9HL3faeqillSeEaXJl+Kf gUFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=Fq5gfj4J; 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 m63si8163098pld.547.2017.06.20.02.57.59; Tue, 20 Jun 2017 02:57:59 -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=Fq5gfj4J; 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 S1752772AbdFTJ5u (ORCPT + 25 others); Tue, 20 Jun 2017 05:57:50 -0400 Received: from mail-wr0-f172.google.com ([209.85.128.172]:36676 "EHLO mail-wr0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752648AbdFTJhJ (ORCPT ); Tue, 20 Jun 2017 05:37:09 -0400 Received: by mail-wr0-f172.google.com with SMTP id c11so32941081wrc.3 for ; Tue, 20 Jun 2017 02:37:09 -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=Fq5gfj4JwXW5jy9oMpaG1UO+nIdYjNcOgUt33kQS/Q9WoO07ThHDYfK7a/Cc5ihKvi yCq/fKo69TdVTzcYbmVdU6sZhtes0/VSbxCYgpBooIqCbCbRhMB23dVwcgZcmOP0vO+Y TsV9BCIHu74oDssflyI3K+poPUmIBRAlkToeE= 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=m1Ww3/Sw2hA+wU3vnA6PNvqjJvaHgNqOHt0suInKgW40b7cZitRQgCG3oHNUqq3B8D 6YteVTHlf3Kxok9ojZewEUzxxgpn1Vp/vDrRdGfDcIHC45O2eZWlZfKUCJCkz2sg6stm Ha6u8U5Tq4ZYBn0c7SiurYeTo7zTeS4Rrc6RthyRDRPZMQDZinwCTYYlo8xAj0FY5lde GbvtGInMrEtTXBffUUB3JjqEBK8+VrvkeiKTSnJr/jN5J4QZZDYGi1zEa5KluisvgYe9 zxmuy0iMfOoptTBqzBB5jK8dWsv+gHKH+LQ+AgJWfPZcfP5SXmk+/5aFpgWbADArHIlO gcDw== X-Gm-Message-State: AKS2vOwFV9KEn/yIjrNcvYR2bMR0s6mEJA9935MWBik6AjhDt3KGg0gX +6ln5Ae3gjp7jha5SqN3PQ== X-Received: by 10.223.169.203 with SMTP id b69mr21478898wrd.1.1497951428438; Tue, 20 Jun 2017 02:37:08 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.37.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:37:08 -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 06/51] rtc: ab-b5ze-s3: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:14 +0200 Message-Id: <1497951359-13334-7-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. Signed-off-by: Benjamin Gaignard CC: Alessandro Zummo CC: Alexandre Belloni CC: 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 Tue Jun 20 09:35:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 105989 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1280862qgd; Tue, 20 Jun 2017 02:57:12 -0700 (PDT) X-Received: by 10.99.185.67 with SMTP id v3mr30102263pgo.189.1497952632557; Tue, 20 Jun 2017 02:57:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497952632; cv=none; d=google.com; s=arc-20160816; b=jVka9iFKf1Cv4aaEX1TfFlhpa2esfJ9BSpCQ6dwurZgX7p+DckeejwYvPX3FDktJkP LgsHQBYFptGdv1gO/s27mpMinfIOFGW55sBibATvqV3sGDsA8ChCX3+9YCRdVZ5p1z48 k7GQt6V4ATDQ7crJomdjgIe0DlMBkLKPVJfHDGv+l6ahmlBM2ovcGocdaHEGH9uFKo8h HJDrhfEClYiPrjyGqJ6ld+tVhWblyfNjiZuJ6pA9N3DFmvKRL0aLL8LWmY6+b+nedxMI ixG8/PfQJldREBCVrAHI8ygtDN2/kgQQUuqPhCKTYMzXbuyDxdtZvanOAyEn8dC4CdQw 7zWQ== 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=Jz2pCBy13xkUveB1TbUsAmXEtIb1+iLByJ/+0x7ulys=; b=uEPX+sUoXPlnjSO0MsvZEy4cqil5kTjo0DtOikKKvFjjGrGUvtiowTwtN08uRNw1Mg mEgHreoFhRIxkFbRDnSBQhdPdnXZ0YG7mmTjcTU/FonqGpyzzw3clOWLYBS42gHnijlQ Qz1VVx2/PUVpBU9C9yi+mTLGV2Qo20M4ApbJKiub72BGXps6gyVzAgI8h4/TcyWl39dl +bld2u4zdHhR4dSPK6S5xiKE657trY2qqLvil4NBx+/zCGmueXGQJA4ccrsMz/+lsAxm Mi0rIL723c0FamtkKGeyUFvbPDLXST8BXiowtyW8G3KUKxCsKNTa4ax/SKuMLSEtCRCb 7E7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=Y9SrSnvK; 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 w23si11448190plk.118.2017.06.20.02.57.12; Tue, 20 Jun 2017 02:57:12 -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=Y9SrSnvK; 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 S1752068AbdFTJ5K (ORCPT + 25 others); Tue, 20 Jun 2017 05:57:10 -0400 Received: from mail-wr0-f177.google.com ([209.85.128.177]:33879 "EHLO mail-wr0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751768AbdFTJhR (ORCPT ); Tue, 20 Jun 2017 05:37:17 -0400 Received: by mail-wr0-f177.google.com with SMTP id 77so88363896wrb.1 for ; Tue, 20 Jun 2017 02:37:16 -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=Jz2pCBy13xkUveB1TbUsAmXEtIb1+iLByJ/+0x7ulys=; b=Y9SrSnvK0GyNZF5hTNJSO195YSfjwfHKlsFP9r3mLglZS0qVfKUllon/1iS/E8dEG2 3hz5FKd8RnaPt3b9JZRNdzQcd4vbb4u+hsyp0kUh3aO4+9/AbpjpANW7DnBAIY9fT/Pj ns1aReGawQ0ozMBkmQSx0kBb1k69X1p4C2CQI= 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=Jz2pCBy13xkUveB1TbUsAmXEtIb1+iLByJ/+0x7ulys=; b=tXk9xbUK6XdUZI3XSpFsPeZEF41p0zlV5gXVZBx4mNsh6uDDbGRx2echgrE/YaIdSO /wqa6YiHsDtZOnPcKnl5HgoqlvQCSo0iFoCXVgdRYeoobs3ErgiWdeQ1xMZXv2B6bycG VUz6QeihCN6Ey4C/AZEukK5vSkBos0nCCmd44+b9lhPVbjdAHAefW4744vEUW6qB8Zrk DDOqolEFORFpUDMOQbqqcurnV653xIll7OAEYkCEfCXc35r7z7A7MXOd2THdvEMFvZb2 MygBpoCsN2BEgubGhiGAxoF0vHm40xT6yMMP8mPBQf0PlJ2sprlU5OIqhgW53iQOTGza lB/Q== X-Gm-Message-State: AKS2vOwWUfUUQ1yAJ/PLtYnZF7lfrud0BucVvE45JEaKjzdozUqhAhiw fvrJU2XNMDi8iiG1 X-Received: by 10.223.146.161 with SMTP id 30mr22117042wrn.164.1497951430508; Tue, 20 Jun 2017 02:37:10 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.37.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:37:10 -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 07/51] rtc: ab8500: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:15 +0200 Message-Id: <1497951359-13334-8-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. Signed-off-by: Benjamin Gaignard CC: 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 | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) -- 1.9.1 Acked-by: Linus Walleij diff --git a/drivers/rtc/rtc-ab8500.c b/drivers/rtc/rtc-ab8500.c index 24a0af6..ac131bd 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, no_mins, 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 @@ -185,7 +185,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 +214,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 +230,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 mins, secs = 0, cursec = 0; struct rtc_time curtm; if (alarm->time.tm_year < (AB8500_RTC_EPOCH - 1900)) { @@ -240,7 +240,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 +248,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; @@ -281,7 +281,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 mins, 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,7 +290,7 @@ 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 From patchwork Tue Jun 20 09:35:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 105945 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1274623qgd; Tue, 20 Jun 2017 02:37:22 -0700 (PDT) X-Received: by 10.98.156.1 with SMTP id f1mr29870100pfe.192.1497951442874; Tue, 20 Jun 2017 02:37:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497951442; cv=none; d=google.com; s=arc-20160816; b=WdBtwjstAYcWuwccr/ktjOKHzRlnh+/dpjw/cvDpQ+LxR9uYm+e1Lw5SuqGJnufGAJ gqa2Bd8e6xdH4RlAtl53DKhSrJMU95RVri9sCffhqufCiZcLatctzM3KtSO+JRYhZpoT nGk67ooqt+JYhlN2MGseA+2FImpZVlbyoGFO0Qz35Cp61ZngF6iSFxQNeUomgAQKkPOF EXG1cxu0hs3c/X3AwduxthAHo3ngjBDqgghlJ9jKc2fheYrDkHgWEoXNzPZrsyqCF7sT yiGV0/4hGiIWQ75mMYwj7w5r64LAdYZrpPqVKFHkFMLbruBchk1wJU4rsgwR1gnJG1ET t+zA== 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=bFTuFR+tNkK6chLQ2LzA7wtAK8aEbC5w6pSLisuAMOg=; b=xhhBi1iPkynB+ZAVIGrE63MzsVoJPtYQhodo9WjkxpviP0j9zk3VshtUdsioEy2nlM rCG2o91AcwnHcAljQUB5q+DHMrt0+7P/27l6ov1S4irXLVSJLbKVYCcNp4MFfe+k88xO kTl6kvy743C8wyg+feUHzduk4g2kI4ib+qBJGgqHpeuy976X+ceciOULusTaWw/F5S5M 8+LZoa0LGbx8keunwoN+HEOguVfr5tZXIiBf9j7dol9KUm46C0c3v1MU0Bq6qGscyej4 t1sUH9iMXNY7GDsU7bU680exJATjI8cRa3Df3r1StTNWxJP/Z+V1tKQfr0WmPP17fg3+ CEJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=BLOFmzHU; 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 e22si11613529plj.251.2017.06.20.02.37.22; Tue, 20 Jun 2017 02:37:22 -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=BLOFmzHU; 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 S1752630AbdFTJhS (ORCPT + 25 others); Tue, 20 Jun 2017 05:37:18 -0400 Received: from mail-wm0-f46.google.com ([74.125.82.46]:34897 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752539AbdFTJhO (ORCPT ); Tue, 20 Jun 2017 05:37:14 -0400 Received: by mail-wm0-f46.google.com with SMTP id x70so16013310wme.0 for ; Tue, 20 Jun 2017 02:37: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=bFTuFR+tNkK6chLQ2LzA7wtAK8aEbC5w6pSLisuAMOg=; b=BLOFmzHU46zGhwVzxrbA2gjA7oGfIHb+nc6qu0VDwh6J4dwZeLsreS98B3kldACcyB /KBwUcRuKuQpI63JLov0Ny1BvHeRmE4T77dh1uWY1iQwDW/RkRJdwADbWnIEmOVLmIxF peb8wpE0g/WsPJBPjr7y4QE50rr//1xo2to0M= 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=bFTuFR+tNkK6chLQ2LzA7wtAK8aEbC5w6pSLisuAMOg=; b=VZ9qXUroL4GJWCyMfR9fm1XXR53BDiNWc6R6RhPuIXEkchuxklmjWYJGQB2HT2EfVs ReyMb3tYEnZVKwvXjMRzSX10Az3gr9CM2bSgKA6dmOqif8lsQX69oAkFY/vfpHdkbrd2 A2bon/HIe65HvFrM9EPib9M3Q6aV++d6Ie8BNiugYsma2ByqChZ7d3+8I250tb3YF2fy 3kaujfn+ibg8LQusqX9ZKDU2isBFQJ/2autRAAByTmJWZh8dOCz758ZMC2oQsz708LoI dCuiHCR5yvLz7xK+LIEtQldIHjZFBETrVidDYhwQ9UXPubaWzBb3uv56PaSmStpNCtwo IMXQ== X-Gm-Message-State: AKS2vOxSE5xDUKzfFfPIxrODxzUAZ/zUrQJY6oxdtDgexvONbVI1TtOk oItjVas4f3tSUj4b X-Received: by 10.28.234.193 with SMTP id g62mr1455361wmi.24.1497951432551; Tue, 20 Jun 2017 02:37:12 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.37.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:37:12 -0700 (PDT) From: Benjamin Gaignard To: benjamin.gaignard@linaro.org Cc: linaro-kernel@lists.linaro.org, Jason Cooper , Gregory Clement , Sebastian Hesselbarth , Alessandro Zummo , Alexandre Belloni , rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org Subject: [PATCH 08/51] rtc: armada38x: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:16 +0200 Message-Id: <1497951359-13334-9-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. Signed-off-by: Benjamin Gaignard CC: Jason Cooper CC: Gregory Clement CC: Sebastian Hesselbarth CC: Alessandro Zummo CC: Alexandre Belloni CC: rtc-linux@googlegroups.com CC: linux-kernel@vger.kernel.org --- drivers/rtc/rtc-armada38x.c | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-armada38x.c b/drivers/rtc/rtc-armada38x.c index 21f355c..752ebf4 100644 --- a/drivers/rtc/rtc-armada38x.c +++ b/drivers/rtc/rtc-armada38x.c @@ -213,13 +213,14 @@ static void armada8k_unmask_interrupt(struct armada38x_rtc *rtc) static int armada38x_rtc_read_time(struct device *dev, struct rtc_time *tm) { struct armada38x_rtc *rtc = dev_get_drvdata(dev); - unsigned long time, flags; + unsigned long long time; + unsigned long flags; spin_lock_irqsave(&rtc->lock, flags); time = rtc->data->read_rtc_reg(rtc, RTC_TIME); spin_unlock_irqrestore(&rtc->lock, flags); - rtc_time_to_tm(time, tm); + rtc_time64_to_tm(time, tm); return 0; } @@ -227,26 +228,23 @@ static int armada38x_rtc_read_time(struct device *dev, struct rtc_time *tm) static int armada38x_rtc_set_time(struct device *dev, struct rtc_time *tm) { struct armada38x_rtc *rtc = dev_get_drvdata(dev); - int ret = 0; - unsigned long time, flags; - - ret = rtc_tm_to_time(tm, &time); + unsigned long long time; + unsigned long flags; - if (ret) - goto out; + time = rtc_tm_to_time64(tm); spin_lock_irqsave(&rtc->lock, flags); rtc_delayed_write(time, rtc, RTC_TIME); spin_unlock_irqrestore(&rtc->lock, flags); -out: - return ret; + return 0; } static int armada38x_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) { struct armada38x_rtc *rtc = dev_get_drvdata(dev); - unsigned long time, flags; + unsigned long long time; + unsigned long flags; u32 reg = ALARM_REG(RTC_ALARM1, rtc->data->alarm); u32 reg_irq = ALARM_REG(RTC_IRQ1_CONF, rtc->data->alarm); u32 val; @@ -259,7 +257,7 @@ static int armada38x_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) spin_unlock_irqrestore(&rtc->lock, flags); alrm->enabled = val ? 1 : 0; - rtc_time_to_tm(time, &alrm->time); + rtc_time64_to_tm(time, &alrm->time); return 0; } @@ -269,13 +267,10 @@ static int armada38x_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) struct armada38x_rtc *rtc = dev_get_drvdata(dev); u32 reg = ALARM_REG(RTC_ALARM1, rtc->data->alarm); u32 reg_irq = ALARM_REG(RTC_IRQ1_CONF, rtc->data->alarm); - unsigned long time, flags; - int ret = 0; - - ret = rtc_tm_to_time(&alrm->time, &time); + unsigned long long time; + unsigned long flags; - if (ret) - goto out; + time = rtc_tm_to_time64(&alrm->time); spin_lock_irqsave(&rtc->lock, flags); @@ -288,8 +283,7 @@ static int armada38x_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) spin_unlock_irqrestore(&rtc->lock, flags); -out: - return ret; + return 0; } static int armada38x_rtc_alarm_irq_enable(struct device *dev, From patchwork Tue Jun 20 09:35:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 105988 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1280677qgd; Tue, 20 Jun 2017 02:56:36 -0700 (PDT) X-Received: by 10.98.197.130 with SMTP id j124mr29870498pfg.239.1497952595996; Tue, 20 Jun 2017 02:56:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497952595; cv=none; d=google.com; s=arc-20160816; b=KunqEeqjKAgq0dETmb8Zw12EvWFSWxKdIZLO3nsDWjggYrzv/leIG1Fv9F1nBVHmOU gqOuh7OOojmNpJIS1nmk7vUZ7bStTLRYEMve0nbBt5v+OFsq6tae9GTAaTX2OU1XwMO+ jqAtQkLgz7H9aOsDBjCYgJ1HZ6oZWVR7Ld7CdLMe/yOg5WpAbs7Zo58sxz/KdADSbDRI G/526Ysr226IsmnCG+hzeJ//tQdLxFAXbyXMrnOukKKBh/9q7ZHsTeEAl/ufnwnY3EE8 R8dUDtUdOKuSd6vm7dYdnOMawfGiQI58WU6Mk/dn3w6V5bGUqoEt/vc/QRWdVZ9r4m9t zzJg== 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=z5XvP8vgaYR3uGdKV3t2tq0dbW8dP5rTTTSzYNub3gM=; b=J3WesUicy5N082qL6qpmGmrFkTWxsXCUtCHAUc0YNk8Ws87tvSl7t2KJOpPq5353/u ui4LYk6oF7R3I7xylslpFeGk9eDVGkRtpCJzvW56pvd6QYXES6Xs5LoDCTIekMzDj/6O R88n/ym927YxfVEflX/qnkN+Ul4l/p4Gb8wzKGeCQN1Cr6w5P9A1Rh+rMKHs8lUUfUne IYO35wEGfqrnzhxL6Vq1OOy73hDObOA5r2AR6ixdCq4WpeMyqVACF1T1dJi6cQlmPbEZ C14+6VlTecfihbj2PoyY2kLIHtj3ypBBn5Eph+9OtQ/bng+1PGcmMTbVRG6VbBYXiV1w QITw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=dDMspI4U; 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 w23si11448190plk.118.2017.06.20.02.56.35; Tue, 20 Jun 2017 02:56:35 -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=dDMspI4U; 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 S1751998AbdFTJ4c (ORCPT + 25 others); Tue, 20 Jun 2017 05:56:32 -0400 Received: from mail-wm0-f54.google.com ([74.125.82.54]:38317 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752557AbdFTJhU (ORCPT ); Tue, 20 Jun 2017 05:37:20 -0400 Received: by mail-wm0-f54.google.com with SMTP id u195so14554745wmd.1 for ; Tue, 20 Jun 2017 02:37: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=z5XvP8vgaYR3uGdKV3t2tq0dbW8dP5rTTTSzYNub3gM=; b=dDMspI4Uho51GbJ3SN3wIEhO7jo2245Dod+vApBpPvWS86JFI+Tx1aN44Hn6zlPfyW 5OGxmys7eI5CNcy099aF4RydogMN0D+jytGY1Zi2eHpGF2+wennONLtgpkitC57lSBWm tdv4l6LjejXKcNx2JlROeERQOTfxyZhXu7Jbg= 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=z5XvP8vgaYR3uGdKV3t2tq0dbW8dP5rTTTSzYNub3gM=; b=dmqe9reCD4gixMD7PgPV9mOPHnowAl7Y5ddAX5Qc4iE/spuG/ne1ldRXAWyJlf+0cH Xdk6BHk2u7ocne/XRSsQt8kxZz8At6zXv/vHjNIK9aUnOz/bwUzuZfe4QQk4vc8MWymC uYt4zNoxP0lNg0KZerGMCFZRukJf7DVdB/oo9jqwMvbpcpnNAMplhFtHWeDPfl/ugweu HPPwIa77vDwemLLDL03okhZpUUaYzo8+mvGip0uLqKpDk0/hhawyEFvv9TvS73XW27G6 7731xiBVa6kQEx1+gMAc8zGfDgj8u+BoMPjvzqhguk4XI3MQj5N/og4QJl/5TZAT8PDY /PPA== X-Gm-Message-State: AKS2vOzW68KrLbc9QBbuLmvic2YpX46IVw5hQBPJn4YnlZA9JewHzQOK h9NNvGyriZtdwz3O X-Received: by 10.28.40.198 with SMTP id o189mr1996865wmo.102.1497951434330; Tue, 20 Jun 2017 02:37:14 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.37.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:37: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 09/51] rtc: at32ap700x: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:17 +0200 Message-Id: <1497951359-13334-10-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. Signed-off-by: Benjamin Gaignard CC: Alessandro Zummo CC: Alexandre Belloni CC: rtc-linux@googlegroups.com CC: linux-kernel@vger.kernel.org --- drivers/rtc/rtc-at32ap700x.c | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-at32ap700x.c b/drivers/rtc/rtc-at32ap700x.c index de8bf56..db58cf5 100644 --- a/drivers/rtc/rtc-at32ap700x.c +++ b/drivers/rtc/rtc-at32ap700x.c @@ -61,7 +61,7 @@ struct rtc_at32ap700x { struct rtc_device *rtc; void __iomem *regs; - unsigned long alarm_time; + unsigned long long alarm_time; unsigned long irq; /* Protect against concurrent register access. */ spinlock_t lock; @@ -70,10 +70,10 @@ struct rtc_at32ap700x { static int at32_rtc_readtime(struct device *dev, struct rtc_time *tm) { struct rtc_at32ap700x *rtc = dev_get_drvdata(dev); - unsigned long now; + unsigned long long now; now = rtc_readl(rtc, VAL); - rtc_time_to_tm(now, tm); + rtc_time64_to_tm(now, tm); return 0; } @@ -81,14 +81,12 @@ static int at32_rtc_readtime(struct device *dev, struct rtc_time *tm) static int at32_rtc_settime(struct device *dev, struct rtc_time *tm) { struct rtc_at32ap700x *rtc = dev_get_drvdata(dev); - unsigned long now; - int ret; + unsigned long long now; - ret = rtc_tm_to_time(tm, &now); - if (ret == 0) - rtc_writel(rtc, VAL, now); + now = rtc_tm_to_time64(tm); + rtc_writel(rtc, VAL, now); - return ret; + return 0; } static int at32_rtc_readalarm(struct device *dev, struct rtc_wkalrm *alrm) @@ -96,7 +94,7 @@ static int at32_rtc_readalarm(struct device *dev, struct rtc_wkalrm *alrm) struct rtc_at32ap700x *rtc = dev_get_drvdata(dev); spin_lock_irq(&rtc->lock); - rtc_time_to_tm(rtc->alarm_time, &alrm->time); + rtc_time64_to_tm(rtc->alarm_time, &alrm->time); alrm->enabled = rtc_readl(rtc, IMR) & RTC_BIT(IMR_TOPI) ? 1 : 0; alrm->pending = rtc_readl(rtc, ISR) & RTC_BIT(ISR_TOPI) ? 1 : 0; spin_unlock_irq(&rtc->lock); @@ -107,15 +105,12 @@ static int at32_rtc_readalarm(struct device *dev, struct rtc_wkalrm *alrm) static int at32_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm) { struct rtc_at32ap700x *rtc = dev_get_drvdata(dev); - unsigned long rtc_unix_time; - unsigned long alarm_unix_time; - int ret; + unsigned long long rtc_unix_time; + unsigned long long alarm_unix_time; rtc_unix_time = rtc_readl(rtc, VAL); - ret = rtc_tm_to_time(&alrm->time, &alarm_unix_time); - if (ret) - return ret; + alarm_unix_time = rtc_tm_to_time64(&alrm->time); if (alarm_unix_time < rtc_unix_time) return -EINVAL; @@ -131,7 +126,7 @@ static int at32_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm) & ~RTC_BIT(CTRL_TOPEN)); spin_unlock_irq(&rtc->lock); - return ret; + return 0; } static int at32_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled) From patchwork Tue Jun 20 09:35:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 105987 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1280531qgd; Tue, 20 Jun 2017 02:56:08 -0700 (PDT) X-Received: by 10.98.245.136 with SMTP id b8mr30098741pfm.113.1497952567956; Tue, 20 Jun 2017 02:56:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497952567; cv=none; d=google.com; s=arc-20160816; b=ICbkzetVbZs5zJsNe4ThsrrJIeS562qgn7kJoB0ivoQ0njFhtlbnJdapxML9gwTilm 629edX+IrsQS/fd+5F88sxZAfnz/d8TnGSXQ08oN7YlA31s5Uwop2QCv3jC0zuM6nyqF xwSc2SGxFfkTmv1VDnGjAkKOBWD7jEVz4YOj6Y4GT7mUeeYVCHIOF3QQ28ZoVSEKhJJB 3gGTF+oDZwkn0hvqB6fCLeDju6hxiRE5B9YONg+trcLghSWt+DsvVid6H/rIIfqkfeH7 e/seXlB3S4zJxyde1KyMgXeX6PfZ5lv5XrtZ++zLoTvA/MzdFoOwpFks1ZB2tbhm65Oo kbHQ== 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=gvliszPk80GdUUt6yYCZEcsPqjuikT0yMvqtUuGW62s=; b=zUCidMgIbIaq2E+n/J1O6LUEN7jntQu597NIVrCc+WN5nJXHNtpHDXoLlReihLJELE d0vi0Nb5cbZflzW81ynzpV1QwSmS4cabaP5PDaVUZHjcV9II6gPgeBuZ9kuoMOamE1u4 0h8Xl+eA/ALgYHO6dLcFRh8btK5lw25IRH1oWtOePr/GTsy4GUZzuwUHjsGKwFUgaHXg hp63js2EbdZTJf1NY1v2QdAyRVQTFJYlQ2OoWvic7kElN6BDKtPOro5QQESuzdeRMBiB 8Uoptja5SmF/v+ruqslqP2KgqglQeMg+HaQZ4cAkYoNpHW2JJ9kiCm1oky4AyEXSVw2F SJyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=aONjZL2n; 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 j76si10014645pfe.26.2017.06.20.02.56.07; Tue, 20 Jun 2017 02:56:07 -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=aONjZL2n; 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 S1752559AbdFTJzv (ORCPT + 25 others); Tue, 20 Jun 2017 05:55:51 -0400 Received: from mail-wr0-f182.google.com ([209.85.128.182]:33501 "EHLO mail-wr0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751098AbdFTJh1 (ORCPT ); Tue, 20 Jun 2017 05:37:27 -0400 Received: by mail-wr0-f182.google.com with SMTP id r103so88490109wrb.0 for ; Tue, 20 Jun 2017 02:37:26 -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=gvliszPk80GdUUt6yYCZEcsPqjuikT0yMvqtUuGW62s=; b=aONjZL2nVQ/nYMq5FA30hNhctnUr6sZNI9Bjm/beOVbwNxIUr+UpFHJiW4yxBstimm jAhIgM2JYb+aR76UYX5rsTZhXlodmMmD2tN1NbA1+0UwOIiENAcA7sQPkyMyADgSjOrh e0UDVe4VCiTzBvzFaO6oejhZ5FeDPhdBDD300= 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=gvliszPk80GdUUt6yYCZEcsPqjuikT0yMvqtUuGW62s=; b=P384+DnlWPJpjByQCK0kZLy+PBBlpbLHSapf4z4fsd6cqvwtYVhfGLRae3hUkV404T ir52OpYxz6Ng+rbpn3obJvmefWB+zGeBdrdGOyKwsZzt4tlpnigHewzYDUIKntoSPhhn vWU0CBnv9TquzTQarN6DMhLZgQkvoAea5K836A7FNC1qF4gBhlgVIdrWM1p/8ygMPTop CqM3OKWdUOEPjQeyC7VtEtEI/0Ic3PyQSTdFZ191lKOc6MBFde4AfxzSihzp1Hdkxc3S dikVMxQY/6+9RglS2iybkQL/iSu5LESSEXoMAwQlGVV6dpuMI3MdxnGKlE7eHEJVJ37k Kf0A== X-Gm-Message-State: AKS2vOyWzhaxbWJPPKufwa58R1DKfjTQIChEW3V18Cg7iboZayGordT3 HhKkXuJVD1mvjZQM X-Received: by 10.223.131.166 with SMTP id 35mr19706229wre.161.1497951435947; Tue, 20 Jun 2017 02:37:15 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.37.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:37:15 -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 10/51] rtc: at91sam9: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:18 +0200 Message-Id: <1497951359-13334-11-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. Signed-off-by: Benjamin Gaignard CC: Alessandro Zummo CC: Alexandre Belloni CC: rtc-linux@googlegroups.com CC: linux-kernel@vger.kernel.org --- drivers/rtc/rtc-at91sam9.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-at91sam9.c b/drivers/rtc/rtc-at91sam9.c index 7418a76..be1f37e 100644 --- a/drivers/rtc/rtc-at91sam9.c +++ b/drivers/rtc/rtc-at91sam9.c @@ -122,7 +122,7 @@ static int at91_rtc_readtime(struct device *dev, struct rtc_time *tm) if (secs != secs2) secs = rtt_readl(rtc, VR); - rtc_time_to_tm(offset + secs, tm); + rtc_time64_to_tm((u64)(offset + secs), tm); dev_dbg(dev, "%s: %4d-%02d-%02d %02d:%02d:%02d\n", "readtime", 1900 + tm->tm_year, tm->tm_mon, tm->tm_mday, @@ -137,17 +137,14 @@ static int at91_rtc_readtime(struct device *dev, struct rtc_time *tm) static int at91_rtc_settime(struct device *dev, struct rtc_time *tm) { struct sam9_rtc *rtc = dev_get_drvdata(dev); - int err; u32 offset, alarm, mr; - unsigned long secs; + unsigned long long secs; dev_dbg(dev, "%s: %4d-%02d-%02d %02d:%02d:%02d\n", "settime", 1900 + tm->tm_year, tm->tm_mon, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec); - err = rtc_tm_to_time(tm, &secs); - if (err != 0) - return err; + secs = rtc_tm_to_time64(tm); mr = rtt_readl(rtc, MR); @@ -197,7 +194,7 @@ static int at91_rtc_readalarm(struct device *dev, struct rtc_wkalrm *alrm) memset(alrm, 0, sizeof(*alrm)); if (alarm != ALARM_DISABLED && offset != 0) { - rtc_time_to_tm(offset + alarm, tm); + rtc_time64_to_tm((u64)(offset + alarm), tm); dev_dbg(dev, "%s: %4d-%02d-%02d %02d:%02d:%02d\n", "readalarm", 1900 + tm->tm_year, tm->tm_mon, tm->tm_mday, @@ -214,14 +211,11 @@ static int at91_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm) { struct sam9_rtc *rtc = dev_get_drvdata(dev); struct rtc_time *tm = &alrm->time; - unsigned long secs; + unsigned long long secs; u32 offset; u32 mr; - int err; - err = rtc_tm_to_time(tm, &secs); - if (err != 0) - return err; + secs = rtc_tm_to_time64(tm); offset = gpbr_readl(rtc); if (offset == 0) { From patchwork Tue Jun 20 09:35:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 105946 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1274663qgd; Tue, 20 Jun 2017 02:37:32 -0700 (PDT) X-Received: by 10.99.115.16 with SMTP id o16mr30070068pgc.31.1497951452069; Tue, 20 Jun 2017 02:37:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497951452; cv=none; d=google.com; s=arc-20160816; b=V1zwqaBERjDXZFOFnBwlz17UqTut5K9eh9j+AeKrduyanP9XNMznUBC69+A2qiCMUN Smi7tKPcVOM3Zeozd9Vnxy2MYXW1jUt7LlYu+UxRzs47R99wM4Bt+CImQxHjnMH9rLjg Ce36OexDgWfXULWQLKzYu19T/OK7nJKSWyWM9VMcZ9b3UP2oEz5cJ3VQekLf6hQ3uCnm yPV64uw9GVVVR4YyqxGRQqe7zIUMC3LV/oKLRLR00q4v6PdrVSSGH/HoPt9CLDmq+mZ0 N8l4uz5Q06zqgoxCGcVSZlnUI1S0m4ISZzsr9KH5wnt2ChyxkMcwWNNGOZaT/CEpP+RI BEkA== 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=w7ceW9TGs47oPU8ENU08dUtjwQVvQs5KyoFicWnGEiA=; b=UmggGeOb0PbEoO4DZ60TSFs0Xhm0c7MEbHpcBJuqOOqtISSkaAgj0Zb0/+SDeMuABn H1Kwm5IaqvkLOckm0CKCp/BR+/kwEUA9qy4g62Maqu/PrFn3HWpBH4hqJeAkXI0CfqF4 VjoOOuZiptzwNRoDW2GyO2jTYu9AQpvAMjDns6YH/yyJW9hnfMPyQEI41PiyKM3D/IBD 5butPxsmqRIEZ13gLDkPEiuoLrzpiMrsPkF3zf8Y4FWIvrOS6YuuopHxaS6Lu9AbVe7b J255PIRAhDKubEs3Y6mWcbyg5b5/OsvRwoQwTU4qr48ZYPDmPQize5caPJahRv/harai rGEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=ShWqnK8v; 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 x2si6435654plm.471.2017.06.20.02.37.31; Tue, 20 Jun 2017 02:37:32 -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=ShWqnK8v; 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 S1752706AbdFTJhV (ORCPT + 25 others); Tue, 20 Jun 2017 05:37:21 -0400 Received: from mail-wr0-f180.google.com ([209.85.128.180]:33921 "EHLO mail-wr0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752539AbdFTJhT (ORCPT ); Tue, 20 Jun 2017 05:37:19 -0400 Received: by mail-wr0-f180.google.com with SMTP id 77so88365713wrb.1 for ; Tue, 20 Jun 2017 02:37:18 -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=w7ceW9TGs47oPU8ENU08dUtjwQVvQs5KyoFicWnGEiA=; b=ShWqnK8vqC313Vo8VzTNtsbEFzlHypIX+6IoqG4DafUH7bZ88udjXwG8rdDphdqM7Z BpEPfmeO+Cm8N7CRbykq7c4xmyiGU2+Xjvh1WDAVa+r7e2ZlvKAFaKFsMqCAxWctIE7x IsQ33ISZXKjgGyK1HgQZDLmAtePtATQU54kPc= 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=w7ceW9TGs47oPU8ENU08dUtjwQVvQs5KyoFicWnGEiA=; b=M7fyvKT89MPwIIW+qxJvluVFGkd1eYDrPiYY2CB9j0pFUAAGkSguoVmz7vkL8DwOHy O7nrcsgAMeKa1cFfW4K79TT4LrhYDu9GluV58U9kmsWRxdouohIsTj+LiDMwu21oGrWZ 3qFyo87qAuY2q2Dq0juVVgkal3M1NWv6A9Q05qDik4rMS9FniMZ12Tioo7ILSKyegkB6 AMi2GCkv4WgT4PGgflvkvSEBsnv+MsztFnmN8kFDqaPLWezoPB00hWUoF7KF90WWDOwI 3RNo5KcZo4WglxGAXw3wjEW4arUAgUvyb3CKGsEfM1FCumg++YwancQ6j8Bdteb2s/4N t1aA== X-Gm-Message-State: AKS2vOyLxQ0tRxhkQC+0uB+0n2NUcAbCGNpldBqBJlVy6xGsCi3m8heo jEaO8B36/UbeauXE X-Received: by 10.223.165.13 with SMTP id i13mr17093380wrb.35.1497951437825; Tue, 20 Jun 2017 02:37:17 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.37.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:37: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, adi-buildroot-devel@lists.sourceforge.net Subject: [PATCH 11/51] rtc: bfin: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:19 +0200 Message-Id: <1497951359-13334-12-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. Signed-off-by: Benjamin Gaignard CC: Alessandro Zummo CC: Alexandre Belloni CC: rtc-linux@googlegroups.com CC: linux-kernel@vger.kernel.org CC: adi-buildroot-devel@lists.sourceforge.net --- drivers/rtc/rtc-bfin.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-bfin.c b/drivers/rtc/rtc-bfin.c index 15344b7..4c79bd0 100644 --- a/drivers/rtc/rtc-bfin.c +++ b/drivers/rtc/rtc-bfin.c @@ -103,7 +103,7 @@ static inline unsigned long rtc_bfin_to_time(u32 rtc_bfin) } static inline void rtc_bfin_to_tm(u32 rtc_bfin, struct rtc_time *tm) { - rtc_time_to_tm(rtc_bfin_to_time(rtc_bfin), tm); + rtc_time64_to_tm(rtc_bfin_to_time(rtc_bfin), tm); } /** @@ -271,20 +271,17 @@ static int bfin_rtc_read_time(struct device *dev, struct rtc_time *tm) static int bfin_rtc_set_time(struct device *dev, struct rtc_time *tm) { struct bfin_rtc *rtc = dev_get_drvdata(dev); - int ret; - unsigned long now; + unsigned long long now; dev_dbg_stamp(dev); - ret = rtc_tm_to_time(tm, &now); - if (ret == 0) { - if (rtc->rtc_wrote_regs & 0x1) - bfin_rtc_sync_pending(dev); - bfin_write_RTC_STAT(rtc_time_to_bfin(now)); - rtc->rtc_wrote_regs = 0x1; - } + now = rtc_tm_to_time64(tm); + if (rtc->rtc_wrote_regs & 0x1) + bfin_rtc_sync_pending(dev); + bfin_write_RTC_STAT(rtc_time_to_bfin(now)); + rtc->rtc_wrote_regs = 0x1; - return ret; + return 0; } static int bfin_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) @@ -300,12 +297,11 @@ static int bfin_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) static int bfin_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) { struct bfin_rtc *rtc = dev_get_drvdata(dev); - unsigned long rtc_alarm; + unsigned long long rtc_alarm; dev_dbg_stamp(dev); - if (rtc_tm_to_time(&alrm->time, &rtc_alarm)) - return -EINVAL; + rtc_alarm = rtc_tm_to_time64(&alrm->time); rtc->rtc_alarm = alrm->time; From patchwork Tue Jun 20 09:35:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 105983 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1279891qgd; Tue, 20 Jun 2017 02:54:02 -0700 (PDT) X-Received: by 10.84.176.3 with SMTP id u3mr2258plb.134.1497952442842; Tue, 20 Jun 2017 02:54:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497952442; cv=none; d=google.com; s=arc-20160816; b=n4Q0cOhanuKkIp6nSwWVq87L2U+S3XhmPwDeFPvjScxAAELv9iJNygf4IQU930S464 BcmlL2I8ukj2j5UTgh8zZEaao3CspkmzzOKBxvY0sTcoNJ74kgRFckID+0T+qy5Dvj3g GVC89zNtRVqzLS0NwbYnneKOq7nguTgDzjE/BLL0eePfm+QwyEmw2yz+qLvCmgFloIeM 1Q9bCYm71DX7jjtNMjADjDYBigzz+bevqde5z1+z8jPeYKsWae/WWKCGQoDIrruBfz6h V+cStLFyvrkTgd83HWrVDqrRP+GtZp1yx+Dyej7f/DsRWBBFy4NiriymDHP651XJKIL/ 5L8Q== 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=7eiQxVPR0aLE6Chuup7XrCyjO/ZhueZeXLvfojlzPak=; b=kUrAui372AQNf48x77mIzm7+f6iB9VrEbPNTAWTt2u7Vl3o/qsjQRApHfLEXfN4Deo FU0r3DJxPn6w9pjrPQ+liRTQIJoVXek2IG4yIskUQifdW2vgJ+7RIzc9UnLBfFSeSwU2 Re1T5S7ThIEMAX0KlFkXdVlAQ1w2NrIAmtWkKUdZqxMhJKAZou8Xud6E+i9Js4u7N2QY PUM/WRrMDQ+I0gOarO94UtxrGlkXXo0+lKaGCcizLvCruxYRfdSvpTk/QBqQl2egxV+O VKZF/ry6cnlqA1aKdPdhltV7+6ltZ8yYdb0BnBcdxb9+WfoQEecon6rW1IQEDJlgS6Kn ByqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=ROHdEQ1Q; 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 p28si6367357pli.166.2017.06.20.02.54.02; Tue, 20 Jun 2017 02:54:02 -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=ROHdEQ1Q; 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 S1752795AbdFTJhf (ORCPT + 25 others); Tue, 20 Jun 2017 05:37:35 -0400 Received: from mail-wr0-f173.google.com ([209.85.128.173]:33933 "EHLO mail-wr0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752103AbdFTJhb (ORCPT ); Tue, 20 Jun 2017 05:37:31 -0400 Received: by mail-wr0-f173.google.com with SMTP id 77so88366171wrb.1 for ; Tue, 20 Jun 2017 02:37:25 -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=7eiQxVPR0aLE6Chuup7XrCyjO/ZhueZeXLvfojlzPak=; b=ROHdEQ1QhMuKMO8aP/zBxTOnNWpyQsUAi2eAqGRS2WwZuEjaNbWOYdVnWa9BWd9b45 adqwWPjTW1ST+F7fLvkyUWUic3okxSZ4JP801NqvdPsq3ho6/GcTJEwH/WCfD3eiHRgj gwAH2fEBeODcNM5dgmH97ImSU8k1yFgZOtqrQ= 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=7eiQxVPR0aLE6Chuup7XrCyjO/ZhueZeXLvfojlzPak=; b=ZUbO/XmX5FlxjXN0ZvxQqRsFk43VyufZEHvluxn11zp2iONmC5op+wC19Cr7WcwBl6 MgIorthVW2SvJGyMijAokmXhry9EYXv/PbAdvzJnHShxqz4mhQ11zkgHvl/9kQnH4zDD dk5hHG03PQ/cbY3ehjJ5dFCSjru0UdboSwaMqCrofV5JF7W2vNgWNPUKJkSlNjPKi3w3 sLVwGxOwNu/bprNNtwb5u7Xpjt4KyNrjHUtK6jmUR7l45b9DyP2flAyWcP3h/8xNNH7d 6riJfK4MF8Z1UtVNw3wRSZmzhbhZA2XmZr9MStsulduGZY/oiHktKaNwYLWQQH69uuEO YPCg== X-Gm-Message-State: AKS2vOxGkuaeIc5MYfWIzBPXouWcjmMqgzZPa1NJBT7QESEsIb7ixqHB cGwbIExI5uVEoNxV X-Received: by 10.223.176.164 with SMTP id i33mr18064593wra.165.1497951439682; Tue, 20 Jun 2017 02:37:19 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.37.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:37:19 -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 12/51] rtc: coh901331: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:20 +0200 Message-Id: <1497951359-13334-13-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. Signed-off-by: Benjamin Gaignard CC: 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-coh901331.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) -- 1.9.1 Acked-by: Linus Walleij diff --git a/drivers/rtc/rtc-coh901331.c b/drivers/rtc/rtc-coh901331.c index cfc4141..5645011 100644 --- a/drivers/rtc/rtc-coh901331.c +++ b/drivers/rtc/rtc-coh901331.c @@ -80,7 +80,8 @@ static int coh901331_read_time(struct device *dev, struct rtc_time *tm) clk_enable(rtap->clk); /* Check if the time is valid */ if (readl(rtap->virtbase + COH901331_VALID)) { - rtc_time_to_tm(readl(rtap->virtbase + COH901331_CUR_TIME), tm); + rtc_time64_to_tm( + (u64)readl(rtap->virtbase + COH901331_CUR_TIME), tm); clk_disable(rtap->clk); return rtc_valid_tm(tm); } @@ -88,7 +89,7 @@ static int coh901331_read_time(struct device *dev, struct rtc_time *tm) return -EINVAL; } -static int coh901331_set_mmss(struct device *dev, unsigned long secs) +static int coh901331_set_mmss64(struct device *dev, time64_t secs) { struct coh901331_port *rtap = dev_get_drvdata(dev); @@ -104,7 +105,8 @@ static int coh901331_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) struct coh901331_port *rtap = dev_get_drvdata(dev); clk_enable(rtap->clk); - rtc_time_to_tm(readl(rtap->virtbase + COH901331_ALARM), &alarm->time); + rtc_time64_to_tm( + (u64)readl(rtap->virtbase + COH901331_ALARM), &alarm->time); alarm->pending = readl(rtap->virtbase + COH901331_IRQ_EVENT) & 1U; alarm->enabled = readl(rtap->virtbase + COH901331_IRQ_MASK) & 1U; clk_disable(rtap->clk); @@ -115,9 +117,9 @@ static int coh901331_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) static int coh901331_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) { struct coh901331_port *rtap = dev_get_drvdata(dev); - unsigned long time; + unsigned long long time; - rtc_tm_to_time(&alarm->time, &time); + time = rtc_tm_to_time64(&alarm->time); clk_enable(rtap->clk); writel(time, rtap->virtbase + COH901331_ALARM); writel(alarm->enabled, rtap->virtbase + COH901331_IRQ_MASK); @@ -142,7 +144,7 @@ static int coh901331_alarm_irq_enable(struct device *dev, unsigned int enabled) static const struct rtc_class_ops coh901331_ops = { .read_time = coh901331_read_time, - .set_mmss = coh901331_set_mmss, + .set_mmss64 = coh901331_set_mmss64, .read_alarm = coh901331_read_alarm, .set_alarm = coh901331_set_alarm, .alarm_irq_enable = coh901331_alarm_irq_enable, From patchwork Tue Jun 20 09:35: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: 105947 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1274666qgd; Tue, 20 Jun 2017 02:37:32 -0700 (PDT) X-Received: by 10.84.236.66 with SMTP id h2mr34858892pln.233.1497951452469; Tue, 20 Jun 2017 02:37:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497951452; cv=none; d=google.com; s=arc-20160816; b=nq7WLvfCtsqPqmiOKDvSzN8/20ZJA7TDhiPB/5v2oumOaarMDyCvv0Pnz39aaxc1H+ dlVJEPaX/+oN1stbvlaHXWVehVH1m2M6JSqS6BY8qa1mSVJR5RVFRLOOQDDG8+1hwwCf GQTkhVmUQFplJIxrYaTDEMLJOSQxp8Sgif6zFbOkLbTQv/f9QHO6HvlXMYAQDDfMxI/Z +W/UO3rDKzTfDm1njmsa3TXz/zAXWRmzFSMfSzpzOAFz91lGP9bTnWT+7T6GCTiQxBuR suZjD1+Xs8kOjsKKvHp/KDDv5Ia3Ac9IhTlaVAjpvKLC56jnSKvPOABgJW7vL5LsdEtj mUaA== 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=3JmvHfIQ30VZiA4/+BrlQd3UZs8fIJ7RK07USedui5k=; b=FqTRQuo+mfz+C3m12P1iHQvdOyIDKpu6ouSDg2HNlCqFGZMoNe0kDPkwEl0kfE/+wR HZjjTVCEBs9e0PltenCmz6ZHe4Tsm8lX8Lp0UWsKzKin3l+b3WkId2Yr8xq1spBUVetd yJEiNqlZoJaX2ZyzF1edHsMVHorKUK6VUwP05qNfm/r8oVGZhWWX4zplSaQUhiDG51uS hiHy8dKpens1BH4TbdQ/jR1w+AATOZpDy9+WyqFWGUlL2icvUuUICmFHdIcIdbuFVVs+ eAIRM1dN+E/nwoU+BInbQ1Uj8JXE8lwovgN42AdnHOOpVZwKe2nxqXU3FU2nrZgFHXkA v87Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=Wh+iaKU6; 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 x2si6435654plm.471.2017.06.20.02.37.32; Tue, 20 Jun 2017 02:37:32 -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=Wh+iaKU6; 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 S1752749AbdFTJh2 (ORCPT + 25 others); Tue, 20 Jun 2017 05:37:28 -0400 Received: from mail-wr0-f174.google.com ([209.85.128.174]:33941 "EHLO mail-wr0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752539AbdFTJhW (ORCPT ); Tue, 20 Jun 2017 05:37:22 -0400 Received: by mail-wr0-f174.google.com with SMTP id 77so88366518wrb.1 for ; Tue, 20 Jun 2017 02:37:21 -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=3JmvHfIQ30VZiA4/+BrlQd3UZs8fIJ7RK07USedui5k=; b=Wh+iaKU6K0VhkSVmVxxjTAWVQLT8DGiYzrlOVAqvSW3EH7LBPrEcG7oclunXYsPAd2 QrEA31YdE8LShmruEdt5ulK7TKEty7ZoUjGrRnU1GxLZSvXx+W5coOSVk5e4onzHR4i7 YC28qRAfrawJzycqVwuOu0aLGJd2KYf6BlNFw= 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=3JmvHfIQ30VZiA4/+BrlQd3UZs8fIJ7RK07USedui5k=; b=hi0tCBTEndIlpdDftMoDI0tKRmycBsnQc7Xj/W+EfIQGwFDJYkGz7lmDy4T04AfIqW 14FbTXkPEGCswKbZT9nLjMEHd/97FsApIgAiWi74LLvn6FqFmperhKNdmtwOviTXAgXk a4tyYdtH/MhsuBYkWsFfEq8F97Qv+9XcZhrZx8M+2RFQPqKP558WA92VTZWphGxGW3F2 SBZz5j9WPKsIMiSqaWPOLYpiAMly9rlqISewcbGOnfu9861fDst+zbfLhvHH/1M+CoEi TpUYxmIeOChSYm3GpKVED90SpTV4wVBtuQHyzkKkjGOQGpQLVQkeAHf0PiBHF1Reg0Z4 Aqgg== X-Gm-Message-State: AKS2vOy3ESTB9uNZnNbgxma2UihPO0sjJFfCfCqu/NX9qFqvNuCMqbld 8UnGcf7hccSW0Egu X-Received: by 10.223.135.105 with SMTP id 38mr18227557wrz.23.1497951441105; Tue, 20 Jun 2017 02:37:21 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.37.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:37:20 -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 13/51] rtc: cpcap: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:21 +0200 Message-Id: <1497951359-13334-14-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. Signed-off-by: Benjamin Gaignard CC: Alessandro Zummo CC: Alexandre Belloni CC: rtc-linux@googlegroups.com CC: linux-kernel@vger.kernel.org --- drivers/rtc/rtc-cpcap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-cpcap.c b/drivers/rtc/rtc-cpcap.c index 3a0333e..059aa18 100644 --- a/drivers/rtc/rtc-cpcap.c +++ b/drivers/rtc/rtc-cpcap.c @@ -58,19 +58,19 @@ 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; - rtc_tm_to_time(rtc, &time); + time = rtc_tm_to_time64(rtc); cpcap->day = time / SECS_PER_DAY; time %= SECS_PER_DAY; From patchwork Tue Jun 20 09:35: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: 105986 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1280529qgd; Tue, 20 Jun 2017 02:56:07 -0700 (PDT) X-Received: by 10.99.50.135 with SMTP id y129mr31285092pgy.238.1497952567586; Tue, 20 Jun 2017 02:56:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497952567; cv=none; d=google.com; s=arc-20160816; b=de43vaufOtL9RSdp7iuuCo6Glp/2gxsNyaRUQzv/0EUV24E3jaucn2hmV89GyrqfGx jfT2KgL3EFkFcIQWeM3t9TFkoH5W92V4mm0EfcGOTv0e7h4M4ITt1zshATsejrVhGq11 fvu3OqReDnDCYq1IsV0aVrwvOkoy3oTDu3w7NqGwig3vKMdH/dZwkzuNZpojHOVWIp9t ABzRXj9sd9dbSRQIku2puCVpg2OXwFoO3nsTATtmCuHZ0vnDLxpW6wpu9jdw99F+ovvW Z9G4mc54KYK5mxg9I6Eq7h18ir0qBG42HeteK06Js2gJRtfCXf6raQMAhJnjh9diXB9m FPaw== 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=S7Ufj0TcqAY1UqTpH7Ellrm+6olfnvctbcq+/pxjvnk=; b=XQDZNLUOwe2E8HI55bYjN8TUBBkH1nQb8NHRtSGuymmKCBRcZ79VS5pc9KQDeLNN66 K3vHgJn+L1Gn1fN4+zdPvs1fxE90lXsUg+Dn6oxEHDrQHapVT9eODoY9SCITVehdyu0H rmGG0rCTgjGZsTB71hFiiURng4yGAxRoG6q3iYhz5W0XbK60m+THEfaXfPJXTRrpjnPb P+FyVUDtw2mDJ8Kpq4lPH3dzLRWzgdDyobLpqA8QZe1TePDNo+teifh9PIfkK3jS9Oga cAHZL+78tJLPthmfVekfDYQInAUIDkOqhWKdu0FlYdWTxXP7bEUoMbSRKZgOcEscMThb xUug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=GErEJjFk; 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 j76si10014645pfe.26.2017.06.20.02.56.07; Tue, 20 Jun 2017 02:56:07 -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=GErEJjFk; 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 S1752719AbdFTJh0 (ORCPT + 25 others); Tue, 20 Jun 2017 05:37:26 -0400 Received: from mail-wr0-f172.google.com ([209.85.128.172]:33541 "EHLO mail-wr0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751098AbdFTJhY (ORCPT ); Tue, 20 Jun 2017 05:37:24 -0400 Received: by mail-wr0-f172.google.com with SMTP id r103so88491910wrb.0 for ; Tue, 20 Jun 2017 02:37:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=S7Ufj0TcqAY1UqTpH7Ellrm+6olfnvctbcq+/pxjvnk=; b=GErEJjFkbZXyLZx3KhUA3ALGM4DsFKgIy9akPexmvkrURTEZUyOe0dx/IN9WMXyE9F HTCjUVr3wk1Bs93Gy8TwhCrqNVev3vaHF+eBL4cj7D+42CN5eTgQjvaKvmw+WCZlB2Xv JDk71Bs8/3tCH1V2FSGlzBlKGF60IBeFVVoAI= 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=S7Ufj0TcqAY1UqTpH7Ellrm+6olfnvctbcq+/pxjvnk=; b=ol9cKY7E7nTPVvOxx1L+Om2QpzhQ6JVd9DDZm9x6WTAhjgZ+VFThWgqzBNNcjhG8QP 4Yzo82B2XrXkustMKuNIhFCzm3YM+oNSE6JTJyYjbm922hl6uvMbQX+y4BlQVZtEGQw2 g1yaW0rmcBfkAbX3tdC+4P4e6izYQuaKokG/CXOWpx7B5/14peMh575wKO2nEcGyVnwj xTI9gPfQdRLrrnxvhQHdPLzg21/1Z8iFsPwVNvQa8LuNFdKBWT1ZvI5V3/h2CVldiSMK PWzhXfIJkxWeh9b47oaQqbhJVdfxgJsqcpAnSt3bbzXpmS694cAw3YvPPmHXb+GZLvQr 1rdQ== X-Gm-Message-State: AKS2vOxFKLTj3jd2/QjCvi7BWreafV2v7zWFR77CCIMF4Hf5R3wGqiGn pbl7XSxVq75vjcOA X-Received: by 10.223.170.7 with SMTP id p7mr21052923wrd.72.1497951442973; Tue, 20 Jun 2017 02:37:22 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.37.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:37:22 -0700 (PDT) From: Benjamin Gaignard To: benjamin.gaignard@linaro.org Cc: linaro-kernel@lists.linaro.org, Support Opensource , Alessandro Zummo , Alexandre Belloni , rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org Subject: [PATCH 14/51] rtc: da9063: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:22 +0200 Message-Id: <1497951359-13334-15-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. Signed-off-by: Benjamin Gaignard CC: Support Opensource CC: Alessandro Zummo CC: Alexandre Belloni CC: rtc-linux@googlegroups.com CC: linux-kernel@vger.kernel.org --- drivers/rtc/rtc-da9052.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-da9052.c b/drivers/rtc/rtc-da9052.c index 4273377..99a0489 100644 --- a/drivers/rtc/rtc-da9052.c +++ b/drivers/rtc/rtc-da9052.c @@ -104,17 +104,15 @@ static int da9052_read_alarm(struct da9052_rtc *rtc, struct rtc_time *rtc_tm) static int da9052_set_alarm(struct da9052_rtc *rtc, struct rtc_time *rtc_tm) { struct da9052 *da9052 = rtc->da9052; - unsigned long alm_time; + unsigned long long alm_time; int ret; uint8_t v[3]; - ret = rtc_tm_to_time(rtc_tm, &alm_time); - if (ret != 0) - return ret; + alm_time = rtc_tm_to_time64(rtc_tm); if (rtc_tm->tm_sec > 0) { alm_time += 60 - rtc_tm->tm_sec; - rtc_time_to_tm(alm_time, rtc_tm); + rtc_time64_to_tm(alm_time, rtc_tm); } BUG_ON(rtc_tm->tm_sec); /* it will cause repeated irqs if not zero */ From patchwork Tue Jun 20 09:35: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: 105984 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1280107qgd; Tue, 20 Jun 2017 02:54:44 -0700 (PDT) X-Received: by 10.98.35.148 with SMTP id q20mr29262820pfj.237.1497952483943; Tue, 20 Jun 2017 02:54:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497952483; cv=none; d=google.com; s=arc-20160816; b=k1t5ehgOJj4W88nSc3d38bV6ubxA0EayCxAL0aNrbIwklwZMPSKNQknZ39A+7Ew2hs w6DOTn1zjGpPj4duLRXgZ3ZrjqU7woJvXRd77O0ZUP0HUjCBYLBdvHp53rbUkyFT4sys omWplGbBEMrZREKLqA9zsOZWUDVy/XqJIV+gGUPcvtUXHjOMk7dMQL1Di3Do24Zn6njv 1r9Ef/cluxfLWT7litjPLhODYc6g3rRjZ4GvCOI1+bGzt6MUVUTOFqL7NvGpvOFgewRI YS9qOdQTDlpAtvrQweTV1uRBmluQ1m7MUXw05ApNNOIqke3sfqmHIWV2xj2cD+Dc1C1K mOeA== 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=otaYV6j662M10NzQ4yiv2CYjv9VXe3Cvlnnyzozd3nE=; b=IJJZde02Y7I3AYXl9L23V0LCO66drx/ufyQ+bLipVggIPROb4C/hPaAU6m2/Cs21Dw qKDkF1Z3tQM7RLV6k1RPlIhupkr2dDxhNZEymABYWck6frz9sfQKYg4UL7ctM8nR3TGQ ypaw0DU7aWvMzO4X6pJXRHcLqF5F82uNs72bgmSuvXGIuws3UBGbVOAW4nkYq6NPG5XT zV0ciYfAICs/6E0vE+tqvrVudOXPE9chytRcPuZdySkvGkw4T9IB9CH6ZrWohdBE/RWp VL38bwb8pSjNTuRA9+ZWpuPDLko4FvH2Ap3kqCgGmWKTJauFuEmhS3zUm1qPeFCmGQvu SSdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=ZAGWKTTy; 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 u14si8325720pgb.287.2017.06.20.02.54.43; Tue, 20 Jun 2017 02:54:43 -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=ZAGWKTTy; 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 S1752770AbdFTJhe (ORCPT + 25 others); Tue, 20 Jun 2017 05:37:34 -0400 Received: from mail-wr0-f172.google.com ([209.85.128.172]:35472 "EHLO mail-wr0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752611AbdFTJhb (ORCPT ); Tue, 20 Jun 2017 05:37:31 -0400 Received: by mail-wr0-f172.google.com with SMTP id y25so49122510wrd.2 for ; Tue, 20 Jun 2017 02:37:30 -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=otaYV6j662M10NzQ4yiv2CYjv9VXe3Cvlnnyzozd3nE=; b=ZAGWKTTyEbDg28tnmbzmVuetPaabyRLJ2+avtU/jLPkJu1WYvXaNKMUblOhgXli8Fx 1wEbIZucjpbUa4Gye4M6ioquaqW/CPIv934ve2HUKlDDLSle/WDI/THXz3xQEhaosvpp qSCakviBBqHtls6nyxgFc6OEE4M/MQC/zceDQ= 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=otaYV6j662M10NzQ4yiv2CYjv9VXe3Cvlnnyzozd3nE=; b=OhGL5DMI5x3c9XysH/EIaBGvHpVb8cIZ3Xc+3M3OIPth4pV7gWUf1RdhICf/qxkD2/ s3/fC+GZi8Xi80vi7a5f5TRdBqivl3F4bjDvhQuuV10Zpi55/LxiQrWIsen3qQu4OEpu NlzDj8VjFGJg7tPbSQEzEQMBLft8aIJ6DSjSL2mKBtXxWCsSIIWF6C5nTPWv7aTIeIDz H8HCQm8Gp+GiZa393apU4FUxW68kefydyhe6fVXvG7CF4oWi9KjlbqfLdmNYg8QeTMYk aZCznGcv1YA/2SqlzOugTl/03GR64s/ECoqf7Fr2OP3pJwGPO97RPLLM8u1T9SG0Jf8l GZfA== X-Gm-Message-State: AKS2vOx5slls4hZwySvQtv5Ynw4U9/XjrdhImh6QxH0/2Y9B7kI9Fnjs OO+eC93LBSsCs5fH X-Received: by 10.223.166.8 with SMTP id k8mr20003872wrc.172.1497951445077; Tue, 20 Jun 2017 02:37:25 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.37.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:37:24 -0700 (PDT) From: Benjamin Gaignard To: benjamin.gaignard@linaro.org Cc: linaro-kernel@lists.linaro.org, Support Opensource , Alessandro Zummo , Alexandre Belloni , rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org Subject: [PATCH 15/51] rtc: da9063: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:23 +0200 Message-Id: <1497951359-13334-16-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. Signed-off-by: Benjamin Gaignard CC: Support Opensource CC: Alessandro Zummo CC: Alexandre Belloni CC: rtc-linux@googlegroups.com CC: linux-kernel@vger.kernel.org --- drivers/rtc/rtc-da9063.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-da9063.c b/drivers/rtc/rtc-da9063.c index f85cae2..c0e140d 100644 --- a/drivers/rtc/rtc-da9063.c +++ b/drivers/rtc/rtc-da9063.c @@ -227,8 +227,8 @@ static int da9063_rtc_read_time(struct device *dev, struct rtc_time *tm) { struct da9063_compatible_rtc *rtc = dev_get_drvdata(dev); const struct da9063_compatible_rtc_regmap *config = rtc->config; - unsigned long tm_secs; - unsigned long al_secs; + unsigned long long tm_secs; + unsigned long long al_secs; u8 data[RTC_DATA_LEN]; int ret; @@ -247,8 +247,8 @@ static int da9063_rtc_read_time(struct device *dev, struct rtc_time *tm) da9063_data_to_tm(data, tm, rtc); - rtc_tm_to_time(tm, &tm_secs); - rtc_tm_to_time(&rtc->alarm_time, &al_secs); + tm_secs = rtc_tm_to_time64(tm); + al_secs = rtc_tm_to_time64(&rtc->alarm_time); /* handle the rtc synchronisation delay */ if (rtc->rtc_sync == true && al_secs - tm_secs == 1) From patchwork Tue Jun 20 09:35: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: 105985 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1280248qgd; Tue, 20 Jun 2017 02:55:15 -0700 (PDT) X-Received: by 10.84.132.65 with SMTP id 59mr34381039ple.21.1497952515777; Tue, 20 Jun 2017 02:55:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497952515; cv=none; d=google.com; s=arc-20160816; b=XyxCVsp37xcBXY0Z54UDPpc1SK2q960nXGxJrHz7ZHnkPR/OpnqRzP2wP0A4p9P8MA rvBV0pFvHQK9W1/BWUVER0PppgrcgN7Mwc+f/pI8vCA34syEckzFGSISVNAXYuvP6EUm ztnjvJiIxy9rGgXnXfDY4DgIN+PLgIaaRpHtf5B1K8v/ClgqtS2sw7y5J1NhHzuGg3Pg fMTDDW4qpbM98s9znrUlYqWRcnotLhMoL/2BjMGHo+gcOYURqqQamY1Fbylq1IEscJ8b 8gJtnyupYvvmIcxv+LmOeY7judOSTM3uKEeF+sNcT2bAedhszlaIpJ3u6dp5NwSQqH+6 zVbA== 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=cgRDLawsFVJmKzgm0587x3QLAVmQg3RwaNcw862xVNDIepLt3lg3u/ZEbCyP8D/s/r VlGZr9y9pWmfLDrDjnyf5xDMwzLY2uQiFtjCwoBii9l2j62xDEXZj4Bsa/3FXnBeDeiC 8/pein3EwZp6Xdn/El+DkR8r0YKdeHDXa9+3vazefVy1cK/Fkvc5S11qJKC3x5RwU60p TLjwRlZ9G3huj6wO89wLa4NyLXSuqzaKE83+4Xu2B0KLiWCegClZDoRqcaDlkN8DJhNZ edAiTTS8V6yShq6b1KF5C+teb31xMAcY3yf9bdjRBnrLBw7eI0Ii+GzIzPZ7+1wfLVk/ p8LQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=ThMhN1Zj; 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 u14si8325720pgb.287.2017.06.20.02.55.15; Tue, 20 Jun 2017 02:55:15 -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=ThMhN1Zj; 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 S1752049AbdFTJzN (ORCPT + 25 others); Tue, 20 Jun 2017 05:55:13 -0400 Received: from mail-wm0-f44.google.com ([74.125.82.44]:38440 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752676AbdFTJh1 (ORCPT ); Tue, 20 Jun 2017 05:37:27 -0400 Received: by mail-wm0-f44.google.com with SMTP id u195so14559858wmd.1 for ; Tue, 20 Jun 2017 02:37: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=bn8NCtMSsa4AlKiUPT9/9okjnlHEoQxc4622FjHf0xM=; b=ThMhN1ZjHyrjA//nEflsR0Fjxe9E4qrwrMQZNIArsumhw2iSBWv6kQtH+sOMIhk+ve 0JTQTtho2+vXud1v6gOZS4/cNrPBek0c1WKv6UBvw2K1uWCJdX7fxv8X6TRHjaws5Xtx qsCoEDW2IyoVCHL/xzq3cJISVDM+tIj4lquX4= 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=sQtMJjQyOAS9VH1HG0UGQN0CSxFblo2kuyoQ+H28r9uXiT/7q+nFF847p0FseiSnEt f0pTRq0HZARQkRgocqErIKmCRXInM9zWF/GRub9wjSxLabfSQ3JWPwTLMJT/O+OLgXD6 yOzwAjUHICzFij7ww90+AerbqFQILYQp1poQ3kKeBIaf/I+UmiwjmlHAF/Z9dchdlkZ7 s929P6T7SyrczticC6qDW8R3u1R1QtLaY3lUJQ7aZ3/EjwKr+MqY9DvFSyllvCqR9hzB FszEn9iedRuOrgDutTmzANzp7Deg83ei/gxg7tdcsFWb1t//YUpxnk7VFENQCczR9N4o InvQ== X-Gm-Message-State: AKS2vOzkKbx/zJsZpOVwdd0dWH/3nfk2L7QV6ybOhHJDvW43dBDhzDTn qEu30ebxGqIyA1rMtchx5A== X-Received: by 10.28.134.3 with SMTP id i3mr2015132wmd.1.1497951446582; Tue, 20 Jun 2017 02:37:26 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.37.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:37:26 -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 16/51] rtc: davinci: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:24 +0200 Message-Id: <1497951359-13334-17-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. Signed-off-by: Benjamin Gaignard CC: Alessandro Zummo CC: Alexandre Belloni CC: 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 Tue Jun 20 09:35: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: 105948 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1274759qgd; Tue, 20 Jun 2017 02:37:52 -0700 (PDT) X-Received: by 10.84.131.41 with SMTP id 38mr32627276pld.262.1497951472477; Tue, 20 Jun 2017 02:37:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497951472; cv=none; d=google.com; s=arc-20160816; b=NgmMMAFzI8Lxb+jjY1s3wtvQBaKG0c9easxejDawBRssEhQmS821SRGNcEyAG35r8U sZenO5kmUYXRSeN6eyVcFbPFE1umMkDO0JV2qdTjR2HIMDyHW6VMA08tInDMQQzai6Lv 6+2FQKYvYpXYuTYzvSPiq4B35ZZYyDmqIvgSMGqrdzfrKdkNaduJ80PT8M18ebKDnfMT C43wDbGL2GNNsK2nKj3L1KikLZou7oKyy4LboNQYoLLwMyBK1qPAs0WvEykfifCapSSO dfAYzpNVH5WEK+W00Y7X8UoF/gQCIV5eipy0Xxk7Q2XnIOrb6T20ZLGDP2o6ydKiOanH KOpQ== 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=kS6aC5A795MBrxBfouxxn7x9+2H5+KOclLXysVS+N0A=; b=B9LyObgaIS0o/dZMZdpJEJaoZN3wQVWX/bkYcJQ/fD+HSyEG3QWqQ+icPNM2dnqllt s5IVBMhDsKxTKczf2OrUWQffi6e2Ksz9uP46PIYJYMIy4pl5g7X2KEtrOQdfB1TMLDdc I2xEkLYkBPmjFrh/O8OgUzdzM10sHnnQEBi9Hsxl3UOurczIpXuok8qYJb2mzVz1EICR lcsI9Peo2u1c4yZ+snWwWivee88Sq+wgZ0fg8vpa6E2ZCH350pDtis84F80lwj1Ao9WC CT7cWe6uetFE6/K4v4qBkrreOIVC6uMzsa01YIMt3xUgFT6lH6H3cnYn/n67TwGmerYj tEPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=Rao/3wiT; 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 43si8646748plb.270.2017.06.20.02.37.52; Tue, 20 Jun 2017 02:37: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=Rao/3wiT; 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 S1752824AbdFTJhg (ORCPT + 25 others); Tue, 20 Jun 2017 05:37:36 -0400 Received: from mail-wr0-f175.google.com ([209.85.128.175]:36799 "EHLO mail-wr0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752751AbdFTJh3 (ORCPT ); Tue, 20 Jun 2017 05:37:29 -0400 Received: by mail-wr0-f175.google.com with SMTP id c11so32946170wrc.3 for ; Tue, 20 Jun 2017 02:37:29 -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=kS6aC5A795MBrxBfouxxn7x9+2H5+KOclLXysVS+N0A=; b=Rao/3wiTTeeE7T0SjV0PQtKw5U2Sfd/X9sFCg5B6MwgcWda45rZWIcC5xv1zFDbU8M /Kjcpo3NNA2O3qTL3NqjRpjKyvDbdhOYAo+MeYLTViFISilRAhlD7JC/iG5Ep6ts4pWI nbIVzFZCZWMsvdzuZGHWakhkSWuIY7lUECh/E= 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=kS6aC5A795MBrxBfouxxn7x9+2H5+KOclLXysVS+N0A=; b=iRBMcqQ8rSYO2modjX3cANIRIlapUYn2IL2Yl2QxXVZ/P6x3tXWQX6W+TzE4TjcFac kq67Kznk70f3KzdVBXJ5Hpw3dLvFIDFNwJhMZcTb4I+fIpTIcNkvMkwoaY+0/9i9Zq8b IR8ZP0FWnMAFPh42m2Ggu8Ww0LSzwfqz1KtcjaMaYd7E78lUnVE4F7DJckiqM/H0PuD+ SDpWQ0+MAKqcsGeQK8++jVMNabgpd6sQPnaifoPdYUf9wMYSz21MBd0BYO/H81H5nyjN oOHHuaNjyY6RWwQk/e1vSddayXuw9tuvPmzKn0/m9owPIqXvChE09JXasW1e/QxSnMcc i8mQ== X-Gm-Message-State: AKS2vOyxKbkLMu0Usgx6CQYC/h3/nBLdbPT1Zbr9qhsza06aYVSgOrKS YlEPfL/5rj7v3VF7 X-Received: by 10.223.178.68 with SMTP id y4mr20188452wra.196.1497951448538; Tue, 20 Jun 2017 02:37:28 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.37.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:37:28 -0700 (PDT) From: Benjamin Gaignard To: benjamin.gaignard@linaro.org Cc: linaro-kernel@lists.linaro.org, Baruch Siach , Alessandro Zummo , Alexandre Belloni , rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 17/51] rtc: digicolor: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:25 +0200 Message-Id: <1497951359-13334-18-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. Signed-off-by: Benjamin Gaignard CC: Baruch Siach 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-digicolor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-digicolor.c b/drivers/rtc/rtc-digicolor.c index b253bf1..01b0fe8 100644 --- a/drivers/rtc/rtc-digicolor.c +++ b/drivers/rtc/rtc-digicolor.c @@ -106,7 +106,7 @@ static int dc_rtc_read_time(struct device *dev, struct rtc_time *tm) return 0; } -static int dc_rtc_set_mmss(struct device *dev, unsigned long secs) +static int dc_rtc_set_mmss64(struct device *dev, time64_t secs) { struct dc_rtc *rtc = dev_get_drvdata(dev); @@ -161,7 +161,7 @@ static int dc_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled) static const struct rtc_class_ops dc_rtc_ops = { .read_time = dc_rtc_read_time, - .set_mmss = dc_rtc_set_mmss, + .set_mmss64 = dc_rtc_set_mmss64, .read_alarm = dc_rtc_read_alarm, .set_alarm = dc_rtc_set_alarm, .alarm_irq_enable = dc_rtc_alarm_irq_enable, From patchwork Tue Jun 20 09:35: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: 105980 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1279100qgd; Tue, 20 Jun 2017 02:51:34 -0700 (PDT) X-Received: by 10.84.136.129 with SMTP id 1mr34351146pll.213.1497952294339; Tue, 20 Jun 2017 02:51:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497952294; cv=none; d=google.com; s=arc-20160816; b=OMWvcus3UC4G/53XB5LGThngkuG+Dq99FGNfmBVYVtyVAUjTPGTh5refV0WuRRdSwi yG2hI3EnMtv0NQ2ycxpMDpzwI+PJM/lmbzow/LvXeX5VS4x3E8k9eOyvcHkOPvfEHYzr WmehU1O8/QM4zp91Ji6RqOeggrYn8QShmC01U0duLXR0C2dqbGYGPlhGoRCUq8eoHb7f XyLfxS8/GbYzDJE1x2oYy+UzYmYctOiSGXnZJskisbxwmwEVro4kCacMuk97SGqhXTr9 Nh6abiC/JAxTY1l6daxmn5wNU360fJtJhcn5Ds+Ew/LW+rDPtE2bA4ZSZIMOZUYLJq09 Plxw== 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=CFmWpgg6G+obBIOMIMFHB6fN8CsAS6nD5xQQgKbS17U=; b=w5u8dTe3qSKIxzrbHfmuSt7qosJKS9H7Ani/vPg0aMcJDIk0pSQwdLShrNrJLfflfr PO5mSfK2XMZcMMZ/DS6YR39LNBn8TAAn39YFtY7pxzuyQe31AuYCK/cpvJ08uJVO6rj0 +gyu+BPTag4MvyikCOhdn2dZcr0h6rvCfstdhqte8OUsnQHPCrAlhyAjCCj1kA/e7odQ Uftq8ENv6nUWVy5ZpAoscCy4LHGN+FCznzfwQPTpgbM/GytL6fxxGx+amLJs1UdL1LgB nU+L9DE83ftjvKCkqx7rf1rfS/dhvdzHIQIOgWDLRsgWf6ysZO/9m+0qj3d8e2KH4+a2 n+9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=ciYUGsQj; 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 f1si10592015plb.394.2017.06.20.02.51.34; Tue, 20 Jun 2017 02:51: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=ciYUGsQj; 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 S1752458AbdFTJvT (ORCPT + 25 others); Tue, 20 Jun 2017 05:51:19 -0400 Received: from mail-wm0-f47.google.com ([74.125.82.47]:35216 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752863AbdFTJh7 (ORCPT ); Tue, 20 Jun 2017 05:37:59 -0400 Received: by mail-wm0-f47.google.com with SMTP id x70so16026431wme.0 for ; Tue, 20 Jun 2017 02:37:54 -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=CFmWpgg6G+obBIOMIMFHB6fN8CsAS6nD5xQQgKbS17U=; b=ciYUGsQj5i1Tya7/bex3utqcbSzF6Dkd1joT5R0gtVysWFmv62YxQTBGysm53/hKEw 221DvjkfWWC6GTAMrsKmMxR/3VimjGmEGJ8yC0ZUdMwcx/coZpMzN+UbHDrLvo8LG6YB 6TXhFW9rj2grdK4bsm+W1cl1JcDT8mLcSsqcQ= 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=CFmWpgg6G+obBIOMIMFHB6fN8CsAS6nD5xQQgKbS17U=; b=cUWzan5mfV0CDvlfpxg2oSpWcEZekG/Am1fxCtuWEx2GTp16bN+kxWjcmClNpfYKC4 zwdoxMXoPb1XFHB66pLP8n7sKUgXX24r1esI9+fpOG1P2p29ilyVktnOaIkw2lpOsgX8 l5fifHnFgtjXRIlWjFyhjlFpRQ5iQoiK9r7n/UaEvyryMWc8jp5mMu8MzR5LtNKR29V5 qiwvDNW4GoLlGnYmgK/4Vprqkfs6PSj3o4DOWT8sP13lba7F44313o+w2E/iOwG5jcy0 31ziZMB+j1yev0WG9fOFGFX0rZ1F/1+Mm8DVsHGVD/ox0PyYQ9ymFfHXAjLUQMfKZsjr 6u5A== X-Gm-Message-State: AKS2vOzaFRlqXnelNIrzyYLia+mlbzrm1TKci15L9FomvNe/EcjtAQzB AN6pCDr+EB00nYfp X-Received: by 10.28.32.5 with SMTP id g5mr558005wmg.70.1497951463522; Tue, 20 Jun 2017 02:37:43 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.37.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:37: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 18/51] rtc: dm355evm: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:26 +0200 Message-Id: <1497951359-13334-19-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. Signed-off-by: Benjamin Gaignard CC: Alessandro Zummo CC: Alexandre Belloni CC: rtc-linux@googlegroups.com CC: linux-kernel@vger.kernel.org --- drivers/rtc/rtc-dm355evm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-dm355evm.c b/drivers/rtc/rtc-dm355evm.c index f225cd8..34544b6 100644 --- a/drivers/rtc/rtc-dm355evm.c +++ b/drivers/rtc/rtc-dm355evm.c @@ -78,17 +78,17 @@ static int dm355evm_rtc_read_time(struct device *dev, struct rtc_time *tm) dev_dbg(dev, "read timestamp %08x\n", time.value); - rtc_time_to_tm(le32_to_cpu(time.value), tm); + rtc_time64_to_tm(le32_to_cpu(time.value), tm); return 0; } static int dm355evm_rtc_set_time(struct device *dev, struct rtc_time *tm) { union evm_time time; - unsigned long value; + unsigned long long value; int status; - rtc_tm_to_time(tm, &value); + value = rtc_tm_to_time64(tm); time.value = cpu_to_le32(value); dev_dbg(dev, "write timestamp %08x\n", time.value); From patchwork Tue Jun 20 09:35: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: 105979 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1279037qgd; Tue, 20 Jun 2017 02:51:22 -0700 (PDT) X-Received: by 10.84.171.193 with SMTP id l59mr35234465plb.139.1497952282560; Tue, 20 Jun 2017 02:51:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497952282; cv=none; d=google.com; s=arc-20160816; b=CcnCKlJVc1YxhgyrbPD/7AlFvikPoMeERdLPkI8v6GGIwUNbTIyeQh2QyFoPvBs/6s rzFJkLIHAbHJWKNucwxb3phvZga7Epn35wZsFT5hvnLQiDrpybNDV1x8u+i+4Ec3Sj5x LYTnmL4Aw7eDQt1hWfuHJLrVfBClponGYQeWoezCCCesYQeaR4cnmvcL4kZL5sWPcTOS 8Tdpydq+h6OiARgKysAzSPt2MY9k13Y2RXbyqt+QuRRGBXoE4pTS5tJfsidnM5E/YLID 5gFsCvAtwyAkEBgwui/SJtNJtfTnEKL4Ntx71pf4fnhcraVhB7uro+bJnAYSzb/FgJyz pFHg== 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=t3LixsOSxn4CiQfccZTPhcEsUBX+pUtlG2m8zNKbPmR/KTzJNS37xmRLHpYXyzUA2r wzFO7AdUz3CG2/rEHFOyE4TPyhyLyrMsbql9xEnu6l6gf89R5b50vTtBPDpXbHarOVl6 NdP1Cxmwoj7MvYZkym0ru7DKEQaRLT0OALCeehucdQIO4wcjTLpfu4l3S91ovVkdSoeB ueo9P94j3L96349xp4GRoe4ZzI5ZwTY1p/yCpGyXfJhdAgdptMIutx1zQTymnAVf0L/P ckdPYWhZydmvVN5MWWyTIWAABSW6xDtAlM4tg8RXmVJuwo13JVkv9e+JG+PjUs4ovojg wRIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=KRgPhkcU; 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 f16si11557584plk.281.2017.06.20.02.51.21; Tue, 20 Jun 2017 02:51:21 -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=KRgPhkcU; 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 S1752880AbdFTJh7 (ORCPT + 25 others); Tue, 20 Jun 2017 05:37:59 -0400 Received: from mail-wm0-f47.google.com ([74.125.82.47]:33120 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750925AbdFTJhx (ORCPT ); Tue, 20 Jun 2017 05:37:53 -0400 Received: by mail-wm0-f47.google.com with SMTP id u185so5613432wmd.0 for ; Tue, 20 Jun 2017 02:37: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=xQZnvb6WkHY7uiUpIFUonTnxXqndHkNZi2qqU6KJSMU=; b=KRgPhkcU82aihO0QUlIhy4dyyp8DekrDE5pD/q0Rfh1u5mllkJwkoqFZVLrqgpc2sO ivkfJGYYc+K8WV9vV7MpoBFj2iLYxwQjj3xM0bCsFF59lE7pOLbcbzYWCXJAUkGMGOAh W2RY4lW7m0ma24rGQ19jYlEwZuKLKygaH/NXA= 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=YrUZbbKT/m7KaFEkO9+1sEapereILD0qLVxj7VbCYyZSuv7M7NwtjHPTmH0FeGBl/k nCpl3qXh+68C21zjcfagO2o10EJJqUkuEnCi9XQVxOd15Wt4m9K9cobAyH2E0B8mAsrY At2ypQAto2YbwijlToOKKuE3I4PVLddlVhWXAyUCWMAAQ0HKj480OeTWlrV62BRu8YzS okPtNJhpi17Ui7W7425YhQqTzuxGJLr0OTIXbPjVZF0yVziU/bOZ+/Yxzsrx3QOS5NBv QFfvxO8FnfxHJ/QWFztFBLp0nNMOLUqN7ck+aMKcI8YpSjVp/ZqMBNiqIbJw8jAzHkII FI9Q== X-Gm-Message-State: AKS2vOwUnmiuBnFtjVC9a8LLOQjeVOSPR0Bon0CJfp7f9TQ63jbZjt6f 93kwJPf0I6Xll8cf X-Received: by 10.28.92.130 with SMTP id q124mr2168459wmb.21.1497951466868; Tue, 20 Jun 2017 02:37:46 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.37.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:37:46 -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 19/51] rtc: ds1305: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:27 +0200 Message-Id: <1497951359-13334-20-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. Signed-off-by: Benjamin Gaignard CC: Alessandro Zummo CC: Alexandre Belloni CC: 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 Tue Jun 20 09:35: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: 105949 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1274864qgd; Tue, 20 Jun 2017 02:38:11 -0700 (PDT) X-Received: by 10.84.217.152 with SMTP id p24mr10520135pli.276.1497951491013; Tue, 20 Jun 2017 02:38:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497951491; cv=none; d=google.com; s=arc-20160816; b=XKrW0DlOXxxcjk8mYDmLhssGkvkPVNWwkI2Hm05H4ukC+Pdz6FfzPHg8iKgVzjlhB6 RUl2WP6Trf0ej+e5TJlevPzNf8JN4O7jZeUbPxlVSMXazzepsb+HJxW8Q/Y6TwgtQwDF t4uSyWdEc/qXJxVeXaf8AHEibcemw5+7LVi9K7BsMiTCinhVXudbo3HfIreZAxcgmG6F 0dIHrGyoTuAiyEI7Y1Nuieos2YDmHxRo5UUhlW+p6tFTt2LCT4eoz9NCVW3b4TrluTFN 8cauGymrsqRso+LHwmYMAI/z+kRsruTJFvOpuC5Yxm74OF/p+zSYQMGMdf+5JN6/t/JM rxPg== 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=jSHJ6hfSDoq2Nbw3rFdquaj8RSk52cJU29rwPHw5CEM=; b=HCCmmEXlYXQMUAu8rHJUjn5bX+0EL8v975No8uxGKisNNLwJ3oLCIoJUeXDQGVR+J9 1mNnYfBfbHon+sXuu0HTihzs/XwWIj9HBEKkDsCf4oaY49YQL4QEA72KCLaYfLqTUqoW Ey41gL78KOZemLFagFEb5UfyV+aYpuMjetiBV6Olh+/klFsVZ6OY9o6zn9DsNwtDFgor iTz8g4MwHWmPPfxAXkjpU9siTZs/DOJzrBvsI+LVEWadtfVVs1SvtHkqRe/Dsd+9juru G4zshlyASxw7w2JkCNv/D4NI29ME17FikV0D8beDvNrJm58rorM9QLvXLM/uusW017t7 zdQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=YAicrbXS; 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 v1si11150641plb.188.2017.06.20.02.38.10; Tue, 20 Jun 2017 02:38:10 -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=YAicrbXS; 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 S1752835AbdFTJhw (ORCPT + 25 others); Tue, 20 Jun 2017 05:37:52 -0400 Received: from mail-wm0-f44.google.com ([74.125.82.44]:38662 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750925AbdFTJht (ORCPT ); Tue, 20 Jun 2017 05:37:49 -0400 Received: by mail-wm0-f44.google.com with SMTP id u195so14568911wmd.1 for ; Tue, 20 Jun 2017 02:37:49 -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=jSHJ6hfSDoq2Nbw3rFdquaj8RSk52cJU29rwPHw5CEM=; b=YAicrbXSJGPFBWPCHaxmRsl6MVM86zdzY5XaWZG7Di2ecUFqd/H1jZEPDteP6vKBhw gKZtm0pS76ySeM2Ikx8xAUZOqJQ7Zc61MqOeXj8oWyA/PJV8Tl31OHSD9hoEWi2oD/v5 aCjCuy+lafZTM712kGuLZ7/JpJs/6N5HHvznA= 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=jSHJ6hfSDoq2Nbw3rFdquaj8RSk52cJU29rwPHw5CEM=; b=EyHj/U/ouu+2k7isjj9m3mmtTMcLGL5/2/LyKeKSn7y5bEOO+C/V0N9u7eyCZVZ653 W68xDnB4baCfUjjEZPLUrmBs5VMkpLdvb2iHZKQZLG78ZFLulSH4CEotopXqwnZYhC52 coAsqO8WQKZWKJc0Z8T/kq8qNEXfphvqiPDRU35bv6jjtrjUHVwN8AXMuqRzv6Qix39F h2QNF/Drjyy26mDHJnKE2QhAIiDzZZatwnzT//8AWdZPv8EkeLoNzkM8A7eNGaa5LBdg 8y7a5tFYe6iiB1mwkUHPc3BW27pZuoUHaMD5i9iFzpkIR/FJtJkYipQYBPv/x89CwBJW 413w== X-Gm-Message-State: AKS2vOxy2Z6RwX7yGQwWeMYs11r1DwKrikvvNQAbjypzXglqJwzq8PhC c3GSpI5Jr6jalV/F X-Received: by 10.28.59.212 with SMTP id i203mr1897295wma.18.1497951468472; Tue, 20 Jun 2017 02:37:48 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.37.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:37:48 -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 20/51] rtc: ds1374: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:28 +0200 Message-Id: <1497951359-13334-21-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. Signed-off-by: Benjamin Gaignard CC: Alessandro Zummo CC: Alexandre Belloni CC: rtc-linux@googlegroups.com CC: linux-kernel@vger.kernel.org --- drivers/rtc/rtc-ds1374.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-ds1374.c b/drivers/rtc/rtc-ds1374.c index 38a2e9e..624b915 100644 --- a/drivers/rtc/rtc-ds1374.c +++ b/drivers/rtc/rtc-ds1374.c @@ -164,7 +164,7 @@ static int ds1374_read_time(struct device *dev, struct rtc_time *time) ret = ds1374_read_rtc(client, &itime, DS1374_REG_TOD0, 4); if (!ret) - rtc_time_to_tm(itime, time); + rtc_time64_to_tm((u64)itime, time); return ret; } @@ -172,9 +172,9 @@ static int ds1374_read_time(struct device *dev, struct rtc_time *time) static int ds1374_set_time(struct device *dev, struct rtc_time *time) { struct i2c_client *client = to_i2c_client(dev); - unsigned long itime; + unsigned long long itime; - rtc_tm_to_time(time, &itime); + itime = rtc_tm_to_time64(time); return ds1374_write_rtc(client, itime, DS1374_REG_TOD0, 4); } From patchwork Tue Jun 20 09:35: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: 105982 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1279311qgd; Tue, 20 Jun 2017 02:52:12 -0700 (PDT) X-Received: by 10.84.174.197 with SMTP id r63mr34427024plb.237.1497952332623; Tue, 20 Jun 2017 02:52:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497952332; cv=none; d=google.com; s=arc-20160816; b=yDCc5VzF9kvaMYLfzFRpLDPmDkjsWMsFXlLRUGljUJFcT0kdp8tCRzqaT10Fj1oI4U MsZr6OheMOc774C4hD/G59flAAy+V0yjl1JXnshdBxSxAJNdJpiN+fU3VsAFaUh1QZJi SgLrCP5F7eQb3VXbW/5F9Vh1eTXtmlbjHAmyAA3Xtm8+xcA/N9bZee5pE8DMvjYjRk5l iFXCDRfQK9qR6T7zWJ5M9DJOqcGwMDbQ1V8ieAgGy7dl0EMyV5K10RUbEIG7/MN+NpzC Kbj+pYuH2XPNyq/EQeVR72KX5WI/7nCuP0ZaxwEU4ea2TcaPvIsdE/x3q1giW22uLA02 rVLA== 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=uZuOWhCEubD+A81+XOEW+Miotw4DY25wR8sNTWaFKg9Bd4M3cwEPzmqN1WKSePhQJh rEK3fjz9AyVDnhZxnQgHLf4KAg3F7ozHcr3rJAR98isyz6fS6qAHHpeyqVl6ScFqoj/G ur9+VBKM6FXFfjf344P9d3ia0YGwMThQp+itWu1QzrURsUf4+fs0Q5838pZPyByQ2A4D +jrJflppoXkGl3fu9eVJ+DMyrK1Fdl3/gF00TGkZHsIPJNMVMTh3rx0pfWnqSdyewOuv RCB+tGeAi5kFDo7xe86gLxIl+GpXeT2+aLXe6ko8CxHIDT7Qz5UNrCqr4dtyPfnpGYYK Sxew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=QBeYmo6D; 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 l20si10309362pgn.282.2017.06.20.02.52.12; Tue, 20 Jun 2017 02:52:12 -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=QBeYmo6D; 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 S1752681AbdFTJwI (ORCPT + 25 others); Tue, 20 Jun 2017 05:52:08 -0400 Received: from mail-wm0-f50.google.com ([74.125.82.50]:34200 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752052AbdFTJh5 (ORCPT ); Tue, 20 Jun 2017 05:37:57 -0400 Received: by mail-wm0-f50.google.com with SMTP id d64so23692342wmf.1 for ; Tue, 20 Jun 2017 02:37:55 -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=QBeYmo6D109IlaTHFFpNt+m35XWzGL2ZO2tD5B82YtPQWejVAU/p+HDWq/UQCzFN2s bvVmzbMDo88znXhHFt1GpMViH365vO8WY95ahgGPtm/jgORoZor6hE60Z67JLPfYYzZo UnryFmXu7muI5MLIQz/5mTj1nTxoA7US6sW5c= 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=HCy8Vu4q3WMI+IFfvHA1Tgjqk5mpDp1pZuBaEz0zNL3bAU63SNt0kI75+/U5AOFzvO DUTRNLj6R6hlVAPimDWavqaOUql0TvDWT7/3mNkz2EZ9sKmwnGoxDrc95Q7Z0fCCSOTK ITUWciRI6XnUTSnVpm5y1SnFLcjrhpYbhhaifUc28c96I10zW7/OJWqy2BH83U5m68d/ YrQfMwoTereLctu+Ln8ZbWfVAFtvh8dAvtSHKavM3bXYABeA8JkH4UaMLywuEQyc4ucv MGf8vgIWqE8VrYQr0mRZr4TmvEF6uZkdfvfQ1dsejqIZYTgus1BXzppUPsvJ082Fx5UX QYjw== X-Gm-Message-State: AKS2vOyOA3drBm6Rmm0QN27UROA/0qA/P6HY1/MbS5P8ACUbUVOw2hAd fuA8NVmWx9poXWki X-Received: by 10.28.143.16 with SMTP id r16mr2210210wmd.50.1497951470018; Tue, 20 Jun 2017 02:37:50 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.37.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:37:49 -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 21/51] rtc: ds1511: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:29 +0200 Message-Id: <1497951359-13334-22-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. Signed-off-by: Benjamin Gaignard CC: Alessandro Zummo CC: Alexandre Belloni CC: 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 Tue Jun 20 09:35: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: 105950 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1274866qgd; Tue, 20 Jun 2017 02:38:11 -0700 (PDT) X-Received: by 10.84.148.134 with SMTP id k6mr4966113pla.150.1497951491393; Tue, 20 Jun 2017 02:38:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497951491; cv=none; d=google.com; s=arc-20160816; b=UCR527XHscfF7siROzTbeePvhwiWVzmdhQxsnXE2VhBMOkm7gMwqH5FjBRRY+SsDSv CiLtmSME5vuv8Lmon4WK1Jq2gJXwA0FlEIlEbYS/r2WoeAv0Zs0MxD6kz/jsxhGMj/FA cUSOSJrjaKP4xNt5pP3+MBrIn7zXT/2fvfCqxWfvLA3v1JkqSg4eaXUOSWQo/2EgX6uz fiBWvgYtP4Qe19NNt7aYI0JlWiZhoHI9oW+zRrq+l9Bka8czlLZ1D4iF31fOutzkqcNh PVmsyh9CEoJF4KGcFYEtFMz4jbhxvXCf5APpfSjvJwZOroJrhWjjtxjrCHZvWJovRGWg +WZw== 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=jcyMN6IF1SOXInq40OyBtWt4So9A6Jsw8L9t8gQ5TycCQMU3TNnKW3HfEE213IoQzz 4n5jSZTWSVZEFzpsKz+2bYDaqjFfcqCI+Ygsl3Pyinu1CHMQRvxBTYq+MQJ0NeuIVmhE jt9qWJzcduSNjuBKkxRSnwwFclgpMuE7iZ3UYPQLKswEToYKwmwgdm0N4ai0U0iTPYqn Y8xWOKzDdCs3olmuIdzYqyl5QTaMNDJ4708K8q1kNaTBx2UKZBrQIz8rQfO7jQSGN020 Uc+KeCc+i2rngTTd72qz7hV4JqGxOd2VgA1vgD4w46ULbEPjcQeib2c+kGYCiFN9t/eC 0pNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=Eqqd9uGz; 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 v1si11150641plb.188.2017.06.20.02.38.11; Tue, 20 Jun 2017 02:38:11 -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=Eqqd9uGz; 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 S1752897AbdFTJiB (ORCPT + 25 others); Tue, 20 Jun 2017 05:38:01 -0400 Received: from mail-wr0-f181.google.com ([209.85.128.181]:35906 "EHLO mail-wr0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752836AbdFTJhw (ORCPT ); Tue, 20 Jun 2017 05:37:52 -0400 Received: by mail-wr0-f181.google.com with SMTP id c11so32951886wrc.3 for ; Tue, 20 Jun 2017 02:37:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=a8OvcgxX7DKilQxXn0w3WL5mzEKXYuDNJJmY/pe4xdM=; b=Eqqd9uGz1YgcUs8xs8mJh+CpzjFcvWexldubGNYlA1SuZHQ1ucm5veEDDP1XsDgq3X aSGWs+qgRTIfq0wQ3Rti3iq+cutDY25W0xv58vlLFH0S54xIJ5CDIisW9rebaWklwvar RU5fDV1ug9ZnI/Mw/Jcg26796Cp4fXIVyZNqo= 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=Drg0fYF66hRQ9CGFoOoFvoDnMdF98QKijw7o+uooHWNiXj0i23rTXqBiGucfWWMjMl n0LtkW2ab/ewJvOTxbbNSyjnqZSGnp8s+4UxB9AZ9fE9nw1fkXk0rSZse3YPZPGrKhtS LGAZoU14KTVnJzR6C3ro4zdOKy7me1yU4iHepyxTuxubEhF5HC5y+Vxu2xaCYnLg8u2g ch9i9U9CIQulGDOLwLxeuKCLs3crxnXDArzjTnTiSRZyRU1fxt8DOHUwbNBfpKe9ZvTk QZIzJB3leRaplLlyjk8zLJyv0mMvO1msDAGPQYVJ5OE4KZVcmxqNbpn9/6A3diB7q2PZ GBQg== X-Gm-Message-State: AKS2vOyytp1J/bOiWbEh02tBZgq7r7J6KEO2USk5N/OSsM3HIPwOC4Q9 e7H48MsWv82yFHbk X-Received: by 10.223.166.196 with SMTP id t62mr17950307wrc.52.1497951471597; Tue, 20 Jun 2017 02:37:51 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.37.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:37:51 -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 22/51] rtc: ds1553: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:30 +0200 Message-Id: <1497951359-13334-23-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. Signed-off-by: Benjamin Gaignard CC: Alessandro Zummo CC: Alexandre Belloni CC: 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 Tue Jun 20 09:35: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: 105981 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1279307qgd; Tue, 20 Jun 2017 02:52:11 -0700 (PDT) X-Received: by 10.84.178.101 with SMTP id y92mr34677464plb.116.1497952331706; Tue, 20 Jun 2017 02:52:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497952331; cv=none; d=google.com; s=arc-20160816; b=uyQwGaryDcg9EVTInTf1aRL2LhFLdJYlT6Z1uV8lYNLNvPmEfPzitH+rEkhgR5iP/B TKy2kmr02k+YCVnHAlwMPr/I9nrJYH8hpnot3SAaJulWpxuXlD/hBcoYN1tt8ydmnIvo RPMFicYrZ94B6K8SciXCGYkKeFv5Ny53akc6K+c9tbmnQueekD6Oe/YKEH5zP+OVCHSg 8TwgwkhIYLTRNdY3TBo/goFn0mndlFCK4h9eA7xUmb+FcvzMZQB+NO3bcWMg3DWVEYch Gt98zzqYNl0KyXuauLVeuxIxVq47Wou0oBpbiQf4ycYZe+4m1HOm0JDZWsWDbN+uC76E /kpA== 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=lE5peXKkK5KDRu4axlEoImezWiuwcRc3ccP74XPTEf4=; b=XyF4YvXxBZGYEe4U1xoXlSBMxrGM7NfGTeFQIlIwaSTt7QVNgPsFkEbf0pUMGfRdU+ NE029SdVhDyWDFMgIfX2VCnEP9C4oc8PTRG3OAjwC+l8Li9emevnHaoSQZZuwwbuwCct yRkBtjKgJRmE/jfx51LW32kI8TAs0b0qkSZ3atifdZITYku7c1LPIDG/k271tOF8g90p Pi4D8AF0uB6DUV1AvVsLXCaIMqp9Sqr+eFBtt4fQ+MDf+eGSnJYpybH5Tp8vEp+JmQw2 rjYCblL9IpMBIZaBhcMEBrvgxbugyZ3l1zl/SgDGB1rfPpx7cNQCTLWNMbznUe9usU+C TAxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=aYFgCH3Y; 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 l20si10309362pgn.282.2017.06.20.02.52.11; Tue, 20 Jun 2017 02:52:11 -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=aYFgCH3Y; 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 S1752861AbdFTJh6 (ORCPT + 25 others); Tue, 20 Jun 2017 05:37:58 -0400 Received: from mail-wm0-f42.google.com ([74.125.82.42]:38710 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751774AbdFTJhy (ORCPT ); Tue, 20 Jun 2017 05:37:54 -0400 Received: by mail-wm0-f42.google.com with SMTP id u195so14570952wmd.1 for ; Tue, 20 Jun 2017 02:37:54 -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=lE5peXKkK5KDRu4axlEoImezWiuwcRc3ccP74XPTEf4=; b=aYFgCH3YM7d97D8QpkfAF6StHqgVzVI6ibyBNLVb1Wu2bn479fApd9Xgb0JqW3z/Ac ergwxB7mHZapdDeim9sEFF0jr1Y30aJy9Z+uzBAw9GcGQeks2YVZTMispZPIYe5V4H9O YWNCPB+JYfLRJQQ/M3PkDAECl8VYsf7VIaH4E= 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=lE5peXKkK5KDRu4axlEoImezWiuwcRc3ccP74XPTEf4=; b=M9n55jCg0+BquSvvr8Zq1w6ep1l4FFmHXVpVjkd6LFVXXZzghZ8ZBCp48RC0uSX4+/ gMBwvIZ45aU5s/aDZ0T6q1IH9v0M4Nz5LEGoJMR4d2VXv+likT88YHQADKPKR5m9JCrW hgdgKccpA4vmez/KQUTc4yfBhkU3VOlru1l7z9ZM5IvfIz3d/qlWd6jtNhRDF6HCrZgj f8l8bjMuC3ICOHYxPMfyb8x7+dvnmV9xdj79j+zSnNsrVYjQNfb5BxAdKiCCbxOcNUx/ mrBCSMJTE9BGUkb1JaRyfQ57J2RlclV1WwVCKxi3h52W+KF485g5JgtvK6KfhGPt1O3w OPOw== X-Gm-Message-State: AKS2vOwnTt9aWqaG99pOHOx7ImeOEPK6ifFmyyCXqi88sopcxH/SGexU 28wjLnuDrw/7t16Z X-Received: by 10.28.101.213 with SMTP id z204mr2152966wmb.106.1497951473206; Tue, 20 Jun 2017 02:37:53 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.37.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:37:52 -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 23/51] rtc: ds1672: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:31 +0200 Message-Id: <1497951359-13334-24-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. 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-ds1672.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-ds1672.c b/drivers/rtc/rtc-ds1672.c index 7bf46bf..ff2468c 100644 --- a/drivers/rtc/rtc-ds1672.c +++ b/drivers/rtc/rtc-ds1672.c @@ -30,7 +30,7 @@ */ static int ds1672_get_datetime(struct i2c_client *client, struct rtc_time *tm) { - unsigned long time; + unsigned long long time; unsigned char addr = DS1672_REG_CNT_BASE; unsigned char buf[4]; @@ -60,7 +60,7 @@ static int ds1672_get_datetime(struct i2c_client *client, struct rtc_time *tm) time = (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0]; - rtc_time_to_tm(time, tm); + rtc_time64_to_tm(time, tm); dev_dbg(&client->dev, "%s: tm is secs=%d, mins=%d, hours=%d, " "mday=%d, mon=%d, year=%d, wday=%d\n", @@ -96,7 +96,7 @@ static int ds1672_rtc_read_time(struct device *dev, struct rtc_time *tm) return ds1672_get_datetime(to_i2c_client(dev), tm); } -static int ds1672_rtc_set_mmss(struct device *dev, unsigned long secs) +static int ds1672_rtc_set_mmss64(struct device *dev, time64_t secs) { return ds1672_set_mmss(to_i2c_client(dev), secs); } @@ -148,7 +148,7 @@ static ssize_t show_control(struct device *dev, struct device_attribute *attr, static const struct rtc_class_ops ds1672_rtc_ops = { .read_time = ds1672_rtc_read_time, - .set_mmss = ds1672_rtc_set_mmss, + .set_mmss64 = ds1672_rtc_set_mmss64, }; static int ds1672_probe(struct i2c_client *client, From patchwork Tue Jun 20 09:35: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: 105952 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1274887qgd; Tue, 20 Jun 2017 02:38:15 -0700 (PDT) X-Received: by 10.98.157.204 with SMTP id a73mr30101691pfk.235.1497951495589; Tue, 20 Jun 2017 02:38:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497951495; cv=none; d=google.com; s=arc-20160816; b=fVeT7HzZ+iNs2q2osendXb4YZ3DLIKdNr8UhyBB6yhh0PnJ6pFNMgfmVJNuZC6vWgI y9uVtbbwSlhWn9NYbelAXCZ0B6f7DVcBX9z7aNK3lnn0QksavcYuuC5NaB5MxAbm8PJk Cx+mwDvPXlEXox/zJkrwwSqupihvYrBEAdATSoF6wsv7f9nYAOLjSvrF3bBILANHVibr cX1kJX68QhOz8LxXOeS2KNCmgTNhH/7zbrIUzO2mPYhk4q0LmkXnmOcDZUFpmpFM7Kvf Ee3up6hW233MoeIbL7TLSNPWkAbNsuPoFlQbENw3jGgCE4y74rTpdc8mTowTqeHXuUr8 KTVw== 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=fSDpDJZOi7udJb+Yu+37Krp3ePaYEeK8U2NAyc4QH9Q=; b=cIlQh4SvsASv45z1k1KEHIG2VymzGKhC2FymWg2evDg+R+myazLqQ/NE0fpANsf/J2 Om0ghPhwae8Kr+y8x+BWavuHeQ6N7Emi4c1xRd5DHJhKLkKIh3uGSFJhdbFLaqbLIeiG xJ2o89vNlSjVHskrg82mwNyA1/OXbZqXqDGXZ7S4J2UrDoqlA0hpkihFZJQ5o36Fmaeq Kt0b+XOhsGiJbaOGrNk26QVbpjLq2+YBTmaNcUeyUJb3HuEXlkmdhzyNa3Z0BLqt3HKm akF5MsMInEaur01QANu+7D93by6WNcz3CIujKgtRcPf3KxFG+2TCqPzXhWJGoXv4iFat +bnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=cixtKAgk; 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 31si11226599pli.289.2017.06.20.02.38.14; Tue, 20 Jun 2017 02:38:15 -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=cixtKAgk; 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 S1752947AbdFTJiK (ORCPT + 25 others); Tue, 20 Jun 2017 05:38:10 -0400 Received: from mail-wm0-f49.google.com ([74.125.82.49]:35334 "EHLO mail-wm0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752915AbdFTJiG (ORCPT ); Tue, 20 Jun 2017 05:38:06 -0400 Received: by mail-wm0-f49.google.com with SMTP id x70so16031100wme.0 for ; Tue, 20 Jun 2017 02:37:55 -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=fSDpDJZOi7udJb+Yu+37Krp3ePaYEeK8U2NAyc4QH9Q=; b=cixtKAgkYcLUGItOpVdOCRRy+BeF92qCVUKkWkT4elfdFnTWpOHNar6QnQX2QhgpgH aZ8AvPJZkYE+Qfo4V6WgHZ9pChNOCKDPzN63WvyedEFhicfy7e8uR0JGiNR4jVJWSelP HqgoPyJ/vJpOUb2FWdvF868FkWa687ojU+8aI= 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=fSDpDJZOi7udJb+Yu+37Krp3ePaYEeK8U2NAyc4QH9Q=; b=W10G/Av+3sutIOvp5yc27Rrz+P103YgecZ7ktPJcx3Y3lNcO5SJPxVoB+GZ7gpI7/z sc4VsIG2s3BEIGp2V+EDPXOWECh28Jrhj0xW8OwHftaedI8l0JET6bcT3knU2RImAD3p HbgU7d9wl+ekz+GkJA5k5JhugKBvng12XGFeWnINMwUVewaStJ2H+14xFmcCP55M76vv ajoerc5AD9m5IgTKR42n4QAgREHK8BhqRAonFbEP6JUM8Xr/PIe1gxtadkOw2ew0Tk29 N5fEiIBYvBh+jbToEjaVErrk/M0MWeYTPDutfx8NhNkMywhpE3r6rCc3pfk9XetDAao/ bBnQ== X-Gm-Message-State: AKS2vOzzK9aO3WiRcjp1G208FODX8xHsgNYFNDN8pAVKz47/iahxoPWq 7sAiwOBXr6xmGbwPnonw8A== X-Received: by 10.28.170.15 with SMTP id t15mr2097009wme.16.1497951474835; Tue, 20 Jun 2017 02:37:54 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.37.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:37:54 -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 24/51] rtc: ds2404: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:32 +0200 Message-Id: <1497951359-13334-25-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. 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-ds2404.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-ds2404.c b/drivers/rtc/rtc-ds2404.c index 9a1582e..b7d04a7 100644 --- a/drivers/rtc/rtc-ds2404.c +++ b/drivers/rtc/rtc-ds2404.c @@ -201,16 +201,16 @@ static void ds2404_enable_osc(struct device *dev) static int ds2404_read_time(struct device *dev, struct rtc_time *dt) { - unsigned long time = 0; + unsigned long long time = 0; ds2404_read_memory(dev, 0x203, 4, (u8 *)&time); time = le32_to_cpu(time); - rtc_time_to_tm(time, dt); + rtc_time64_to_tm(time, dt); return rtc_valid_tm(dt); } -static int ds2404_set_mmss(struct device *dev, unsigned long secs) +static int ds2404_set_mmss64(struct device *dev, time64_t secs) { u32 time = cpu_to_le32(secs); ds2404_write_memory(dev, 0x203, 4, (u8 *)&time); @@ -219,7 +219,7 @@ static int ds2404_set_mmss(struct device *dev, unsigned long secs) static const struct rtc_class_ops ds2404_rtc_ops = { .read_time = ds2404_read_time, - .set_mmss = ds2404_set_mmss, + .set_mmss64 = ds2404_set_mmss64, }; static int rtc_probe(struct platform_device *pdev) From patchwork Tue Jun 20 09:35: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: 105951 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1274869qgd; Tue, 20 Jun 2017 02:38:11 -0700 (PDT) X-Received: by 10.98.61.88 with SMTP id k85mr29524400pfa.90.1497951491762; Tue, 20 Jun 2017 02:38:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497951491; cv=none; d=google.com; s=arc-20160816; b=jmWlHr2Fist7HX7BmEUplNk1LccHFl2ZZnQD6j6dXFo8TJvPAh84F0+dkh3lYiugy4 2bcHbiVdyf8krbFNnzvO6TOtzWhzyPZ/06VSEaVrrec7K4uiTG234cXtibdS+hciIkxa 2f4aTadttpdEsknLV98H0aXg7+fZ/nfQZlbyaJ1/fQ4PpEH503CSjaXaTZvx1i9TgapF oyGVWR8s4dVm1NAVc00f9dAnRHCLp9ABqrEp/Son9m9ovYGIxjdUX7NKVMYuyfLARiox m0+rOsQdaQB48X6mkJ5ipaWwrq4N55LDhVWE0bVXyIH4x12GgCDSo2IbkqsiDW+SoMHE xaIw== 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=Z3y7Q77txeAP7iJLYC7n3mSJHiMMbaYNg2nFmrpoCfQ=; b=l7lGdy3Q+veUMCrlY6nCWZFfTwuPaqvkLjnk7w/BM+A+NU+hLBDj18o5xNwHjWEPHt FDhzuMjwEfXn5a97T/74s0HOfUHHnlGohodrxk/w4jlqnqg8csNNk3TN/Z6fYvfkwnbd zApDj/FIaIaM809oGyiuJgi6Svls8htHTvr/AqA1lSsTaAOG+Q6Zx4MSKF+APlxl9qjS oIgLk77kcbGjcQUOEPkPukidEG230KAZCAVpT3T3J28U1IMneDSliKqPCbOuJl5Gw3lo dzNNosq2y1tnGsO1dzxEguDTdab5qGcBSLjsCUH2LU/sJQ0n9WJhUjjg0vhTJyE1u9Nd 85pA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=b9XWQ1Xm; 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 v1si11150641plb.188.2017.06.20.02.38.11; Tue, 20 Jun 2017 02:38:11 -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=b9XWQ1Xm; 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 S1752917AbdFTJiF (ORCPT + 25 others); Tue, 20 Jun 2017 05:38:05 -0400 Received: from mail-wr0-f177.google.com ([209.85.128.177]:35936 "EHLO mail-wr0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752899AbdFTJiC (ORCPT ); Tue, 20 Jun 2017 05:38:02 -0400 Received: by mail-wr0-f177.google.com with SMTP id c11so32953141wrc.3 for ; Tue, 20 Jun 2017 02:38:02 -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=Z3y7Q77txeAP7iJLYC7n3mSJHiMMbaYNg2nFmrpoCfQ=; b=b9XWQ1XmVf6Aufe28NxugkRIjauFvuUTseQbsBNks7/rGQWYjKLTCdRzR7f//MznaW EDvn3nWPhaO8n1XDBI/eeKJP0apQj4UH0CpVQ1yYHKGB7okI7XQRSpymBGDaeLlN6OyY qGDMhtLJxbujokKr+7WbZLDTez8iljGsCeJIk= 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=Z3y7Q77txeAP7iJLYC7n3mSJHiMMbaYNg2nFmrpoCfQ=; b=go2oiyX5BlXsAoeOTto7eHF7NYMuX68CMuRk4BS4ktKlmKpfgd/P1lEnE9jXF5pRRI FU74ruwlALpqgz/PfR6ZUA005J43prbaj05AJ4nDabUAdNFtS3IbwC8ZYAz6P4hRi0x1 wPQjk1/4SlAKof9Urwwaa9MGs58GsL4idBStCIb1QC1JFtGict1By6oPEh2Sn3t0HHsV QNnqfEAtTittqVsslQOCu8l3pyxpzMAM623mLGPzjEgg8afI7mgx9XghKA3JhGl/D/H8 vC3mYzTc3Uxlqs7TNefAdkt7BQfyXrGRNlCpJmJUmioHu6FPiEQjyFbhgB3RmJBFmYQ0 jbpA== X-Gm-Message-State: AKS2vOyP8KUUAXmG3FHxeZI8onb4tvPu822nUUTXMm7ri9l1JPdUCbjW ixURthRXFGqU3g73 X-Received: by 10.223.161.219 with SMTP id v27mr3194885wrv.135.1497951476411; Tue, 20 Jun 2017 02:37:56 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.37.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:37:56 -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 25/51] rtc: ep93xx: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:33 +0200 Message-Id: <1497951359-13334-26-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. 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-ep93xx.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-ep93xx.c b/drivers/rtc/rtc-ep93xx.c index 6940382..dcb71b2 100644 --- a/drivers/rtc/rtc-ep93xx.c +++ b/drivers/rtc/rtc-ep93xx.c @@ -59,15 +59,15 @@ static int ep93xx_rtc_get_swcomp(struct device *dev, unsigned short *preload, static int ep93xx_rtc_read_time(struct device *dev, struct rtc_time *tm) { struct ep93xx_rtc *ep93xx_rtc = dev_get_platdata(dev); - unsigned long time; + unsigned long long time; - time = readl(ep93xx_rtc->mmio_base + EP93XX_RTC_DATA); + time = readl(ep93xx_rtc->mmio_base + EP93XX_RTC_DATA); - rtc_time_to_tm(time, tm); + rtc_time64_to_tm(time, tm); return 0; } -static int ep93xx_rtc_set_mmss(struct device *dev, unsigned long secs) +static int ep93xx_rtc_set_mmss64(struct device *dev, time64_t secs) { struct ep93xx_rtc *ep93xx_rtc = dev_get_platdata(dev); @@ -89,7 +89,7 @@ static int ep93xx_rtc_proc(struct device *dev, struct seq_file *seq) static const struct rtc_class_ops ep93xx_rtc_ops = { .read_time = ep93xx_rtc_read_time, - .set_mmss = ep93xx_rtc_set_mmss, + .set_mmss64 = ep93xx_rtc_set_mmss64, .proc = ep93xx_rtc_proc, }; From patchwork Tue Jun 20 09:35: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: 105977 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1278284qgd; Tue, 20 Jun 2017 02:48:54 -0700 (PDT) X-Received: by 10.84.128.68 with SMTP id 62mr35005429pla.184.1497952134098; Tue, 20 Jun 2017 02:48:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497952134; cv=none; d=google.com; s=arc-20160816; b=l+RfhpJS41vw2Ousz4+GHcyRLekXeZ+vvDFhthVShBaGv9JqqNVL+TdCZATlZJFRlX xsQmYadtuPejUwr53tmfVLxgWQ+5E0DgkrcQj5biJKSzWrO0JiK1FvvN1MpRq3WJkfUg +mFRWJj97b23DWv62wwqhI5ZqX4KBENXgTr6b81C8NW9zrxh/w9FFS4YXSiXPW98x3tT WnkFXKSVwro5/1dr/I9b85alXreCk/Jb0AGMgHvRBEaudLT6tVuZCxUcI2dj6lr5MX4Q wSKLL1AR2h3Zuy0d9C9eoMDj7B05QH/vBO1C+lo8MXVkZG033raFEoI07v4G6Q6m8bLi LVlw== 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=3PYykTE2yZSoBGAA9xsOg7AqClvTXcP6I6le/qM9kKc=; b=s63bIRy6lj9Kzo8ummzlk7x6R2Trf0Okc3ddqxjR10YMCkz2QhsH1/FKSPUTQF79HF nAmmbz9GhDr2RFws9slfjLnS9FsiNABuBzs54sFbDLni2iZwr2xDzXYkRRtQTz2e3aaI A4TYAzJPJntNqenHX+7D286ED2t/tO43fC2HOfPg6PEHdoW3lnkUizbDUkSxFklh/aCM 39bXunYqJa5PJhCvLDalgI7Ecau/XKt+tBaoLkZQDauP2ss++7TC6TYkC/RdEVnqAx2A mf3N3wE8hC1j3cHNjObTwz4ZkYNfzZ70bg8kcZQiJLnXKAo3eqfkqIKPARsLYOCIdYGx kyLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=YLR3W/7e; 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 z29si9644962pfg.345.2017.06.20.02.48.53; Tue, 20 Jun 2017 02:48:54 -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=YLR3W/7e; 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 S1753072AbdFTJst (ORCPT + 25 others); Tue, 20 Jun 2017 05:48:49 -0400 Received: from mail-wm0-f52.google.com ([74.125.82.52]:38763 "EHLO mail-wm0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752900AbdFTJiE (ORCPT ); Tue, 20 Jun 2017 05:38:04 -0400 Received: by mail-wm0-f52.google.com with SMTP id u195so14573107wmd.1 for ; Tue, 20 Jun 2017 02:38:04 -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=3PYykTE2yZSoBGAA9xsOg7AqClvTXcP6I6le/qM9kKc=; b=YLR3W/7eoAcee1znh2WEacExSu0T2v0U5VM4tCjWBmu2MEeMR9Cf2WNAG8PEcJINo2 CVsaXV/4WI0/xFQMnpNzqMpfJLe5kQRqcIyycT3mM2TiCJj+TBbTt7BZz+0uQbDwwBSZ kiOR/6Qnn8YcT+rN0srE19g5hK161EBAQwHEc= 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=3PYykTE2yZSoBGAA9xsOg7AqClvTXcP6I6le/qM9kKc=; b=Depcv4OA7hG2Pg/dnpoQTPna9yvbV+NYvxerQKXlvMFd+O+cR4SOH+cAUmJfJ++6B2 t0WG6Uk+FkMJY+9BV49zFgHaHcltlxl5JN1uzklXs2aMAIL4e1rBQ75z2WN+yBwd2hV6 /nuKBUDWj2NMDnYoTQmSv5iHpD3XzN2xmJZeKTDVq/YMkRy1y4rCuv9VkOyWX7Nyo9KW tjPnlLRiiFh2MUiYNKlSQ3tSmUa597Z9+EfR7Ac9v4wrpfI9gPsjMF/jUw2DG/kmZhAe gwaP+iFmzETeiqBk33sh6eyQQk+9AKkIbOXoEnKQJQ1nzvANe3rzFlxIuy/7+9DwN27w ICPg== X-Gm-Message-State: AKS2vOyskA9kuOhf77Y2tkZDM/uHNXi1QT7W3ofkv9jVDHWqtC9sYB1J bu7ZwYba60lTXWUV X-Received: by 10.28.22.4 with SMTP id 4mr2047185wmw.68.1497951478229; Tue, 20 Jun 2017 02:37:58 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.37.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:37:57 -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 26/51] rtc: gemini: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:34 +0200 Message-Id: <1497951359-13334-27-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. Signed-off-by: Benjamin Gaignard CC: 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-gemini.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-gemini.c b/drivers/rtc/rtc-gemini.c index 5279390..222f144 100644 --- a/drivers/rtc/rtc-gemini.c +++ b/drivers/rtc/rtc-gemini.c @@ -71,7 +71,7 @@ static int gemini_rtc_read_time(struct device *dev, struct rtc_time *tm) struct gemini_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 + GEMINI_RTC_SECOND); min = readl(rtc->rtc_base + GEMINI_RTC_MINUTE); @@ -81,7 +81,7 @@ static int gemini_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; } @@ -90,12 +90,12 @@ static int gemini_rtc_set_time(struct device *dev, struct rtc_time *tm) { struct gemini_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 + GEMINI_RTC_SECOND); min = readl(rtc->rtc_base + GEMINI_RTC_MINUTE); From patchwork Tue Jun 20 09:35: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: 105974 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1277835qgd; Tue, 20 Jun 2017 02:47:27 -0700 (PDT) X-Received: by 10.84.218.198 with SMTP id g6mr11791561plm.132.1497952046982; Tue, 20 Jun 2017 02:47:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497952046; cv=none; d=google.com; s=arc-20160816; b=hWnfBTE3gtoUEYN/xZJWh8Z3iFG5MLkdKI3/m61cB+Tmb7A6y3uS+6e1pchNKLu1kw 0eBbgiSJCvhAd9GeJjDr7t0iBDdrLyRspJEYfkilqgTC0YI5dQVQAiIrH9oiBXoD1jJq AmQTK6gwI8+KNxNzGkjAJip96bSxvehbronBgL38Emc6JSe+tOJXhmkAcRJBESpbImac mixLZgY23n/oUaHLltG0e9w57FQcpS3a6yHobdq9SdQiQQh+ejOtY6I22qvYQ+NIcbPn NdhjcrC5g7Oyhu6GaxRlZTDnYxsHBxjxuh1n8TxiOSWlZF+P0eIjeYPn5ufRUkWJd7A4 0pEA== 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=aVdtkvr1WbIchyzFYIP5K0ZUeeaRhJeIb/WPcbmKF2w=; b=fojxxgLjA/GYyKYW71mKlX5XD3YqFzBKHgYK7fjhLRobw7rcvsgxHqAsBBvpqdY2Hy ystg2f0YYcNrA1sm1Vus1AUXzIEiFIGqsPld6p6ImTTskx8Thb30aMAgY/Q8BOcIqy91 5thpRyp3NYgB0IL4XJCKLZyIkZ4m3yrzonLlF1Kj0yIjZErVNbGr+Zn3x3RIGuiQ9LBC qblCchkrYgZnuCZbdeF0rH3v7kuZ9xuSXg2md6yov6LZ6WfyqZ+Jx8v++RDn19f43Q8/ Gql+ibsp4UnX+y9+wl2MByJt8mSRU3g8WkZgyqiGPYiv9L4sIv/OhGazZ7yQmXDcjuGq SfIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=UyyvTJE+; 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 j25si10396091pgn.409.2017.06.20.02.47.26; Tue, 20 Jun 2017 02:47:26 -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=UyyvTJE+; 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 S1752966AbdFTJiP (ORCPT + 25 others); Tue, 20 Jun 2017 05:38:15 -0400 Received: from mail-wm0-f45.google.com ([74.125.82.45]:37003 "EHLO mail-wm0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751868AbdFTJiM (ORCPT ); Tue, 20 Jun 2017 05:38:12 -0400 Received: by mail-wm0-f45.google.com with SMTP id d73so14633107wma.0 for ; Tue, 20 Jun 2017 02:38:06 -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=aVdtkvr1WbIchyzFYIP5K0ZUeeaRhJeIb/WPcbmKF2w=; b=UyyvTJE+/EGrc1TI4YyMfp+Rsy+UNaY8BUKVqpkJYRj5d4tki3QHlngy9itUTuu1o0 O48UbmddJNG9zpRiHxCgTN85l/w+1tYifshRGCkY7y0D3bAJpNvkIlgP7kRvsLOJ9EC6 e0Bvz3lA9hgygwO3mAb6CzEtTcGHHSciAN0UU= 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=aVdtkvr1WbIchyzFYIP5K0ZUeeaRhJeIb/WPcbmKF2w=; b=p0h/gjtwkkUl+bPVqwIlNfBLi28fCYrZtNqoQAvky515BXeXikBg9aWzRafhWkRAqb hco7+1OK5HzcTj72AHCGmRnhPw7KeQoXtzj2VThCPs66hJo9C2uk6DECxMOY0kyivlNp nyaOKuTlfbkIgEfFnTXamvJk4/JebtRHsWWyWUi/CVsZWFKr3N2m7OK/Ikqiof7rZfBv 7uiPdJKH/MenrJ7kFm9e3VCGE30NuhVcBmRggfmfZJGEKbtQ5Wl5eMw0DUbI3p3h3gzT RQidcCnpgyNFaKPgtezgbN3ZRkABeW+rL3RpQyxWECiUf/oZyj6ugpozgm1QCr2S+/LS JuwA== X-Gm-Message-State: AKS2vOw0SZDAIvIozr4JJzciStPgI4C+2cY6gCnh94ZoI+tyTE3ObYmD mWczf1Stye9z1Tnv X-Received: by 10.28.130.196 with SMTP id e187mr2193202wmd.24.1497951481139; Tue, 20 Jun 2017 02:38:01 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.37.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:37:59 -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 27/51] rtc: imxdi: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:35 +0200 Message-Id: <1497951359-13334-28-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. 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-imxdi.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-imxdi.c b/drivers/rtc/rtc-imxdi.c index 6b54f6c..9af601d 100644 --- a/drivers/rtc/rtc-imxdi.c +++ b/drivers/rtc/rtc-imxdi.c @@ -549,10 +549,10 @@ static int di_write_wait(struct imxdi_dev *imxdi, u32 val, int reg) static int dryice_rtc_read_time(struct device *dev, struct rtc_time *tm) { struct imxdi_dev *imxdi = dev_get_drvdata(dev); - unsigned long now; + unsigned long long now; now = readl(imxdi->ioaddr + DTCMR); - rtc_time_to_tm(now, tm); + rtc_time64_to_tm(now, tm); return 0; } @@ -561,7 +561,7 @@ static int dryice_rtc_read_time(struct device *dev, struct rtc_time *tm) * set the seconds portion of dryice time counter and clear the * fractional part. */ -static int dryice_rtc_set_mmss(struct device *dev, unsigned long secs) +static int dryice_rtc_set_mmss64(struct device *dev, time64_t secs) { struct imxdi_dev *imxdi = dev_get_drvdata(dev); u32 dcr, dsr; @@ -618,7 +618,7 @@ static int dryice_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) u32 dcamr; dcamr = readl(imxdi->ioaddr + DCAMR); - rtc_time_to_tm(dcamr, &alarm->time); + rtc_time64_to_tm((u64)dcamr, &alarm->time); /* alarm is enabled if the interrupt is enabled */ alarm->enabled = (readl(imxdi->ioaddr + DIER) & DIER_CAIE) != 0; @@ -641,12 +641,10 @@ static int dryice_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) { struct imxdi_dev *imxdi = dev_get_drvdata(dev); unsigned long now; - unsigned long alarm_time; + unsigned long long alarm_time; int rc; - rc = rtc_tm_to_time(&alarm->time, &alarm_time); - if (rc) - return rc; + alarm_time = rtc_tm_to_time64(&alarm->time); /* don't allow setting alarm in the past */ now = readl(imxdi->ioaddr + DTCMR); @@ -668,7 +666,7 @@ static int dryice_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) static const struct rtc_class_ops dryice_rtc_ops = { .read_time = dryice_rtc_read_time, - .set_mmss = dryice_rtc_set_mmss, + .set_mmss64 = dryice_rtc_set_mmss64, .alarm_irq_enable = dryice_rtc_alarm_irq_enable, .read_alarm = dryice_rtc_read_alarm, .set_alarm = dryice_rtc_set_alarm, From patchwork Tue Jun 20 09:35: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: 105978 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1278290qgd; Tue, 20 Jun 2017 02:48:56 -0700 (PDT) X-Received: by 10.98.42.207 with SMTP id q198mr3012295pfq.143.1497952136147; Tue, 20 Jun 2017 02:48:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497952136; cv=none; d=google.com; s=arc-20160816; b=XS6DogpdHrHmFg9yHZ/f7U9NXbiOYeHu2pAEb0yE4vJHZBRI0MC+EdZhmuXIWoyu9K 3Co/UdvYK9XLmTgE0FBf7w9gIdAlnoNIwSvR6YphPbt3J8YdF96d7YNcasAymnnqgYjW VE2loU9T9ctyvsCruqT+9xfp6PxyXBb6x6+tLRU2O750Isyy4kzOLNyBroKMid76jPHk y8ylQmWtoKCmHB98XudMrCLwuqla5qwxseJrBVVZ5e4XIeA0xPP+aOZUljsz7E77JiOs pDeWgzo/GeCR9TittyZXMoUQQvVxi5jaAB2BdJSQMDvFTIj8pw2ejbX1oQPrPERIKK6g Kcnw== 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=h4R47hd6TLsGSY2gaZ5GUBi1Up6TjHNC7a/u8DJok6g=; b=ibtTPbv3DVkZ79Q0RGi1agRwS4tN3/aR/vt15qi2wopVutaQZZuWSpWwCydvcvDL1s uTShgde+a9fNA8ILT4OlBlwwiYV3X4MMVrjv8xXiuy/cAxEf78nmEXUegcaTNVf4oONQ RcyxDa+8rQB0JrmZr9L6oqagznlr3As+sBnYO2bFjI7pnuvvvF0Q9eR4INQGM22tT7Nq JZlHLSzT/F6MIW9hiPaio9ZKsOc/V7d7KXcxZu3GCMnSKCm6tO0K6ulKZykL+gr3wxww Q+egC9mNLCgZJmEnbWWgTysSL/KqXnHgYbTuy/sFW+jD81yQjFSU+rV+lCY7D311H8Ri WJEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=B1Aart5f; 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 z29si9644962pfg.345.2017.06.20.02.48.55; Tue, 20 Jun 2017 02:48:56 -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=B1Aart5f; 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 S1753107AbdFTJsv (ORCPT + 25 others); Tue, 20 Jun 2017 05:48:51 -0400 Received: from mail-wr0-f179.google.com ([209.85.128.179]:35978 "EHLO mail-wr0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751120AbdFTJiE (ORCPT ); Tue, 20 Jun 2017 05:38:04 -0400 Received: by mail-wr0-f179.google.com with SMTP id c11so32954830wrc.3 for ; Tue, 20 Jun 2017 02:38:03 -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=h4R47hd6TLsGSY2gaZ5GUBi1Up6TjHNC7a/u8DJok6g=; b=B1Aart5fJlbyVmlIRbY90Q2Erj7EhR0Gy3BwuSKzzuff/cEinEcA58n4jsNHwIqf6m zkAatxT5wxknCRhgAj13tBrFUJcpBRo/HSBA6ZIHUt3WqEZkxPsfr1wsIcmYZnV5k9R4 64qALUuXhzq/TcW9yn06/MP5BdIpt4A6KK9jc= 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=h4R47hd6TLsGSY2gaZ5GUBi1Up6TjHNC7a/u8DJok6g=; b=m1soRqwQgZ5rlX8wdYu39M+4kULlByDZUGOj49bVPSN9u4pODtGq37jMIywijaAabP 5yjK4IV6ZrZcrXF9IGN90FbQR+qpPjcYC/OhkmUnv5gsA863FjtOFE95ZTdEvmYsYdPm /dB7kZpoWhuLFfubu08rc7H42qsZxoHqbCyuwKqq693OW1nOxTXsWqRi2BPPoHGM1z6+ o8GwYyeCkMy8J0tQIYRFPBMMI2RZZlW8wlUfH1yZ42inoS2XXb4G2DsgM4KkD/6/X8/u ri972TzrROrUhD2APEaNMFZLCHZzEW+snxIu40GY/tdm/UftWocQV3OYrJthSYojoJPp xbRg== X-Gm-Message-State: AKS2vOwq68mG7oErT57AfTLwgGeGqLNTQtYLHG9e7z1fEMfqQAsbnbKb B1dfDHpyBELqx2Sl X-Received: by 10.223.163.152 with SMTP id l24mr12145677wrb.203.1497951482868; Tue, 20 Jun 2017 02:38:02 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.38.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:38:02 -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 28/51] rtc: jz4740: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:36 +0200 Message-Id: <1497951359-13334-29-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. 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-jz4740.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-jz4740.c b/drivers/rtc/rtc-jz4740.c index 64989af..7ce1f43 100644 --- a/drivers/rtc/rtc-jz4740.c +++ b/drivers/rtc/rtc-jz4740.c @@ -171,12 +171,12 @@ static int jz4740_rtc_read_time(struct device *dev, struct rtc_time *time) if (timeout == 0) return -EIO; - rtc_time_to_tm(secs, time); + rtc_time64_to_tm((u64)secs, time); return rtc_valid_tm(time); } -static int jz4740_rtc_set_mmss(struct device *dev, unsigned long secs) +static int jz4740_rtc_set_mmss64(struct device *dev, time64_t secs) { struct jz4740_rtc *rtc = dev_get_drvdata(dev); @@ -196,7 +196,7 @@ static int jz4740_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) alrm->enabled = !!(ctrl & JZ_RTC_CTRL_AE); alrm->pending = !!(ctrl & JZ_RTC_CTRL_AF); - rtc_time_to_tm(secs, &alrm->time); + rtc_time64_to_tm((u64)secs, &alrm->time); return rtc_valid_tm(&alrm->time); } @@ -205,9 +205,9 @@ static int jz4740_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) { int ret; struct jz4740_rtc *rtc = dev_get_drvdata(dev); - unsigned long secs; + unsigned long long secs; - rtc_tm_to_time(&alrm->time, &secs); + secs = rtc_tm_to_time64(&alrm->time); ret = jz4740_rtc_reg_write(rtc, JZ_REG_RTC_SEC_ALARM, secs); if (!ret) @@ -225,7 +225,7 @@ static int jz4740_rtc_alarm_irq_enable(struct device *dev, unsigned int enable) static const struct rtc_class_ops jz4740_rtc_ops = { .read_time = jz4740_rtc_read_time, - .set_mmss = jz4740_rtc_set_mmss, + .set_mmss64 = jz4740_rtc_set_mmss64, .read_alarm = jz4740_rtc_read_alarm, .set_alarm = jz4740_rtc_set_alarm, .alarm_irq_enable = jz4740_rtc_alarm_irq_enable, From patchwork Tue Jun 20 09:35: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: 105953 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1275016qgd; Tue, 20 Jun 2017 02:38:38 -0700 (PDT) X-Received: by 10.101.91.143 with SMTP id i15mr4752458pgr.168.1497951517990; Tue, 20 Jun 2017 02:38:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497951517; cv=none; d=google.com; s=arc-20160816; b=Iff+RQjARq+hVvee35ANiiDzAx9tBFmqlb17CHoYB/4t3UkSxNljc0b8yTNuK4DD4D YiydiX1sxBWLxCLP2S9/izThUHm8LvpLpaOh+QhCE0p4AeDcmpu9AIS2TO6u2cv4svJq Ls+dz2nopOUSAYNINdyxcIp48pEw2hQrBA6EotgnFLjBXzIQ0nmaWhbCRh/uhjBoMSqx +hh+A9s3kOqpmHOl49qjfk+m9fO2suB9N4WxxUaPb8MRl8dKQH/3ZNHkADJCi1hlT9nU 6nW/SeaAxpq9BHf461nJhvJ+o6OiiK4d/jIHDyx4mFGlxpzCf/K34NLSEyFWGrBRwMlJ b2DA== 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=H+LdICScUW70SfoWe/kq1C9GzjpLyFXbcqFkQNfFB6E=; b=ZSji8HU3BxkE7irO60XVBLNLre2guO1BtlTV7ycEOcguGtGCJumvY2ZCEI2QGqoq7z X12qPT0nN2xDQopLLpa6gK3FwTIwapR1xEuVpbdetZHCC5E0fmMPDamtZZcZQBRcV5um skeSdp+mU6VYXzNdkv32g3k1y4Is6u24CYVnBPTTU5VvEvwhULrznb1irLkfRndGQ7L1 iuYhwiSEjafvtJX1oUkwDK4v7fDD3M5c4FzW21j5ExxSWk2KQnXMH3I5MzkD7sKFq45p QXiLN/E48w9SlK92MmdkERvm0WXM9hDTIJdLXXhHF+1ZK8DMlZKMZCe5AgsCOAir8o6M tE5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=ehW9HCi/; 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 o12si11120496plg.593.2017.06.20.02.38.37; Tue, 20 Jun 2017 02:38: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=ehW9HCi/; 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 S1753042AbdFTJiZ (ORCPT + 25 others); Tue, 20 Jun 2017 05:38:25 -0400 Received: from mail-wm0-f51.google.com ([74.125.82.51]:38831 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752967AbdFTJiR (ORCPT ); Tue, 20 Jun 2017 05:38:17 -0400 Received: by mail-wm0-f51.google.com with SMTP id u195so14576054wmd.1 for ; Tue, 20 Jun 2017 02:38:11 -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=H+LdICScUW70SfoWe/kq1C9GzjpLyFXbcqFkQNfFB6E=; b=ehW9HCi/XLfvPJNezgg4ETtmnjcGDUnl5j115ugDRe1bHAR0ygAVWlRHuYtoXc7TVp JjtVwcNcCW8mHdFqmKWCtnEO2RndIbRNkCN/YG4ixvOjQVvK2iXKL2QTubXxGxKo9NYn rQYIWU/Ke8Kn0ngUDhm8pfbW5FoeyYRNt9yH8= 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=H+LdICScUW70SfoWe/kq1C9GzjpLyFXbcqFkQNfFB6E=; b=FOJgsgOWpJZqcRWqZV+dUyGPWvf/DIhYSW3t0L+uAatsjUAJXK8VqTdWiq6k3YWCNS wgscQiZ4/2dpjIirgZrAnL763d9YdF5JyJaKz0giyffA5aaDQ+cSmGvMRGp3+2TTVpaF p2yDMSiUapcomNLVD6XGQmSOLbYapdeM2qo8M16QZKSK/YqDj3XD2OkoETfWwkBofaHZ aLr5Fng0MDGDDdeAgFMbdReYLC3oYuO6z+FMP65lcAvD7VW47+HyzU4AVb9eK/Ig3SWV VIHXMJcUYCM3L72gzcVGaWPalqCVhR82DB8TqOYmgsUOBs6RmT5meyZxJYvay83v8j5w s4kw== X-Gm-Message-State: AKS2vOwtNFUoGXZJ/DQjXFDRARxS5/tDJDYRQvkTQPm10V9bCnVGdcsx gblsXENfeI2UEQ6G X-Received: by 10.28.230.85 with SMTP id d82mr2161619wmh.87.1497951485515; Tue, 20 Jun 2017 02:38:05 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.38.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:38:05 -0700 (PDT) From: Benjamin Gaignard To: benjamin.gaignard@linaro.org Cc: linaro-kernel@lists.linaro.org, Vladimir Zapolskiy , Sylvain Lemieux , Alessandro Zummo , Alexandre Belloni , rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 29/51] rtc: lpc32xx: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:37 +0200 Message-Id: <1497951359-13334-30-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. For the same reasons use set_mmss64 callback instead of set_mmss Signed-off-by: Benjamin Gaignard CC: Vladimir Zapolskiy CC: Sylvain Lemieux 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-lpc32xx.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-lpc32xx.c b/drivers/rtc/rtc-lpc32xx.c index 887871c..a3f5233 100644 --- a/drivers/rtc/rtc-lpc32xx.c +++ b/drivers/rtc/rtc-lpc32xx.c @@ -64,16 +64,16 @@ struct lpc32xx_rtc { static int lpc32xx_rtc_read_time(struct device *dev, struct rtc_time *time) { - unsigned long elapsed_sec; + unsigned long long elapsed_sec; struct lpc32xx_rtc *rtc = dev_get_drvdata(dev); elapsed_sec = rtc_readl(rtc, LPC32XX_RTC_UCOUNT); - rtc_time_to_tm(elapsed_sec, time); + rtc_time64_to_tm(elapsed_sec, time); return rtc_valid_tm(time); } -static int lpc32xx_rtc_set_mmss(struct device *dev, unsigned long secs) +static int lpc32xx_rtc_set_mmss64(struct device *dev, time64_t secs) { struct lpc32xx_rtc *rtc = dev_get_drvdata(dev); u32 tmp; @@ -97,7 +97,7 @@ static int lpc32xx_rtc_read_alarm(struct device *dev, { struct lpc32xx_rtc *rtc = dev_get_drvdata(dev); - rtc_time_to_tm(rtc_readl(rtc, LPC32XX_RTC_MATCH0), &wkalrm->time); + rtc_time64_to_tm(rtc_readl(rtc, LPC32XX_RTC_MATCH0), &wkalrm->time); wkalrm->enabled = rtc->alarm_enabled; wkalrm->pending = !!(rtc_readl(rtc, LPC32XX_RTC_INTSTAT) & LPC32XX_RTC_INTSTAT_MATCH0); @@ -109,15 +109,10 @@ static int lpc32xx_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *wkalrm) { struct lpc32xx_rtc *rtc = dev_get_drvdata(dev); - unsigned long alarmsecs; + unsigned long long alarmsecs; u32 tmp; - int ret; - ret = rtc_tm_to_time(&wkalrm->time, &alarmsecs); - if (ret < 0) { - dev_warn(dev, "Failed to convert time: %d\n", ret); - return ret; - } + alarmsecs = rtc_tm_to_time64(&wkalrm->time); spin_lock_irq(&rtc->lock); @@ -191,7 +186,7 @@ static irqreturn_t lpc32xx_rtc_alarm_interrupt(int irq, void *dev) static const struct rtc_class_ops lpc32xx_rtc_ops = { .read_time = lpc32xx_rtc_read_time, - .set_mmss = lpc32xx_rtc_set_mmss, + .set_mmss64 = lpc32xx_rtc_set_mmss64, .read_alarm = lpc32xx_rtc_read_alarm, .set_alarm = lpc32xx_rtc_set_alarm, .alarm_irq_enable = lpc32xx_rtc_alarm_irq_enable, From patchwork Tue Jun 20 09:35: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: 105976 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1278126qgd; Tue, 20 Jun 2017 02:48:21 -0700 (PDT) X-Received: by 10.99.132.198 with SMTP id k189mr22811252pgd.233.1497952100843; Tue, 20 Jun 2017 02:48:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497952100; cv=none; d=google.com; s=arc-20160816; b=gz+c9Q2c2RPe2QQxsRbq0GssI8OWidetkPK6z6Uo8Csc21v4LHnYQON+efru15shFs RBMsBc9MQYAbgZJ5jzZr9wbKVI9cRkm+T2RbYRZIsoQzFqu49XHmjLaafQIRuUDsrIbQ 5O7riOFc++pOAnl7Obvd65S5o1fDlwhCWTFnb8wXCkAe6Ej0BPafh5V2fag0nwRu/+Mj 5QbLfsAeIQVH6d7BJDfqY8za4IiQIja+OBNrHGyyvYmCwX48QoT/n5TBG8U0qcA5XPOV S1cAuCWZTxtOkUGPWB4KStra2Jvj7f1aXY30NK5e97qYOTfRUzJvBa1wkjKCfeNWcnqr RZPQ== 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=lIlZlTzeQlIRrqU0IeUkiYQwz2DuYUGIb4yUveXUFmaP+SJqOsJc25jGdEsZ/wBOnR r+bhuykMIiUy+h964cLSjfIrt6HG2jGuviD/qGu3qv22xdKFygjgWkZM/QMTHSroRUU/ uHRk5ktw30jkPclHxgmkmGPXioFPCeK4xClcZAD1DtDwlpyg4OVv3fzDVviNqZ1ZyGil oi10wqwWfEOmujLrLq2vXpB6oiYUFnGbjW3K1hpvW5TajFEETTZdtn03g0KPloTDIlkJ 6rIaMeIQueZKhnYPDeMEtH3TKwEYygiR+mGVHEGpmmu8j4zgFXYjKoT+c1v+pWVvqi/g tUhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=MD1/UE+d; 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 q3si3210677pgf.182.2017.06.20.02.48.20; Tue, 20 Jun 2017 02:48:20 -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=MD1/UE+d; 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 S1753059AbdFTJsQ (ORCPT + 25 others); Tue, 20 Jun 2017 05:48:16 -0400 Received: from mail-wr0-f177.google.com ([209.85.128.177]:34227 "EHLO mail-wr0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750993AbdFTJiI (ORCPT ); Tue, 20 Jun 2017 05:38:08 -0400 Received: by mail-wr0-f177.google.com with SMTP id 77so88378432wrb.1 for ; Tue, 20 Jun 2017 02:38:08 -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=MD1/UE+dHITm4R7UorbtiGJ5D52EELu2B8oVIK2lUGhDS6tWETw61qmqQTQaHQkAQt AbZILq4Zvg4Ci2Vprl78dTvCcdcKTDJAcJ11VKqOM+XCa3Rk65nEEJdi3gv3xABX5FB5 LTjI9mETDkAv7jNZxRz5J0OEvq12soqxS8LOY= 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=UGMNjr+kc8Khc94IiDCXUgs4Fa2XFXUMattN3yPLUbjwnR5gnJjA4Une9w0b884nTR obnLIGwc5mfEMl1unipW2vRtbGJ5aIfFCao2RosjCS69f4BRgAcB4AVds+sk0d4l02V0 Pb/4wKFnBYHbyAMo9AMrGZIAwSC6GyMtp7+euIgI8yhzcM7vkrfiB58svZ9SJWyaAAw0 fhYcX5FURxU/qpyPumwo89aO+ZXqY/yvdLQieolNKqmi4Y2Jk/l9PBzN7X9iYCMvymAG +IY9XfqERQur3NGyKlKv3EL4HEyTfFEHoxlQQdFdEEPbuSYpaHk+Y5VUZeY39bhugo4y D2cg== X-Gm-Message-State: AKS2vOyEfZ5iNLiqSxD0jOYbMjClBJSEd0DcbUSS9bM5Rimp2BkGYx/z bV3aXmfYiESHEpGn X-Received: by 10.223.176.164 with SMTP id i33mr18067048wra.165.1497951487573; Tue, 20 Jun 2017 02:38:07 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.38.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:38:07 -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 30/51] rtc: mv: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:38 +0200 Message-Id: <1497951359-13334-31-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. Signed-off-by: Benjamin Gaignard CC: Alessandro Zummo CC: Alexandre Belloni CC: 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 Tue Jun 20 09:35: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: 105975 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1277910qgd; Tue, 20 Jun 2017 02:47:40 -0700 (PDT) X-Received: by 10.84.192.3 with SMTP id b3mr34932710pld.76.1497952060305; Tue, 20 Jun 2017 02:47:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497952060; cv=none; d=google.com; s=arc-20160816; b=ir2SOtq2ztpMF21x87osl4Adg/yLXjoFO3oMwqx80ru9bDBsCLXoXyvhfovLdE/Fos hh+BL9FDeHymbxOU1o6i2HE6lwhIDu2cFzpz9hxa0vNKZkXb3oVfOmeNYtkuatz6ZLb9 g6XhUKKhydeA5BHWBewdRXmy3JhC+PR/8r3n3P6LBZpgDoUOU5uL4MQQypsHAEY9eAK8 RPqRhsNkxOtDCJS/25EwIYKJTdHSrbbMOeP0xfpx9rOuqVQaI7pmGQhwaY3BnWVum2TO 3TqnM+gi3m4l+Sp1Be/DwBngzsThC503oHz24MbpXERw8wIklcaWlXiuoqYQmNbExjmp go9A== 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=odK1DM+Firgxa2Njtp6+II+ONyV1MFlPGMQT57fl6jiPoq2mkvKO/cfzieytdpT8Ih u1dPOJgeue5mQCdD5JuqCNTXriK+nSh9+BljMelK/v2k7sXI3nYiOklSNoK10/Ptu+N7 3mOMNFjvjB1WxuqNBwuIpUc8jid/1xX5ZP4YNrIbm2KOPi5adkme4KEkrTQ1V49rzGGV BHaFW042Psvb2FnBlJpBzLNPIj1UcjC9yI93HcjiXiQS93jhjBDCamcenP1jNSvN1Gl0 LxrbI70Zr+e2mL8bPHi/QolqpApXCudSals2Bh3MVRMXMRFEpzNf+yQ6UB0RSej13rnW U2Lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=FhuffSQB; 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 7si11166341pll.589.2017.06.20.02.47.40; Tue, 20 Jun 2017 02:47:40 -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=FhuffSQB; 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 S1753151AbdFTJrZ (ORCPT + 25 others); Tue, 20 Jun 2017 05:47:25 -0400 Received: from mail-wm0-f49.google.com ([74.125.82.49]:34257 "EHLO mail-wm0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752958AbdFTJiP (ORCPT ); Tue, 20 Jun 2017 05:38:15 -0400 Received: by mail-wm0-f49.google.com with SMTP id d64so23694577wmf.1 for ; Tue, 20 Jun 2017 02:38:09 -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=FhuffSQB9NVA/ZeHA+rvpKNUzp9WKNFOfGJdNjI2Jjtzu8vWFqLls8tYiyU97dA025 7kzCUojeFbCpXeV3EMW4M442Sd4qW6/ov1DAc3BPLWABnrf3tYL2+nqbQkgbwnuhoYu8 UL8VnsyJ3A3ZR0/kOlgUKN4qF7W4KLxc6njgQ= 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=oH+hKhoHo7cF/9c8y6fLIVjYl3e/qeOdvcx7sZ4a8c3K85Uw8ZBOXY3SYs/58JBo0m WrcFyvljhudJgQJoNk6jAlRU/P2EDpkLpH7k9Xp1PnPuhST81z1wekrpslNXWnjOuxo/ 4KTyTkoGUSJuUXseBwR459KgeVhl73xfbvPLTFNHLOc8C6vniEI+2gdmOGBpUs9cipHV +inf3c+sczoOzKnT+0cXwXBhToOUcTmqLmQh+wtws6zh+mKpl82cKFtbtT6hlxZdjqZi m4Z8W3aLzdXF1MZBbsDENXobGxHceeqBG6XD4CsskppEJnX186c2LLvXtp3PjzqXMLwc tOLw== X-Gm-Message-State: AKS2vOyw4IdCtiQoh8X24dK9PKgoTlsxCJAjyxWoM8bIjf8JjD+4y9Dy gvnzROBE0ooDHi7U X-Received: by 10.28.6.77 with SMTP id 74mr1931071wmg.96.1497951489143; Tue, 20 Jun 2017 02:38:09 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.38.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:38:08 -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 31/51] rtc: omap: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:39 +0200 Message-Id: <1497951359-13334-32-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. 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 Tue Jun 20 09:35: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: 105970 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1277153qgd; Tue, 20 Jun 2017 02:45:18 -0700 (PDT) X-Received: by 10.84.128.1 with SMTP id 1mr34800947pla.244.1497951918065; Tue, 20 Jun 2017 02:45:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497951918; cv=none; d=google.com; s=arc-20160816; b=aK5TLjKka2hmipciaWXP153iBj2YBuOt+1t0MHWR07RrrOinJpnCC1kp8RCkgDZhVT PG4HP/idzNJaaAptrgyOyRCF059siEDGrY8GqgCUKVUyTpH/E47M/h9bKk8hOsHpG03s LsBVbSH5pyhRVru+WfHuGKmXINo6+w1RxKprQRnNAB9d/NqwWI2dmGZnruUgLxhnvyZ9 4KnIN+Qmezcw2y+ga6lc4tl7if/AemkVRG3qFZwIUGEKWJIl+C4DKaryJ8gQLcGATVoY DpgWcOp6dcLm0bxHjS/70+WpIYHU/lyWchPh0OvpTvXqU4dbB1KDkYu5eTD0WDgXyAVa 3QPQ== 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=tNi3uLOcoYGFr034TYF4/wMep5+Fq99Ji2cqY3u5bM0=; b=csgxanfH9l717Enj+EMG1XscFoZixjejlVMfO9KzJieqKlJhoLQkUGQrYNllKx8+1t NSz26W8GXOLq8B5vfWDxKicueqNwOsJ0haL16f2gsK9Om7zdcb7UQkxTx21z7625D/zP aJkmfFdosxaZWqQgy0asVa6Z1PuNmF96vqAzT463YhU/tsYwLn5pVLEcBUik7O2k0EFc +LvFKHikvm2U7Wr7ixiJ7cpC5cVijb9ys+uPc+ZZQqOySzhUgR2Pi4HmlUyF/OQptaZh Fs12vO3ih783lycTX3Bl2FhlpjeY3DeU6EYKWGPfphaO00ND71emt1Z3ke+bpoi64kSR GphA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=UWO0mCp9; 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 s129si3023913pgc.348.2017.06.20.02.45.17; Tue, 20 Jun 2017 02:45:18 -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=UWO0mCp9; 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 S1753006AbdFTJiU (ORCPT + 25 others); Tue, 20 Jun 2017 05:38:20 -0400 Received: from mail-wm0-f50.google.com ([74.125.82.50]:37101 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752973AbdFTJiR (ORCPT ); Tue, 20 Jun 2017 05:38:17 -0400 Received: by mail-wm0-f50.google.com with SMTP id d73so14637271wma.0 for ; Tue, 20 Jun 2017 02:38:16 -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=tNi3uLOcoYGFr034TYF4/wMep5+Fq99Ji2cqY3u5bM0=; b=UWO0mCp95dN4ajZTuey7vWXzYeCQOQ18MX3jHwgJ545uY//U6kmicC1zT5sZFwZz4+ 5CVdKSpnsW+RR22lHUcpNCBL7xii1ZyASr5jwiwIjH7zBVuJQ54cw7Knl3Nxuqqj/jyD FZaYQV/qxCsUdseouyu+uU1iPMV5KZezn5Bh0= 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=tNi3uLOcoYGFr034TYF4/wMep5+Fq99Ji2cqY3u5bM0=; b=rPv4c60zTQq4bHYZ9qbzdKRmOmTvGYVd6Lk2HR9G25RXRkF/SRCmzcAc5VKZgFgEwd iCUjXql1U8LKFRGuVxT1uRpmVSL1p8ATdXS7UU1j9K30fOq3jR+NxlyLdrl7Tm8mHW3c ElV9n6tLbvJEFKZWJjHPzIVla3inUESDm0yXwnc2lRwkQtmn8efPlpfx/bAdFN6Dt1eE qIPJUWLu1Rd4OtuUzFRokdj66aJJXTirrxsZ2COMud9Q2gFFVTe0A10itkpB3mDi44KS yEsgQOgnDo3tVbYCIZPGN34cAqEyp9gjRWhLc8Wrauu0d6j/AJK8jqJr2bdBdBe5Twar z9FA== X-Gm-Message-State: AKS2vOyJQpB1p8qtxcxgqp6nbCU8CIRrjpOpdNmZFu6Nj3o/GVqpwssc MjfYrrelu0+szQa3 X-Received: by 10.28.69.91 with SMTP id s88mr2088104wma.104.1497951490957; Tue, 20 Jun 2017 02:38:10 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.38.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:38:10 -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 32/51] rtc: pcap: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:40 +0200 Message-Id: <1497951359-13334-33-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. Signed-off-by: Benjamin Gaignard CC: Alessandro Zummo CC: Alexandre Belloni CC: rtc-linux@googlegroups.com CC: linux-kernel@vger.kernel.org --- drivers/rtc/rtc-pcap.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-pcap.c b/drivers/rtc/rtc-pcap.c index c443324..fbd2cd6 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,10 +66,10 @@ 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; + unsigned long long secs; u32 tod, days; - rtc_tm_to_time(tm, &secs); + secs = rtc_tm_to_time64(tm); tod = secs % SEC_PER_DAY; ezx_pcap_write(pcap_rtc->pcap, PCAP_REG_RTC_TODA, tod); @@ -84,7 +84,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,12 +93,12 @@ 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); @@ -135,7 +135,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 Tue Jun 20 09:35: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: 105973 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1277678qgd; Tue, 20 Jun 2017 02:46:58 -0700 (PDT) X-Received: by 10.99.65.7 with SMTP id o7mr31415537pga.90.1497952018706; Tue, 20 Jun 2017 02:46:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497952018; cv=none; d=google.com; s=arc-20160816; b=xlX8Y20La2lSxA2vSdnnQx1smW4P0LZ6EGqdN0b8ESnjMI5wnWf6ZLw1m6sWTdNaWK M4mnK9EoLnWkifmhzS75CKm/xBi/k+mqjERNIL2czMHH2h9edOl+rHsJsj4tTJRpy3gt lkb8SCwggxnftA0tZsXVgWz+M14Gz/t2tIuSh0FUaMgq9W1h1ZAUeawyrhgPqaxkj6QP tyzPpFz+rYMyxQxZsZLpd3PD2WCDB2D7PJFW0PSGDO2iSgMwo3kWLGaG5tqc2ST2EUIH hylwTmkOw/BfBAC0SAGiv56zhHSUvpyk6zxl3AauWkfHewyKRSmrnqh9YE4nBvJSHupr Ui5g== 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=eQfzzkUh85U+thCoxQ8/ndRxErzn4reA4Xn1JugVeyE=; b=peTELv3WiLYpPhu9mE971ByP7Ivaf6/8eLaS2xs2cH4qEA8RtMFo0nU93J88dm81I3 wq9xErtMZRb44j+y7rP66YAKhZjECBYByY3pW6aYawwD6Vx28gDTU4P0Q2xozn6xSsFx PqR8ifUyJxzHH/7HoXovkQ9y51jmkvjjX2rn2ejacoepzp2RodykPaQBQ3qQzcZexuMI yzV8WScZ5kjEXiXeziDTAMXMog5Tf8CyuHOr0CJFWLVatoL8QfrOLID9P+AwJMSminVY Cht3Qu9gNa+rIVk5fSGphUpfOAoDBl7PZld1x+UoskfCUvA5wZ1bLdS3GaUj9EkjFOE5 JYBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=Gzceptqw; 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 66si7923619pfn.127.2017.06.20.02.46.58; Tue, 20 Jun 2017 02:46:58 -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=Gzceptqw; 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 S1753143AbdFTJqt (ORCPT + 25 others); Tue, 20 Jun 2017 05:46:49 -0400 Received: from mail-wr0-f172.google.com ([209.85.128.172]:36036 "EHLO mail-wr0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752988AbdFTJiS (ORCPT ); Tue, 20 Jun 2017 05:38:18 -0400 Received: by mail-wr0-f172.google.com with SMTP id c11so32957247wrc.3 for ; Tue, 20 Jun 2017 02:38:18 -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=eQfzzkUh85U+thCoxQ8/ndRxErzn4reA4Xn1JugVeyE=; b=Gzceptqw4m77xvD/Et3j85FpmyqMMphW+6ivAq1rpHJrGaDGJKlv85AniznvGCTFlZ cjcciwERBSmKkm2G3c0LVXdsT7Xiw29qBBaOCUTWUohn9D2+HYq7pXD94nVEPvr5Lus8 nwJrmp51CXCEvQndp0AtRNSSqhXpQN/Pq9d0c= 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=eQfzzkUh85U+thCoxQ8/ndRxErzn4reA4Xn1JugVeyE=; b=WmYN13nYPllxZ95zted/3IWTX+XC4KcK0ze+vu/hzD06ZZfOYqzEwVhTaICYAWMZZ6 db/oGp+DZfX/8K8SzIoVdV6MWmO0LxY12kiCu5dpHUatZsZnmD7T8kqPc8EFY57zF4DP OkSspYyhVEAjJV8Qdgmg1wEoaWUhVbgtjTdn3Mq8QMTwcj/hVXQR53GsLdqS5wT0xMfr V32TleNvLGkdVhYFiqlaaxvx+YjpbMAC4BOrAgylsUIG8U/97X3lXKSoH8BVOPcJqB/o U+HUlMMKNTaT53t9YPasXzNO1fw3YVYssWa/N9L8Fsuxe4JBEe+iJf6JRD12sg9KQUBo uY1A== X-Gm-Message-State: AKS2vOwueQBcbbIIiLGJ6AwjQ386QRcrTD9GbScEmtMTDGoxCqXUA25F cBCltzFBDBqu/tWM X-Received: by 10.223.133.167 with SMTP id 36mr20084193wrt.86.1497951492626; Tue, 20 Jun 2017 02:38:12 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.38.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:38:12 -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 33/51] rtc: pl030: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:41 +0200 Message-Id: <1497951359-13334-34-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. Signed-off-by: Benjamin Gaignard CC: Alessandro Zummo CC: Alexandre Belloni CC: rtc-linux@googlegroups.com CC: linux-kernel@vger.kernel.org --- drivers/rtc/rtc-pl030.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-pl030.c b/drivers/rtc/rtc-pl030.c index f85a1a9..c917051 100644 --- a/drivers/rtc/rtc-pl030.c +++ b/drivers/rtc/rtc-pl030.c @@ -39,24 +39,26 @@ static int pl030_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) { struct pl030_rtc *rtc = dev_get_drvdata(dev); - rtc_time_to_tm(readl(rtc->base + RTC_MR), &alrm->time); + rtc_time64_to_tm(readl(rtc->base + RTC_MR), &alrm->time); return 0; } static int pl030_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) { struct pl030_rtc *rtc = dev_get_drvdata(dev); - unsigned long time; + unsigned long long time; int ret; /* * At the moment, we can only deal with non-wildcarded alarm times. */ ret = rtc_valid_tm(&alrm->time); - if (ret == 0) - ret = rtc_tm_to_time(&alrm->time, &time); - if (ret == 0) - writel(time, rtc->base + RTC_MR); + if (ret) + return ret; + + time = rtc_tm_to_time64(&alrm->time); + writel(time, rtc->base + RTC_MR); + return ret; } @@ -64,7 +66,7 @@ static int pl030_read_time(struct device *dev, struct rtc_time *tm) { struct pl030_rtc *rtc = dev_get_drvdata(dev); - rtc_time_to_tm(readl(rtc->base + RTC_DR), tm); + rtc_time64_to_tm(readl(rtc->base + RTC_DR), tm); return 0; } @@ -81,13 +83,11 @@ static int pl030_set_time(struct device *dev, struct rtc_time *tm) { struct pl030_rtc *rtc = dev_get_drvdata(dev); unsigned long time; - int ret; - ret = rtc_tm_to_time(tm, &time); - if (ret == 0) - writel(time + 1, rtc->base + RTC_LR); + time = rtc_tm_to_time64(tm); + writel(time + 1, rtc->base + RTC_LR); - return ret; + return 0; } static const struct rtc_class_ops pl030_ops = { From patchwork Tue Jun 20 09:35:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 105969 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1277052qgd; Tue, 20 Jun 2017 02:45:02 -0700 (PDT) X-Received: by 10.84.132.42 with SMTP id 39mr34246300ple.226.1497951902389; Tue, 20 Jun 2017 02:45:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497951902; cv=none; d=google.com; s=arc-20160816; b=hhsORrBYYEzgBGIFaw9mXQV4MluF2jT4kDCk+D6s6BUypAjFxSCY/8VSY0WamsxPH1 sifLzMkqRUFmFXt7azmEkVo2+/H98JzCntbIvPAdLbGWEdPyhFG7MOFVJI5oeje+8HzT /PzgdN2VbQ4VNt1xkiUuelsPitBrUr4Qq1Pv2mCD+AemzkjoVt1RJiV01fxHIzVXkYEF VNzFrWBDMbCCUf7Gw+uMzNKZ/fjIcXy2YJ7tj/miOTitNQtKwI49bJl+fKe5GnDuOf/v zhiNQOGH6eSFn1H8e62R5u1YpcQk/jAVWABzLLbW60rHpRodNi1aNQkTL3YKJlJkL4NL C4lA== 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=2+VrQinv8y8IjhpmSE6ShuyuOYFwnl8rbzbhn72pOvE=; b=NI4Sg7GrB1KHv7iOMTpVQ25sLlVUlYaovKQvXcAdsrtFWsxQQuiAKdqGNVgJn8srjI 34+BVosi55iQs1CPRuA9i5jrVFSdMRV8KbWWva8gvn5lhmmVE2Wuu6a+mpH6sqrtAUyl tS+/Slhj0mNGX0T9+n+sbVl0w5gPOJVck8xbrhEoX3QSXzqIaVSRnTLoCN96otoxDb7V zlFgoXAjCGVtw2EcXZWDmA1Ng3b8Q/CZ19IqRUCRrN70ak9w48PBIDnQjv9QIWS4emlw n5JcCfb4Nn0uaZl1Dx//1Odr5rDgPTmulrVscrs89rllNahM3JW+6mkt2M+6keb7UTmz 7BFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=eVAt8hRF; 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 z74si10117679pfa.159.2017.06.20.02.45.01; Tue, 20 Jun 2017 02:45:02 -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=eVAt8hRF; 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 S1753196AbdFTJos (ORCPT + 25 others); Tue, 20 Jun 2017 05:44:48 -0400 Received: from mail-wm0-f42.google.com ([74.125.82.42]:37138 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752973AbdFTJiV (ORCPT ); Tue, 20 Jun 2017 05:38:21 -0400 Received: by mail-wm0-f42.google.com with SMTP id d73so14638891wma.0 for ; Tue, 20 Jun 2017 02:38: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=2+VrQinv8y8IjhpmSE6ShuyuOYFwnl8rbzbhn72pOvE=; b=eVAt8hRFU7DAVl5tJovu0k0iJ+kXYuYwZ+RLUlp3i0JOFNCOPTTcF64VZpwlPjP7Vm YYTMgZ+R01fS1jpgcPHthuX/+FvTWe++vv1J+Rrc4MJ0uX5gIVpPXPV7RO/Ik22dPJGs 8jp2gaIcFAURLs0Oh+NDkiwzrQJX/euzSIncY= 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=2+VrQinv8y8IjhpmSE6ShuyuOYFwnl8rbzbhn72pOvE=; b=rnTYBjND+R7K5JDSB6f+eq5CFm2hy1dStSl5eNEv7YUUm9BHmT/0XrwyDDMAvXN1lS qdUbNVfshGo67F3ZgUytnQl2GFh5igAOV4Gdhzq7KLDb0GtRaQLgWeCo5tc4fyoSjpQa x15aXmh1X90tGUAaapYNZhC4gWGLKvW0PG1EgHNmqr4BgiYeZtZSRx3wZwM9jmO+6kRq ctgJYoG/lOVH22aJG4WD5imarK9748JTTythXYGVOLlmuZ3yuO5ao96lD6kiBmRXTxu5 QZJ4f3D7PUOtxxkrB1QShVj8Zu32tCinVNj+wAtdd3/jlvIPwjsZhwxHydyK5nyG9i1u Ygvw== X-Gm-Message-State: AKS2vOzO4AJPytVOQP7whvdgc1pDpUADXoWv+jQC/5/5aP4rgxIaPyDe Wwga5CjtGTNesYAx X-Received: by 10.28.101.213 with SMTP id z204mr2154228wmb.106.1497951494866; Tue, 20 Jun 2017 02:38:14 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.38.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:38:14 -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 34/51] rtc: pl031: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:42 +0200 Message-Id: <1497951359-13334-35-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. Signed-off-by: Benjamin Gaignard CC: 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-pl031.c | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) -- 1.9.1 Acked-by: Linus Walleij diff --git a/drivers/rtc/rtc-pl031.c b/drivers/rtc/rtc-pl031.c index e1687e1..07f72b3 100644 --- a/drivers/rtc/rtc-pl031.c +++ b/drivers/rtc/rtc-pl031.c @@ -127,11 +127,11 @@ static int pl031_stv2_tm_to_time(struct device *dev, return -EINVAL; } else if (wday == -1) { /* wday is not provided, calculate it here */ - unsigned long time; + unsigned long long time; struct rtc_time calc_tm; - rtc_tm_to_time(tm, &time); - rtc_time_to_tm(time, &calc_tm); + time = rtc_tm_to_time64(tm); + rtc_time64_to_tm(time, &calc_tm); wday = calc_tm.tm_wday; } @@ -252,30 +252,27 @@ static int pl031_read_time(struct device *dev, struct rtc_time *tm) { struct pl031_local *ldata = dev_get_drvdata(dev); - rtc_time_to_tm(readl(ldata->base + RTC_DR), tm); + rtc_time64_to_tm(readl(ldata->base + RTC_DR), tm); return 0; } static int pl031_set_time(struct device *dev, struct rtc_time *tm) { - unsigned long time; + unsigned long long time; struct pl031_local *ldata = dev_get_drvdata(dev); - int ret; - - ret = rtc_tm_to_time(tm, &time); - if (ret == 0) - writel(time, ldata->base + RTC_LR); + time = rtc_tm_to_time64(tm); + writel(time, ldata->base + RTC_LR); - return ret; + return 0; } static int pl031_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) { struct pl031_local *ldata = dev_get_drvdata(dev); - rtc_time_to_tm(readl(ldata->base + RTC_MR), &alarm->time); + rtc_time64_to_tm(readl(ldata->base + RTC_MR), &alarm->time); alarm->pending = readl(ldata->base + RTC_RIS) & RTC_BIT_AI; alarm->enabled = readl(ldata->base + RTC_IMSC) & RTC_BIT_AI; @@ -286,17 +283,15 @@ static int pl031_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) static int pl031_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) { struct pl031_local *ldata = dev_get_drvdata(dev); - unsigned long time; + unsigned long long time; int ret; /* At the moment, we can only deal with non-wildcarded alarm times. */ ret = rtc_valid_tm(&alarm->time); if (ret == 0) { - ret = rtc_tm_to_time(&alarm->time, &time); - if (ret == 0) { - writel(time, ldata->base + RTC_MR); - pl031_alarm_irq_enable(dev, alarm->enabled); - } + time = rtc_tm_to_time64(&alarm->time); + writel(time, ldata->base + RTC_MR); + pl031_alarm_irq_enable(dev, alarm->enabled); } return ret; From patchwork Tue Jun 20 09:35:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 105968 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1276841qgd; Tue, 20 Jun 2017 02:44:23 -0700 (PDT) X-Received: by 10.98.73.18 with SMTP id w18mr29607392pfa.61.1497951863560; Tue, 20 Jun 2017 02:44:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497951863; cv=none; d=google.com; s=arc-20160816; b=cyuimK5Pto24KkdvnXor3WbPpOMLkgE0xsgm2qoJGwKJE42OQog4tKHksBMz07UZF5 WT6PhVFXDyYkxe25KROxCOExcnZ2Yw2cUtLXc8jsCRPF839k4tpXAI80KiuJvWSOXc1Q Q7dwI5EVyrlz9TSeBelFLiwbnVRxEEJf7bEHTkxWky+yMoBt0AWVBCvzrNaBq3TqirFT UuAx7Clplqqnqhyo2Zqb2Ppxo24VdQqyr6ZkUTthbD0UIsKOocOBKV81O6gcKpASCV1S mz61VjFn/2yqDCDhGFfsU3OkcSFC82VrobFK6wvLEh/qwCORXojHNW9dKj5p1ZQvsost V1og== 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=y5W0OWQ80OCmzZ4NmZMAcK7UhjsQqIZhusYJ7ypelwU=; b=ios3tAlRvxqMAHCzluwlwyRwggJb3yCxH93fww1XdYVBCVXjVS5uObxT5AYegU6Vib /XD6NxU2iqXU2bVL5Fh7/lPtpO1jVjyQlvuCCEj5ag9RTGGfiUYfVUJ3G+zWzzJAE7uq prCl9SkyyjK1ZnAtQgHautQ7P5wJPWswWuRwIU1Mk1cYsjtHc9F76rqS7aZe2vyQvRNv 05xK2MYK8OD+YJ9ilMyzGHd+QU/aTW2EmA1abqSZvHLD8GZskwGrnK3MgZy8CESanjW2 L2/WTeO7kAKJJ13Uuo4CGDqET6IXCAHWcbjkcmXc1BcHP3dUDpeeJ8Tca4cYYsDDszNe 25yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=L/DernBQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f8si11201780pli.377.2017.06.20.02.44.23; Tue, 20 Jun 2017 02:44:23 -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=L/DernBQ; 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 S1753026AbdFTJiW (ORCPT + 25 others); Tue, 20 Jun 2017 05:38:22 -0400 Received: from mail-wm0-f42.google.com ([74.125.82.42]:37918 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752984AbdFTJiR (ORCPT ); Tue, 20 Jun 2017 05:38:17 -0400 Received: by mail-wm0-f42.google.com with SMTP id u195so14580501wmd.1 for ; Tue, 20 Jun 2017 02:38: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=y5W0OWQ80OCmzZ4NmZMAcK7UhjsQqIZhusYJ7ypelwU=; b=L/DernBQ5XtpjUbz+uWOb9HBeakpRc3+gxG2MStYBf/LwzYvMT+Tm+ev4sHbtRnpWQ pAlozUh0p4fXXcx9gBc0d/iWEw7mDpB+KslIfxiszI8a1Ks4rt4yGuKAv487Ul2xeZCy dDI9r18NmotgWc8ajlBvR0zYMi2PYwL8eP0pc= 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=y5W0OWQ80OCmzZ4NmZMAcK7UhjsQqIZhusYJ7ypelwU=; b=a1+1p92O7nj+d7XE/Poh44ZlmoV8xzhUt1c63WVQUc2yt6+dqThMKuqrlYdDzsbXF3 /bwJZWJEf2d0209uFDHsUqYHZDS2syfTiqUx7XSXaEInygU/iUIrxVR7nVRvCInMnPeD qBDWW5JAvbse4ufJdQriPXQUjoltg02zitVG4Oj9Y+EJ9oqk+fVlYuzCvyKw8L6m8coW 7/UAXk+eRwP7adGZTnm2PJbjlsjMaHXEO7Vhm7CBM8+IdcfXDncjBOZMKvjijcl1uzQ9 p4ceSSzYU5aGuNJmMGllM4A9WaArF/mwOKhET+rv9uUqM84I6G7oK1peOG4zrVYqaTwL Y7Ow== X-Gm-Message-State: AKS2vOz0NxpL7LrXJxe1RhUhArM6D6MlLkLR4PZCKCdnS57obE7W0QHB Y6ryu/DQjJpdl62i X-Received: by 10.28.216.20 with SMTP id p20mr2121589wmg.29.1497951496464; Tue, 20 Jun 2017 02:38:16 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.38.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:38:16 -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 35/51] rtc: pm8xxx: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:43 +0200 Message-Id: <1497951359-13334-36-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. Signed-off-by: Benjamin Gaignard CC: Alessandro Zummo CC: Alexandre Belloni CC: rtc-linux@googlegroups.com CC: linux-kernel@vger.kernel.org --- drivers/rtc/rtc-pm8xxx.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-pm8xxx.c b/drivers/rtc/rtc-pm8xxx.c index fac8355..e6b52bd 100644 --- a/drivers/rtc/rtc-pm8xxx.c +++ b/drivers/rtc/rtc-pm8xxx.c @@ -81,7 +81,8 @@ struct pm8xxx_rtc { static int pm8xxx_rtc_set_time(struct device *dev, struct rtc_time *tm) { int rc, i; - unsigned long secs, irq_flags; + unsigned long long secs; + unsigned long irq_flags; u8 value[NUM_8_BIT_RTC_REGS], alarm_enabled = 0; unsigned int ctrl_reg; struct pm8xxx_rtc *rtc_dd = dev_get_drvdata(dev); @@ -90,14 +91,14 @@ static int pm8xxx_rtc_set_time(struct device *dev, struct rtc_time *tm) if (!rtc_dd->allow_set_time) return -EACCES; - rtc_tm_to_time(tm, &secs); + secs = rtc_tm_to_time64(tm); for (i = 0; i < NUM_8_BIT_RTC_REGS; i++) { value[i] = secs & 0xFF; secs >>= 8; } - dev_dbg(dev, "Seconds value to be written to RTC = %lu\n", secs); + dev_dbg(dev, "Seconds value to be written to RTC = %llu\n", secs); spin_lock_irqsave(&rtc_dd->ctrl_reg_lock, irq_flags); @@ -156,7 +157,7 @@ static int pm8xxx_rtc_read_time(struct device *dev, struct rtc_time *tm) { int rc; u8 value[NUM_8_BIT_RTC_REGS]; - unsigned long secs; + unsigned long long secs; unsigned int reg; struct pm8xxx_rtc *rtc_dd = dev_get_drvdata(dev); const struct pm8xxx_rtc_regs *regs = rtc_dd->regs; @@ -188,7 +189,7 @@ static int pm8xxx_rtc_read_time(struct device *dev, struct rtc_time *tm) secs = value[0] | (value[1] << 8) | (value[2] << 16) | (value[3] << 24); - rtc_time_to_tm(secs, tm); + rtc_time64_to_tm(secs, tm); rc = rtc_valid_tm(tm); if (rc < 0) { @@ -196,7 +197,7 @@ static int pm8xxx_rtc_read_time(struct device *dev, struct rtc_time *tm) return rc; } - dev_dbg(dev, "secs = %lu, h:m:s == %d:%d:%d, d/m/y = %d/%d/%d\n", + dev_dbg(dev, "secs = %llu, h:m:s == %d:%d:%d, d/m/y = %d/%d/%d\n", secs, tm->tm_hour, tm->tm_min, tm->tm_sec, tm->tm_mday, tm->tm_mon, tm->tm_year); @@ -208,11 +209,12 @@ static int pm8xxx_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) int rc, i; u8 value[NUM_8_BIT_RTC_REGS]; unsigned int ctrl_reg; - unsigned long secs, irq_flags; + unsigned long long secs; + unsigned long irq_flags; struct pm8xxx_rtc *rtc_dd = dev_get_drvdata(dev); const struct pm8xxx_rtc_regs *regs = rtc_dd->regs; - rtc_tm_to_time(&alarm->time, &secs); + secs = rtc_tm_to_time64(&alarm->time); for (i = 0; i < NUM_8_BIT_RTC_REGS; i++) { value[i] = secs & 0xFF; @@ -256,7 +258,7 @@ static int pm8xxx_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) { int rc; u8 value[NUM_8_BIT_RTC_REGS]; - unsigned long secs; + unsigned long long secs; struct pm8xxx_rtc *rtc_dd = dev_get_drvdata(dev); const struct pm8xxx_rtc_regs *regs = rtc_dd->regs; @@ -269,7 +271,7 @@ static int pm8xxx_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) secs = value[0] | (value[1] << 8) | (value[2] << 16) | (value[3] << 24); - rtc_time_to_tm(secs, &alarm->time); + rtc_time64_to_tm(secs, &alarm->time); rc = rtc_valid_tm(&alarm->time); if (rc < 0) { From patchwork Tue Jun 20 09:35:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 105972 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1277488qgd; Tue, 20 Jun 2017 02:46:24 -0700 (PDT) X-Received: by 10.98.76.83 with SMTP id z80mr20912356pfa.87.1497951984137; Tue, 20 Jun 2017 02:46:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497951984; cv=none; d=google.com; s=arc-20160816; b=gJzDyOHsxcZ/Tm6WhMLz2koO9x/wq+SbvjPZImQq1c2ClHpCL4vPBmIXTqF5V1fCTx jP5dwcyyqyml3/QCDPPQUaMxKiZ5Xof+Q4E06mbF6Z1hAkb7RZfV3xPJr+md7Lpksq87 QbQc4jRb4fcd2+X46tpnSjMTe3Hulwkw09APzo8NeCK5lWJMHbwyb94y9GAtcSybbEW2 zwylDFSUZ3tCPAkl8NcdQAoB6lh/ka4iHFxIqtik4I1q1Pbwv3GYTbDT5su+cL1Mq2/o w58yMYX/S39NZqXL5rPGGsvaTsBr2L1wD+aquoTUUP1ZBPWAed4dsqO/YBkGAlfKmyjX ESZg== 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=zh57TQICV+hOQcno9DfS6Rw2E3tbEH0me5jKgOhZOZyYiqobr+zHyUWEO9GDUd+RoF eclGFer9CgGvx1HLtlBA8qKp8BPvGeHa9wB8tnVWU5mVAbMYuSkGVUSfdH/vujUlSGll ZB+uYuhGpGoSYNalqkwtCc9sgH+GQ6b0TqLiIGYJ2SuZ1jIuzMp8bDNnTbcXxVXPKb8e +cXQAS6rthH+JfxCQ1jdbX6iv8eny1lme1UasPFTB9n0ebOMBFotj1B+kMWe8lpytXBJ IW4cIpH+fvxTKNltji5ORaI7GkC8H1p9pAhZBBCERplexNZHY1QZ7pwLqzkSufZts1jx OT9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=KO4UlOc8; 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 w20si10072129pgj.290.2017.06.20.02.46.23; Tue, 20 Jun 2017 02:46:24 -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=KO4UlOc8; 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 S1753092AbdFTJqU (ORCPT + 25 others); Tue, 20 Jun 2017 05:46:20 -0400 Received: from mail-wr0-f174.google.com ([209.85.128.174]:36069 "EHLO mail-wr0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752991AbdFTJiT (ORCPT ); Tue, 20 Jun 2017 05:38:19 -0400 Received: by mail-wr0-f174.google.com with SMTP id c11so32958572wrc.3 for ; Tue, 20 Jun 2017 02:38:18 -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=KO4UlOc8OkvFmryIFz/M7Ig4Mof5KfM7AgyJhHwgXdR8qTwQK3ZzPFtnAGBs4qdEnw 0F0wcy82agNkp62oXX7rvtWch/xbviu3rG2lIuZFVi+FhJ4ZEDRLXCPCQgSaekyElOCj fIJz1Vq4DaeEJEEo5BRKcmOM9d8ZZMapuDoxE= 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=X7fCMQnR3XHq8CGfJi+HN8ZwE99XeEDEHp28Ayczv/lr/L0fohMCA3TmOvr8A1QadC z7n8ooAG4nVDA5Tkqfv730SqyF3ilUyNprAaqFQEPIVIKnbCkaQ8mQ2CX462GILIgMGc xT2m0HYSP+b8LsDFbmh3PYnckS4rD194xtEe/fU1pxnI2mErEAspnGOvw1yPCCXzHwnM e816Ll6OLcupXjYdWa+3KefZc1zyv2525pqkeUAiWkb7MsV7Vxk3ff7YCL6PAmADXg3v jJyYT0EcgmFxT8qwHCt2684R2gFpiXG11S8byF5ODeACqBKCx4HUE9G64hj70qQSLNPa 9CnQ== X-Gm-Message-State: AKS2vOyjF0+/C7+UeZesIYkcMHth7gQR7i7V6wdwfn7HyCb7tsVJ7qO3 cS6zMl4EtY7N8Jrj X-Received: by 10.223.133.167 with SMTP id 36mr20084496wrt.86.1497951497995; Tue, 20 Jun 2017 02:38:17 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.38.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:38: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 36/51] rtc: rs5c348: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:44 +0200 Message-Id: <1497951359-13334-37-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. Signed-off-by: Benjamin Gaignard CC: Alessandro Zummo CC: Alexandre Belloni CC: 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 Tue Jun 20 09:35:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 105971 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1277173qgd; Tue, 20 Jun 2017 02:45:21 -0700 (PDT) X-Received: by 10.98.68.2 with SMTP id r2mr29424037pfa.45.1497951921124; Tue, 20 Jun 2017 02:45:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497951921; cv=none; d=google.com; s=arc-20160816; b=YeHWd+W4rBQvizbtVbDr/Itf1rRux1B7ER4l3jzVU56qbw90+yBeYRe91rsOSPyAiu svPQrLglhzKPm2negkj3VZAKeCKtG1zz7mz0wdrKutkg7zDnjRdIfRV856Ub6bZb4qG7 VFfEqrDTq/qZc1Dak1ZpYbJvxE30GTL/GRUtP3TGT7NaX6hwG0D8ZCBchUEAIYVR9M1b woFYdtq9kPv6BPiQFK5r5kW3DK4vAAeyyEVql1BCyDTnqGY4bcul7djbE/lc2FgNTo3b VEhiaFfV0+WQJ4nnTczTHqQQH+YDlI4tOpxKpDx4OE4XaK1CHlIUN3Wce93RUJxy7E5E zvwg== 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=vEeYG3v1P0dwYUux5WQrW33NB0kgjbSKCc6XzsLl61U=; b=ZDX/JgN0Ayvv1uAZ01CcX8SbQuQOQf3/FBffV6GGKSHlhRHVGtjrJYunqXzdv5K8rp IPH0B4OOfQsm6H6r56RxFmQhbcpMlbSvG0ssp+pNkmhKr+2we+iPfE6n6BNpt4yfYqsC 5lKJ/toubE7kv2+qIqG31R3sqOO8Ps53KnSpgtK+invx1rpGtXK469tUKiALG5j6z4J2 0oGOGEQG2+uvsjjmWVcl8iXUVnmnEPDL0/29cCdcZBpFf2HofT8H1z7G0u0n3Bcpz/RV 0MhRofHiE3Absl80UMyNXdhHiEMjwK4aVI5wbLjIvU/tcQLGaLaOlJiwLaQhjdUuabJW 6K2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=IMNi6Xgo; 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 s129si3023913pgc.348.2017.06.20.02.45.20; Tue, 20 Jun 2017 02:45:21 -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=IMNi6Xgo; 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 S1753138AbdFTJpQ (ORCPT + 25 others); Tue, 20 Jun 2017 05:45:16 -0400 Received: from mail-wr0-f178.google.com ([209.85.128.178]:36078 "EHLO mail-wr0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752918AbdFTJiU (ORCPT ); Tue, 20 Jun 2017 05:38:20 -0400 Received: by mail-wr0-f178.google.com with SMTP id c11so32958956wrc.3 for ; Tue, 20 Jun 2017 02:38: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=vEeYG3v1P0dwYUux5WQrW33NB0kgjbSKCc6XzsLl61U=; b=IMNi6Xgo6IxKB5bgsLBsTBuLU5H/bUO9YP/WNP4jDt9fhhCKFETdBkRq81fKgICsI3 240FQzcJK6vjzM8xPuGcdkJsA5p+vie6wSnWk2J7qFr77WwfUPN88awqcbbwTFD3o4uI fQ3I13NAZUwAM1wRgbpQZzlgGPR9gWJM3mJfg= 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=vEeYG3v1P0dwYUux5WQrW33NB0kgjbSKCc6XzsLl61U=; b=ks9G92Z7QD5BBGK2MTMTogeBLa++e7+DV04ts4RRQSFu3yNZkgoLVSmYsfGnEAno8/ Y6ce4/c8T8gnXjdGUQ0AvJhhszM/R4/ktXTbHPAJhss7M5DgunvEl8kUApU6bD0CJCbF khTtJhylY53e0YFhSAcWAqxzsiZIQGkRAmKuJBm0+0r9MPeCgKLn2w8hxT0zr6pNtL53 4v+Tgjxd67OxmvDN4kil2UhBuSeJG/JJlYRzO4MoN15SRCwWleuUAwltti7M/d34JrQr YlRWZMdpGNK5D8mDKJky4gxwE1ySbOZcgiw8dmoruVYC/OTvBt9lKorCPBjDoA7QFO7i XCZg== X-Gm-Message-State: AKS2vOwiosVfpbC87MjBTbRb+qBgdofd1RbUu6XbkHHhDDMQAP4/BNBk lJFP0xaTjQlDlFPl X-Received: by 10.223.139.21 with SMTP id n21mr4559966wra.42.1497951499559; Tue, 20 Jun 2017 02:38:19 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.38.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:38: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 37/51] rtc: sa1100: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:45 +0200 Message-Id: <1497951359-13334-38-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. Signed-off-by: Benjamin Gaignard CC: Alessandro Zummo CC: Alexandre Belloni CC: rtc-linux@googlegroups.com CC: linux-kernel@vger.kernel.org --- drivers/rtc/rtc-sa1100.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-sa1100.c b/drivers/rtc/rtc-sa1100.c index c2187bf..8645b9a 100644 --- a/drivers/rtc/rtc-sa1100.c +++ b/drivers/rtc/rtc-sa1100.c @@ -155,20 +155,19 @@ static int sa1100_rtc_read_time(struct device *dev, struct rtc_time *tm) { struct sa1100_rtc *info = dev_get_drvdata(dev); - rtc_time_to_tm(readl_relaxed(info->rcnr), tm); + rtc_time64_to_tm(readl_relaxed(info->rcnr), tm); return 0; } static int sa1100_rtc_set_time(struct device *dev, struct rtc_time *tm) { struct sa1100_rtc *info = dev_get_drvdata(dev); - unsigned long time; - int ret; + unsigned long long time; - ret = rtc_tm_to_time(tm, &time); - if (ret == 0) - writel_relaxed(time, info->rcnr); - return ret; + time = rtc_tm_to_time64(tm); + writel_relaxed(time, info->rcnr); + + return 0; } static int sa1100_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) @@ -185,13 +184,11 @@ static int sa1100_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) static int sa1100_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) { struct sa1100_rtc *info = dev_get_drvdata(dev); - unsigned long time; - int ret; + unsigned long long time; spin_lock_irq(&info->lock); - ret = rtc_tm_to_time(&alrm->time, &time); - if (ret != 0) - goto out; + time = rtc_tm_to_time64(&alrm->time); + writel_relaxed(readl_relaxed(info->rtsr) & (RTSR_HZE | RTSR_ALE | RTSR_AL), info->rtsr); writel_relaxed(time, info->rtar); @@ -199,10 +196,10 @@ static int sa1100_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) writel_relaxed(readl_relaxed(info->rtsr) | RTSR_ALE, info->rtsr); else writel_relaxed(readl_relaxed(info->rtsr) & ~RTSR_ALE, info->rtsr); -out: + spin_unlock_irq(&info->lock); - return ret; + return 0; } static int sa1100_rtc_proc(struct device *dev, struct seq_file *seq) From patchwork Tue Jun 20 09:35:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 105963 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1276140qgd; Tue, 20 Jun 2017 02:42:04 -0700 (PDT) X-Received: by 10.84.241.197 with SMTP id t5mr34261163plm.48.1497951724615; Tue, 20 Jun 2017 02:42:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497951724; cv=none; d=google.com; s=arc-20160816; b=MwY2nKQdlpA98SqDJ0xgmmcjkG0xGP3yOevvPaOlQOTxBUb4KJknJ8+3EOgtkVPpGy 31OAu6vqAEdu/pav+TSuKbIRRy9juIJK9mNOZ/yqq965LkpfsNPnchpOKBhovabbi72Z mZPQQuVI2oWkBrsxUaC6LNRFze/WnUKeuW+y2oBrwebJeCTN5T+BNvki4+VWeChH9RL5 0KuOFHUa/hQop5rM7VxJnipmUx7BpHbYyThzYO70MZrndpxRJeSR+sRa/oJ2bskzUuY3 tNUQQ/zW8s1iLMymU7iWp74F+WKWTwUPBb1pqlP2QKqitmirG6KmlMfkG3Swe6s1lHdv wIIQ== 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=sjdGkxHiq6kVHCUYodIljZG3+DE9tP1JECa07bO6MODlmmHxfq4CuJ3auEzfM1buHH nw5ZDs8PL8t7Y3QROBlD7kxRvgYEluvJ+ucJ+oVmVhjsC3kuOkIh9n6CoYKgBMeIxfdx 5nwRB4cT07Z8+llY1nNPVnZFOh4rcz/uUIUF7HLdRbztYQJpPDEQhRlz5cSURnJOnVe3 UyoUHLqIJXZPhXx2RPOTGe8tLgo31f2MF3BgWJG5umQo4Vu4f46DYTpN8gNT/5QeMCCc L+RUsljFOLTpm4UbhDVXMhFa3xD/of+Nx82pdvN2zA8NF2HbiH9+By7Cm3jBAFg4ygD8 tzkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=enplYg8O; 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 g87si8252684pfj.284.2017.06.20.02.42.03; Tue, 20 Jun 2017 02:42:04 -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=enplYg8O; 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 S1753157AbdFTJlz (ORCPT + 25 others); Tue, 20 Jun 2017 05:41:55 -0400 Received: from mail-wr0-f181.google.com ([209.85.128.181]:34305 "EHLO mail-wr0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751989AbdFTJic (ORCPT ); Tue, 20 Jun 2017 05:38:32 -0400 Received: by mail-wr0-f181.google.com with SMTP id 77so88381743wrb.1 for ; Tue, 20 Jun 2017 02:38:31 -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=enplYg8OVqPq/r4BZcYIJXz1vbiekDfhFm17tBRbWsjz76O99yLZZz9FPD8Vb5WBNR 5u05Jpw1pLOsYGMSJ6+kk3MF8ykk8M/D7CYet+eS8gHwJANWPbxC+GQBmXArERTdbZzQ I55B73GPDDwp3JfM3/Hn1xIjFZOn5yE46M0zM= 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=W8NTPG44qnmpttfdGxUZFxamBVnJcegq3luKXOjVvAQRjZ6zawCNBetuOI6CHcALC7 cOMUcMOR5trR3PtmlPjXomTvXrhJ1F4LSfRb+gYRzaXr0BHROwBUTq7zJPfYUthaTVFy 2n4YqBRmuR1dp7n+aNA/ly5zVY7Qvmc81sBdzZrUrxJfqMTYhCRmp/zDSF5yI1i3lv8W jBA3LzJ6mk77ouPaaeeLkC/EuEhkaXg1oD4xn9yg82l6fDiB2eWTVZqXJyH4PiNNQIzY cVusvhrN4RykWs/NXOCM+bV607sUpIoxvvNiW1Rz8IamoShhmbMa8GQrtMPvN/bfaQr2 2wiA== X-Gm-Message-State: AKS2vOxXPw83tgMJg5IyRXN9RzzFPZC48lKJv4NdBdWxZ1QIM/uAR4yP ITtRh8ZpQ8XlTk1g X-Received: by 10.223.164.220 with SMTP id h28mr21379201wrb.24.1497951500991; Tue, 20 Jun 2017 02:38:20 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.38.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:38:20 -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 38/51] rtc: sh: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:46 +0200 Message-Id: <1497951359-13334-39-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. Signed-off-by: Benjamin Gaignard CC: Alessandro Zummo CC: Alexandre Belloni CC: 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 Tue Jun 20 09:35:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 105967 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1276767qgd; Tue, 20 Jun 2017 02:44:08 -0700 (PDT) X-Received: by 10.98.156.1 with SMTP id f1mr29893557pfe.192.1497951848792; Tue, 20 Jun 2017 02:44:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497951848; cv=none; d=google.com; s=arc-20160816; b=eJ6jm14RP8wZ06xu0yiDYaOyyReJOz35Kuyy/PJEK2+KAdYgodhuX14+lSqw2r4K+Z ljU4m1V+3lF1FQoyC+fSxiDmnGo8JYOYnpYYv8xMwZpQXDLIbSykt5odVpBW6Wa6ME6H gzxO2Ft3hKGk8fI5lAclBixHwE2m5H/smYGOCpLliDY83rY+htq1neq+gIyrFBOe8jWz uMDP4TnxSd9vgOVIjcm/tTG7CfWDfhLTu2B1u98tRPPpkmoTYHfHl81lo+C1kDc3/XYp NXrPwFUqnCfYWdj821kv6fGWdUqBwlKar384lx4odppDgxC6Uc8UymUORXLDWm+5QmWI +3Rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=ZAfw0QETp3CNSSAHq9TLLK0cNIn7kinl24LWcGIXmXo=; b=GD+4LcPfGh1RmeWZtakjWcdhbtPcKwYERL+SW6hXuxXsiEu99h2aKC7xV3lpOt57YK xxoPK1L+3VST7fBPl53+H2/uMq5V6BQgeem/57c+lfXHHxRbSd5NuflrZcgF69VtFpEN XP6VgtiG9c9eXjAe5fAp6QO11RgY3iQNkeDgTNe6p0ROabbk9XfUNgdEXlBV2/iAOKWd 2PV/559FEdHP/x0sDVJ2DJDTlMDO1WrCIBX4y1loEDRVMoeVCoxzSLuyEn7BWMk4ugYb g3UIfn2D9kCpq6BkxYbffC+GnPNgJax48hn+ViBfiu8f/n0Msil0qX5IziJPUx5jctqM ELqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=VsynSZJp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f8si11201780pli.377.2017.06.20.02.44.08; Tue, 20 Jun 2017 02:44:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.b=VsynSZJp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752070AbdFTJn7 (ORCPT + 25 others); Tue, 20 Jun 2017 05:43:59 -0400 Received: from mail-wm0-f48.google.com ([74.125.82.48]:35616 "EHLO mail-wm0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752448AbdFTJiY (ORCPT ); Tue, 20 Jun 2017 05:38:24 -0400 Received: by mail-wm0-f48.google.com with SMTP id x70so16042807wme.0 for ; Tue, 20 Jun 2017 02:38:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ZAfw0QETp3CNSSAHq9TLLK0cNIn7kinl24LWcGIXmXo=; b=VsynSZJpyHY7h1NefHfsNR+iwALbDmUN7czCXl8F5wSk7MmuMM/wAfBAf1DUYL1W0k O9gacKijUffJqVWKgfZOR88TySzKzUVdXs/Y+I3Bfu3MS/x8udo0pghMoxN+AOPnqrPN o6cOHet7QdC/o0OA3Sw0veo45rNERvAQdN7Ng= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ZAfw0QETp3CNSSAHq9TLLK0cNIn7kinl24LWcGIXmXo=; b=rqQ2p4jG6/JJGpzc+4XZRtibGLTVPUZJ79IiJ2gujKEOP2PpX7kQ3XNJdzdQyvAI/t A4GvECaMrJMD7i5sAiyga/0ALFp0yodrRqWI2qzCaBiEiRvt0iZIKvgxptm/a0yKf9/a ktqqud84ulSYO/1D0WcHVLbxgHHLQzkTNw3R2qzHbsMErOZRI5mCouvEqyP53sENnb7l tKKxMnEo3gLxqTSceqWL/1gdiJa/oDrXh8wOuM79/WZ02sXouU8TXAHytkqftPZbycZX As7TZgGhpJPBzoTI6TPb1O2HZqtArJxnGVVlpBRGbxFkm3Y8GzPKyUqx+rfRGpy9mvB2 bKOQ== X-Gm-Message-State: AKS2vOwXb/SiYyHNlPWY4XSAybN8AmjhSRYOJgI9TN7EeenSqiLcgGwF qBuwYmx+Tl4C156X X-Received: by 10.28.143.16 with SMTP id r16mr2212110wmd.50.1497951502953; Tue, 20 Jun 2017 02:38:22 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.38.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:38:22 -0700 (PDT) From: Benjamin Gaignard To: benjamin.gaignard@linaro.org Cc: linaro-kernel@lists.linaro.org, Alessandro Zummo , Alexandre Belloni , Barry Song , rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 39/51] rtc: sirfsoc: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:47 +0200 Message-Id: <1497951359-13334-40-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. Signed-off-by: Benjamin Gaignard CC: Alessandro Zummo CC: Alexandre Belloni CC: Barry Song CC: rtc-linux@googlegroups.com CC: linux-kernel@vger.kernel.org CC: linux-arm-kernel@lists.infradead.org --- drivers/rtc/rtc-sirfsoc.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-sirfsoc.c b/drivers/rtc/rtc-sirfsoc.c index 7367f61..972ede9 100644 --- a/drivers/rtc/rtc-sirfsoc.c +++ b/drivers/rtc/rtc-sirfsoc.c @@ -91,11 +91,11 @@ static int sirfsoc_rtc_read_alarm(struct device *dev, */ /* if alarm is in next overflow cycle */ if (rtc_count > rtc_alarm) - rtc_time_to_tm((rtcdrv->overflow_rtc + 1) - << (BITS_PER_LONG - RTC_SHIFT) - | rtc_alarm >> RTC_SHIFT, &(alrm->time)); + rtc_time64_to_tm((rtcdrv->overflow_rtc + 1) + << (BITS_PER_LONG - RTC_SHIFT) + | rtc_alarm >> RTC_SHIFT, &(alrm->time)); else - rtc_time_to_tm(rtcdrv->overflow_rtc + rtc_time64_to_tm(rtcdrv->overflow_rtc << (BITS_PER_LONG - RTC_SHIFT) | rtc_alarm >> RTC_SHIFT, &(alrm->time)); if (sirfsoc_rtc_readl(rtcdrv, RTC_STATUS) & SIRFSOC_RTC_AL0E) @@ -109,12 +109,12 @@ static int sirfsoc_rtc_read_alarm(struct device *dev, static int sirfsoc_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) { - unsigned long rtc_status_reg, rtc_alarm; + unsigned long long rtc_status_reg, rtc_alarm; struct sirfsoc_rtc_drv *rtcdrv; rtcdrv = dev_get_drvdata(dev); if (alrm->enabled) { - rtc_tm_to_time(&(alrm->time), &rtc_alarm); + rtc_alarm = rtc_tm_to_time64(&alrm->time); spin_lock_irq(&rtcdrv->lock); @@ -182,7 +182,7 @@ static int sirfsoc_rtc_read_time(struct device *dev, cpu_relax(); } while (tmp_rtc != sirfsoc_rtc_readl(rtcdrv, RTC_CN)); - rtc_time_to_tm(rtcdrv->overflow_rtc << (BITS_PER_LONG - RTC_SHIFT) | + rtc_time64_to_tm(rtcdrv->overflow_rtc << (BITS_PER_LONG - RTC_SHIFT) | tmp_rtc >> RTC_SHIFT, tm); return 0; } @@ -190,11 +190,11 @@ static int sirfsoc_rtc_read_time(struct device *dev, static int sirfsoc_rtc_set_time(struct device *dev, struct rtc_time *tm) { - unsigned long rtc_time; + unsigned long long rtc_time; struct sirfsoc_rtc_drv *rtcdrv; rtcdrv = dev_get_drvdata(dev); - rtc_tm_to_time(tm, &rtc_time); + rtc_time = rtc_tm_to_time64(tm); rtcdrv->overflow_rtc = rtc_time >> (BITS_PER_LONG - RTC_SHIFT); From patchwork Tue Jun 20 09:35:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 105964 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1276252qgd; Tue, 20 Jun 2017 02:42:25 -0700 (PDT) X-Received: by 10.99.97.5 with SMTP id v5mr27403925pgb.77.1497951745346; Tue, 20 Jun 2017 02:42:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497951745; cv=none; d=google.com; s=arc-20160816; b=Iw4Ad+1hduYv1nz+SOvDEWPeTs3rEaliYLiHVhknLOBfzqJNiif3Y6J1tSSIne4ybn NOjmqMF+YetxfWpV95E+T38fwvhXX48KNZCMsod2GYqhL2vcOUafg3+ZO3y/4/wLQxLS F4ALat5iR+dw46hbOwegcChDO2c9d2ExqjNmeBflPFQSJjx27xvXIAZjwGZZhCVQ6Hib T6tQNgavYX5Ty8x6n8kuxv2NlmCUsGZQ7SRCa5wEsuCFuVjMd1AfvoS0YcYQuckWjkPZ xIUyjEZZ1S7UpqG/3lpVuycfalPaTT1YdDmUCS1munGKoCnpvwLwoc3G90W3kcZmPqoK iIxw== 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=eJN3s8DB8hXLKoAccDvkfDznoSYrTCD5emV7ERQs4Insb9rl79Iw3vEQ5kFzWaT93N WjHWS53cqUOGZPcsLjtiM1hHqvJ9weol3tsWNdxpMdhSvLWyp34/IVDqW1R2sdRCpv+f v3uliMXRR/wsj0CMXSLcbHSB7IkJWLVg/w3kNR0eOkbVYv3imXmQGbC5JY6VeuePczIk t3/UNibXa3I11os6zIqMa/F8I2+V2F7Ik1RQDUHdAydfRHUXpkojC8hoY0fwhHFBVwHC o7vjVmsHZR8zRno825edCwjS/cQMcQu3RN4sVaPvJ2BZRYd8yOYG2WJZsaKU7i1WgFeu /HIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=DPv2Rlhi; 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 j62si4587595pfc.194.2017.06.20.02.42.25; Tue, 20 Jun 2017 02:42: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=DPv2Rlhi; 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 S1753082AbdFTJib (ORCPT + 25 others); Tue, 20 Jun 2017 05:38:31 -0400 Received: from mail-wm0-f54.google.com ([74.125.82.54]:36110 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753039AbdFTJiZ (ORCPT ); Tue, 20 Jun 2017 05:38:25 -0400 Received: by mail-wm0-f54.google.com with SMTP id m125so16116846wmm.1 for ; Tue, 20 Jun 2017 02:38:25 -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=DPv2RlhigTbbiz7wEg9omGHZv7sHdsEK7I8PTI3gJLJ7LuKNpIXptcEoY3BCJYsPIr qMfnW0Jd08P5RHEVi2XF/HGDxs59F3BgFyyBrlMpifyr0+aKTAaRGn2v3W83nXg0YeV8 nAPDla4esx4vjI171WL5vhGHzwct2MdxEjNkU= 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=N/hplNrnXiReNqLh/d7+S0J662WBqEY1Q2S9GvpA6Ggj9sFbRwtrghKWCLkiSEGtSm 6eIrxjY6gnJW6zy1iRPDmYyL1+36aoE64ODU7sEea1L21eOYJH0mbx1ry9jjSoZKqMhF jb6Mc1ZF+PdFMdQRoNrDyk85lZtw40v2QI9Hd8+IzdN8ptrDylXgj+7e1tQEuYpzuvJr VyRGHbljwfMZ14TlI6kxDxWY/g8hNMMq8wqk4k4e4PE1AFzQiT8aBL0Q6T/z2mbmcrRr 6V75+CoRTSAoXfEIhgBx90DWqTYa9u2GrfeujaOW3Z/b+BCB5jvzc9BcojY8VyDI2+QU ZGZQ== X-Gm-Message-State: AKS2vOzmmshiaurZoZNAY/kMSbFAMjPA4smq3l5He7QicHuhttxhu+L3 pn0MsmhYyri72Xhi X-Received: by 10.28.19.206 with SMTP id 197mr2210629wmt.70.1497951504512; Tue, 20 Jun 2017 02:38:24 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.38.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:38: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 40/51] rtc: snvs: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:48 +0200 Message-Id: <1497951359-13334-41-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. Signed-off-by: Benjamin Gaignard CC: Alessandro Zummo CC: Alexandre Belloni CC: 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 Tue Jun 20 09:35:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 105954 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1275023qgd; Tue, 20 Jun 2017 02:38:39 -0700 (PDT) X-Received: by 10.101.88.67 with SMTP id s3mr29871422pgr.75.1497951519168; Tue, 20 Jun 2017 02:38:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497951519; cv=none; d=google.com; s=arc-20160816; b=y6WaLO/lfvAiUwHDrXKSHDYblmYCVPNwBoEfzkBjDzQG+uRXBLgCZR7/iucUPnfWvr yc0CFogxnLv+69gxcSZrf/3U/wRJreQLIB/hK0fO9tlL1azYMFNPPWL+toAOpV/w8BNn 2NLVKINroaepRMNMSAvK9F/wUoOWJAgcXd0ZB4+7Mzv/daYWuehWQt5K96JcuYJqVcc+ 48mdevz8xLEiuRP6Mq1QvbupHq8iMEVZuQ76MU/GuoYKHXI7GkTg8oWLbpitci6id9YM RE5Ele2KuWybRR+aRooQ4n8K71Onj4Yn3XlG3hYlFjn4xw9KzVKZnCt+o3W/Up+kWWdl NKvg== 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=LYp3Gw9hx1Q4cktC6pLi0ugdQVBFYuq/beU5Z4GS/yTA6LOv0yuzJ6+P1JK2IRzrWc 1EFEz7fj83ocVS0dGfo8x8LJ4Mrw5uBI+LSg3Nn6/elj2Dc1z/Y8asJPvIccgtX0t36N SGGTZi6S3uQ/E2UhrWVTK2Y/+VBMxCqrRUHqGLH3335oSzqiSHbXfuJntIgKiDD5o7Mx rMzDhhXl3MjNT4nhP9ysfrnfn3R+ToOU5N4LLW8LD679+SAr5nSDPYa+M4YoeOu/E/Mh 0eMMpdMUpqOhrD83EI2ibCIV/ZGZ3IzYp72yIRbOhmjkREdUWtoLd/YY5+RaNN+7Fvni TEfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=Abkual6y; 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 o12si11120496plg.593.2017.06.20.02.38.38; Tue, 20 Jun 2017 02:38:39 -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=Abkual6y; 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 S1753096AbdFTJid (ORCPT + 25 others); Tue, 20 Jun 2017 05:38:33 -0400 Received: from mail-wm0-f51.google.com ([74.125.82.51]:35654 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751640AbdFTJi1 (ORCPT ); Tue, 20 Jun 2017 05:38:27 -0400 Received: by mail-wm0-f51.google.com with SMTP id x70so16044208wme.0 for ; Tue, 20 Jun 2017 02:38:26 -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=Abkual6y0kqmL3sNZBqKINR7HDNjzCCkbXIEB+seJoCaDeSazOzioiFsGnYtYgUCM3 lu1LYCjSmQT9PomuaYOPIBxXgnHHok33MrKZ3R9x3p+p20SGFaJlzP39P9/jz09FOShi efLORH0rip9ZrbhieqLk1FHi0xYbIcwdGRglg= 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=AgczHgAofqx0ASM1fjuQGak2ycw5DWD6nU2in/uSOzvPtNNwA8Cb4M+88GPCwuJhqg pg9SRzS10hZM10+xqMog+SFLuCWMA0zXXHL2X+JWBEXpCh9RTg5Iu6XpPtl/risa5XWW Zo8r0nGvT/NXw8LB1P+cwBAHOR2VALeRGoByTGdlc2c9vZW3OpdOeIl+D2LE0z1oUDzm 7nv6mtFX3n5l9Yrg6R+Ne52u3FM65V26Nwk/YwNrhY9F3PHz+/rSz76lW20pGx6DJszm sS6bAVNxyTXwCKBAe7oZVb2yUXjmsA4Hiv8+qTVBJVndHQjtIrRmL1GaA06kxBfho526 SZpw== X-Gm-Message-State: AKS2vOyfEJ78yJHvNcRJM89T34dzpsX1tu4a0ceMsaj+hmI+to3ndATy pIrcCFXtzTwVt6HiieZX/A== X-Received: by 10.28.16.12 with SMTP id 12mr2007437wmq.9.1497951506109; Tue, 20 Jun 2017 02:38:26 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.38.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:38:25 -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 41/51] rtc: stk17ta8: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:49 +0200 Message-Id: <1497951359-13334-42-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. Signed-off-by: Benjamin Gaignard CC: Alessandro Zummo CC: Alexandre Belloni CC: 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 Tue Jun 20 09:35:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 105966 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1276479qgd; Tue, 20 Jun 2017 02:43:11 -0700 (PDT) X-Received: by 10.84.217.138 with SMTP id p10mr29549055pli.66.1497951791682; Tue, 20 Jun 2017 02:43:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497951791; cv=none; d=google.com; s=arc-20160816; b=I6o45SLszHI84b6nCF5cVOs0lxnw2t/Ehd3Fucr1zIcczUskrugAGy3anDz+JgZasl DjLNaQJs1b9j9wl5JU5Y69WAbkuGjtKUXwnGPxUN8s8FnVzQWPHXj1PwCtERD6aSiBUC hXVP6iLJkY4rOVSype2nH/+xjQZ8QmyIloGKeb1MfJaM3JfqcVfhszjfRu6FYSfqPyh4 WfwqeID3WsnVX65+TPsTtkis0O5YbZ46cH1QSiRiNZfTMhcdvIFmevv3wQQzvoOVAzQC 7A4vFMyES4W06Y1Y53L37W1SbTQQz/93podvLb/4lvxvsmrKL23+g3sDBx5lP3tSpcCC PRZw== 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=ORD3Pu6ElgfhUPhtBN0bFttKmJ3C5kLuYfhq7UKeTSs=; b=GVuXtlpn1ttlA1qEbJ/iidmxVXDLyJK0CfN1szCRFhN0JDkVCInwyAcG/C7ANcneuT T1LaiYrDBgrAXF/LSmHm/YIVu/JTCr/po1gv/hZsvNpCGyYfNGoqsi6LjMG8PUzKmmm8 feWnrh4021Yg23gueY1Q3t+klQ2Z6vm3mxYgmgOsJiJ1LX7x1DB/TVBONKtQXSzvJlYM V9KQIz15b3Bqp2DoZTvQSy0zzHE1DK0q8b3Tze2RcCxV8z5rf8C7cQ31OqkAdhfv45uY 0q0j5F9yOAUhGMlBvHgkn38IxoKGOdLjCu/5saBZ8GzjXSkSm29b/jMmUbcQ8uSMyOWv G0aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=WNJG1cu3; 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 201si10144015pga.81.2017.06.20.02.43.11; Tue, 20 Jun 2017 02:43:11 -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=WNJG1cu3; 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 S1753183AbdFTJnI (ORCPT + 25 others); Tue, 20 Jun 2017 05:43:08 -0400 Received: from mail-wr0-f169.google.com ([209.85.128.169]:35837 "EHLO mail-wr0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753049AbdFTJi2 (ORCPT ); Tue, 20 Jun 2017 05:38:28 -0400 Received: by mail-wr0-f169.google.com with SMTP id y25so49137882wrd.2 for ; Tue, 20 Jun 2017 02:38:28 -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=ORD3Pu6ElgfhUPhtBN0bFttKmJ3C5kLuYfhq7UKeTSs=; b=WNJG1cu3j1ctGTe4Upg5W8DWVSFOss/DhB2sukmf5jRRVzeKw0t8+mQ1dFcTi7wzd+ Q7bpGF9WjIG7K1r9gon5SrxEgZoes94wqs8Ht1x1gj4krRXUBGqngwqrKVXHBE9mjIJ/ gTzL9CrvHlu5+W5JggJDfJloi0Q7ALj4nNTMc= 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=ORD3Pu6ElgfhUPhtBN0bFttKmJ3C5kLuYfhq7UKeTSs=; b=Gy0wtaBnPWjlogN7eAwqRMahySkJTdN9GxNnhJKVBS8ktewzUPBDmrAVlzjnSQiuib U4erI9qy8vqjnRtGiGNM0Jb99xqgL2pDGjmi3Q6d6+mYtzqWpmGJcF5EZ+VW5GSimuYc EsCxDXkujZQBopcfmSKgJzmuoJ2dRsLB/HFbPxJeWU2AaPtE3tomSIUmyw9Uz2U2VsGF ySyqoshFDAfVjL7SNA1yEulRLTI6UQk7FLyb2gkA+UkZv9RF7AeowxXtAME1kMDoHLqY xO848gZ+aTj+iKCxBrPxjgvMzYqe//q1c5CzFSERMKTIPxw6ojqwtMlDJOhTpa0NLKGa J3+A== X-Gm-Message-State: AKS2vOzM/rnVauHtreK1x/rHDzPKrrvLox0+1zF7hhZqugGDoVnMMaoY /NSVDuAqLBXaWAPL X-Received: by 10.223.166.196 with SMTP id t62mr17952255wrc.52.1497951507584; Tue, 20 Jun 2017 02:38:27 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.38.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:38: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 42/51] rtc: stmp3xxx: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:50 +0200 Message-Id: <1497951359-13334-43-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. 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-stmp3xxx.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-stmp3xxx.c b/drivers/rtc/rtc-stmp3xxx.c index d578e40..0f7cedc 100644 --- a/drivers/rtc/rtc-stmp3xxx.c +++ b/drivers/rtc/rtc-stmp3xxx.c @@ -160,11 +160,11 @@ static int stmp3xxx_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm) if (ret) return ret; - rtc_time_to_tm(readl(rtc_data->io + STMP3XXX_RTC_SECONDS), rtc_tm); + rtc_time64_to_tm(readl(rtc_data->io + STMP3XXX_RTC_SECONDS), rtc_tm); return 0; } -static int stmp3xxx_rtc_set_mmss(struct device *dev, unsigned long t) +static int stmp3xxx_rtc_set_mmss64(struct device *dev, time64_t t) { struct stmp3xxx_rtc_data *rtc_data = dev_get_drvdata(dev); @@ -214,16 +214,16 @@ static int stmp3xxx_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm) { struct stmp3xxx_rtc_data *rtc_data = dev_get_drvdata(dev); - rtc_time_to_tm(readl(rtc_data->io + STMP3XXX_RTC_ALARM), &alm->time); + rtc_time64_to_tm(readl(rtc_data->io + STMP3XXX_RTC_ALARM), &alm->time); return 0; } static int stmp3xxx_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm) { - unsigned long t; + unsigned long long t; struct stmp3xxx_rtc_data *rtc_data = dev_get_drvdata(dev); - rtc_tm_to_time(&alm->time, &t); + t = rtc_tm_to_time64(&alm->time); writel(t, rtc_data->io + STMP3XXX_RTC_ALARM); stmp3xxx_alarm_irq_enable(dev, alm->enabled); @@ -235,7 +235,7 @@ static int stmp3xxx_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm) .alarm_irq_enable = stmp3xxx_alarm_irq_enable, .read_time = stmp3xxx_rtc_gettime, - .set_mmss = stmp3xxx_rtc_set_mmss, + .set_mmss64 = stmp3xxx_rtc_set_mmss64, .read_alarm = stmp3xxx_rtc_read_alarm, .set_alarm = stmp3xxx_rtc_set_alarm, }; From patchwork Tue Jun 20 09:35:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 105965 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1276291qgd; Tue, 20 Jun 2017 02:42:32 -0700 (PDT) X-Received: by 10.84.228.207 with SMTP id y15mr11272702pli.13.1497951752370; Tue, 20 Jun 2017 02:42:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497951752; cv=none; d=google.com; s=arc-20160816; b=ZcLTf58lNxiXr/ungFT3qOdSR0Hmld8CHBIhPh9VtyFj0LtQFWAuMLEbCU70iy7xQe un4mWzJxbxg7GeT5v6GI/XV58IXD3UFKZp+19AJW7sKCTMoZItVyESUQKjxEc33sIacl 7ibja+brlpNUZ3gReWq3Y6PpeSlnNhUxsgC4wkvE2jhPetLq31GeJgnHdhoSPqYFoQUc 8mB8XYrBOGycUkeYMGpCNbVW/xxijRIzuy/i6K1x9yNLWhafP5WbXdZUjrT3dcgI4EL3 kUGHzDDpxVVmiZHcXIbg8ADOgfr4R6jx/bx9hDG3IGUQO9tTY/b3CN7uEpCttFD3wOQg 2b7g== 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=Gymy8P4SmVbUUKC9U+vlfTjZixZ/ZUQXzn58DB8STXliale92ikeHKzvvjaAU6s2PG oeKziSu4fX2L8820S5OzKjKREWyl+NlI5YQ5wxyCbTtxGvJi6ypLyi55qLw9Z/bpO2iq VOqtE9Sm8xBeDjunP4iJL4+hPsBhr3yC3TMCA9VEvI9dqOPfHXphIkA19hfwVduGhppy cMTQe8I7/iLQzTM6dJDLA52aLql/FFvzRo7OSZOarF9yXrohFGA9psHXTT/v+weIeHBl oSK0sBiDHDA+CN00z2RL+Aloi7Yw78xh+2nLRE5uzAJMoKCdQBy2okPr025nq0ZL8m/+ h49g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=be1UQMm1; 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 j62si4587595pfc.194.2017.06.20.02.42.32; Tue, 20 Jun 2017 02:42:32 -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=be1UQMm1; 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 S1753181AbdFTJm2 (ORCPT + 25 others); Tue, 20 Jun 2017 05:42:28 -0400 Received: from mail-wr0-f177.google.com ([209.85.128.177]:36138 "EHLO mail-wr0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753067AbdFTJia (ORCPT ); Tue, 20 Jun 2017 05:38:30 -0400 Received: by mail-wr0-f177.google.com with SMTP id c11so32961499wrc.3 for ; Tue, 20 Jun 2017 02:38:30 -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=be1UQMm1fIIuSiv6rU5xx2EtG+GZpvRQOZQCbdbkJ6oqyshXn0QT48qD2C8cBePi2Y hI2NykcJQmE5kuAcf0lh4RbxBkO7UUarFJ0+/K0CHWMgwBabLdAy8REb4FvqQH/C2IIZ txeuu1KoE2X+WvomhPMBIrUxy73cBKPVetGR0= 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=RtqH5w5YCUBZDfyXT5S37sMI7AJXqAT+8kg8McmuRTzklu37xvNMwIYbNhj4lIUG6S LxE++oqBhoyBywkIWLpvs22tlIRLn6M4wNPE16MmvwsF31TgR4OfS9zHGeU/edGVBqUW PYfRVqdAH2eIXO9+7i9wuX17gfTVxBFuearn8zBvFFEqakzYWBD4XWu6PT9FMH0QeNcz 4AFD1cASFcRpBh9hqUf/pPBhgg4FyM0CFafLEfTArZZz6VNdFMg9sPHQbtvvAXk+I7tI 2OYp0oszyGtRqFpIRCbft8Z8mwQVkt6TD994aCW4LwyvJ6O8YVEfbCnupHbMY752rQce eFow== X-Gm-Message-State: AKS2vOzUY9PidKumy9HJwSlD90SCcblBG0TbaRNnU/pgxpPc4+rMV1BJ QmnSIZFc8FGuz13x X-Received: by 10.223.130.110 with SMTP id 101mr15734766wrb.21.1497951509399; Tue, 20 Jun 2017 02:38:29 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.38.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:38:29 -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 43/51] rtc: sun6i: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:51 +0200 Message-Id: <1497951359-13334-44-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. Signed-off-by: Benjamin Gaignard CC: 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 Tue Jun 20 09:35:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 105956 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1275126qgd; Tue, 20 Jun 2017 02:38:58 -0700 (PDT) X-Received: by 10.84.196.129 with SMTP id l1mr34906622pld.109.1497951538073; Tue, 20 Jun 2017 02:38:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497951538; cv=none; d=google.com; s=arc-20160816; b=pfwkAItp2uiQrIUBUgVl1EKEz7t4tKaXyC1B19pFb9d+XD8g/nWOGq1jSSEEH568uq Pstu6g0sBzXW7AyN+OpyWKi1PXj2ohpVIkZmq0KqYkdl5z93peZ1YKieV2uqJhS7WelM UmRxQ0FpfzX8x/d4MShSuAB0HGBNNMi/DsWsOmMgtGBPRLkfjFYwVJJJlbn0Hlyi+O5j 25bHejNNkQ7issm8AQavmFOEbPotTLHYeh2doh5zMJF7GghTFXs4zjUmddYrH4p3xzYu tdPPthGC2livPXzbtQGCci4M2njBhwQ2h5zx9n7ZCSKCLSZAsri+bJ6W+YRKFzqVAN2c Vv5A== 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=jZztdIGW4zfdiYt2jAIeF89dIh/EIqz1u6bvbOBO2S6uIiplXPQoI+hajsM1czaLqy O7Sa4j7gpNo1nLC9UvM3ltFSeQqTU/YK81mUnF/863nxqkb8So8qy+R6XYeHyHQs5S2j SfDlxVtKYvChSSOrjPc7lgztB3f3EgNRQ+UufrKN2Xne10yILqzwrXPOsV7Bz0I2hzc3 atkkfYcDJDTyGdL5kX0aAXUGNlJNQjtZ4EhwMNtNcGzAOunIELNLL+0iewWVr2WKrprt D+Hqjx+PDJI41JAOlI72bHvQ6N6FsPkYKTN8ZNilbRByVLKLMwUzFs1PQUd6Vk0Pdbfd RqnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=F5EFrc/l; 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 h12si11629511pln.256.2017.06.20.02.38.57; Tue, 20 Jun 2017 02:38:58 -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=F5EFrc/l; 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 S1752550AbdFTJiq (ORCPT + 25 others); Tue, 20 Jun 2017 05:38:46 -0400 Received: from mail-wm0-f41.google.com ([74.125.82.41]:35708 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753127AbdFTJim (ORCPT ); Tue, 20 Jun 2017 05:38:42 -0400 Received: by mail-wm0-f41.google.com with SMTP id x70so16046426wme.0 for ; Tue, 20 Jun 2017 02:38:37 -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=F5EFrc/l7Z2z1eWh5Jc6+zksBDs38309BWNRJHsuBUOvklhx1sfEsJuz6Y1S/l/tB4 decPySmhbn9oRcIILZrFgNWGurMtRTSvKi1qGqlXUJChXRT+6eZhsmNSi32SKRqkOLrB rWXCiWEiqB5gk1SgbCA02TdF+mK3+w/r2TMMk= 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=dMJWmPM351357sB1v2/GQFu6Ctpx46navNc3Aqns2aWV2Qz6IA8ViEZTO6MibxniAk 1nlAuMqPTabt5dNl5QppHKQGOkKXBjrFJSlK96+ytQElOl/B3iAqhkAN3Ge72bvIoEhd y7AWzbGMbNygbd6JUL8HgAZfRMPSiQwD0OpBbJ8jNu3MF3Qt1wAb/zXYeDTXWc5KPan5 484kfhqLyAuxTXXj74WIfsOzBsMXBsKwlRsLXVSeOisAaYLB6tHXglJnGfJ3NAMYYB4J ITJ7ELmu8dWr72iEBlr/c6U2NP8xJQDuceuSP/Bz4XnmGG6iitcItpi5zSXolijw7GiQ Soxw== X-Gm-Message-State: AKS2vOwbBSPHxo+ULR8xdK7MYe3a+UCWb7WIQhJono4ozjK4HIfmkXRf qDZ5QUy5vimtVpAM X-Received: by 10.28.18.201 with SMTP id 192mr2045219wms.2.1497951511243; Tue, 20 Jun 2017 02:38:31 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.38.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:38:30 -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 44/51] rtc: sysfs: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:52 +0200 Message-Id: <1497951359-13334-45-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. Signed-off-by: Benjamin Gaignard CC: Alessandro Zummo CC: Alexandre Belloni CC: 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 Tue Jun 20 09:35:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 105961 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1275858qgd; Tue, 20 Jun 2017 02:41:08 -0700 (PDT) X-Received: by 10.98.10.2 with SMTP id s2mr29462426pfi.121.1497951668841; Tue, 20 Jun 2017 02:41:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497951668; cv=none; d=google.com; s=arc-20160816; b=OPQG0UhksMw/JKRP4BhJwbu/669uiPyPTNU8yrfmWyvxbfqsqexfsTCLN/Iedhwf5+ S9EOfSu+qFamc1uChAeTFq1yUaf//6dEe2beJGjH4U0Q4XoLgA29o9pCMsKecEzFBip4 Ol7DPkoipJeVNZGCQ89oOLTuww86R9/hH6xOQsx7291LTB6qJbaucn8yW9bhA+SJE4zs ROuxcU2gFq2iACMcDcHJS6UYy847U/Lv4qq3YaSaOY1YDUwNTdrSqBIj0cVkZEX7VAAS PwyaLZTWR904rweRyj/khbXFsIUpfJCdqUtyZBrML0exgUyjjzh/1nOjkOyXLgr/6D7Q ssyA== 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=qZW2G+fipSS25rq3gUwa4EK0OIZISlbbiERdCWYVhq8=; b=TU6Zaup3bFwQL3rzZpNMFXL1Mo9K90C4pPGjXWYUtGAcNGl4UEart2n3P2N+2hjTDY P4CGKkpTwfV3v4iQN4ULOEIQDo5ixBcu0Min/b2/Pbvw6HjAUKUmOQSiWlAuTcoH/6uM lZ+YT6fHpodUAYnqVHKFI+CYY6p91aGlMZjFVUspYXe7LQ9FHqIdmXNTo38Q+DujWfzU ylp2IwlthNXHKAVbXT1ftSSAhRS6ZTP5Erg1F6DLbGNjnAXQprRF3yZDNHQh+t6YCFVr QnTEBL3HR0/u7VN27bnhc4liZERz5mHoRDtPzxyTxMW6loFW5JolSJCcCO6U1fUXPA69 SXzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=aAUIKD1V; 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 e3si759071pgn.367.2017.06.20.02.41.08; Tue, 20 Jun 2017 02:41: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=aAUIKD1V; 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 S1753116AbdFTJlE (ORCPT + 25 others); Tue, 20 Jun 2017 05:41:04 -0400 Received: from mail-wr0-f176.google.com ([209.85.128.176]:34378 "EHLO mail-wr0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753113AbdFTJij (ORCPT ); Tue, 20 Jun 2017 05:38:39 -0400 Received: by mail-wr0-f176.google.com with SMTP id 77so88384879wrb.1 for ; Tue, 20 Jun 2017 02:38: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=qZW2G+fipSS25rq3gUwa4EK0OIZISlbbiERdCWYVhq8=; b=aAUIKD1VNOV1rE2xodCZ2LLbV2vFNRST9z6ri0GlKTvUB3aos9ooIFWSS/1SqwIvYq 5BuSxMg1xnpb1Tzz7mAFZzIH90X0yG32GWqbdsGnQ61GhgIDxsa+kx5zJpjAuuCrVy5b 4isyN6pLzfBruWWecJZTyctVU5ySBCEVuSBjw= 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=qZW2G+fipSS25rq3gUwa4EK0OIZISlbbiERdCWYVhq8=; b=Ycw3DKFoS2jl/f5cCsBBno69fSqJqFDIwWSmw7w9Ro9iTxTg14hrTdKfiBURMvBHvq oRsEQSLYVTui9EDL+1vfQnBCV/tstZA377GvP8vua25BoPRGeUvjzmGqk67387oOLX/8 UqcOG6J7xkpYuRqt5JLznTLNMHsex2fea6/1tfTKuRAzHdNt2pKezQBBxiphuy6G+2C1 cGVuVC1waRyTvFuOsdLeVXOrNey3mD5L+j27cyIeNzzw7xh4jv+SulPjce58GilX+upq ZUztufsaUyil4xxvhGfAj//yw6EhutNo4193SCSyeO9csAvGnt56JEigM+KWBnOXJP6J 4iiw== X-Gm-Message-State: AKS2vOz+7/bOPEoNZ2jMpVdE2q6zxVogaD5f9qBjKE04rZ7+2hEWOUPS rhP+KxK6VJo9/ijr X-Received: by 10.223.176.164 with SMTP id i33mr18068408wra.165.1497951513283; Tue, 20 Jun 2017 02:38:33 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.38.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:38:32 -0700 (PDT) From: Benjamin Gaignard To: benjamin.gaignard@linaro.org Cc: linaro-kernel@lists.linaro.org, Thierry Reding , Jonathan Hunter , Alessandro Zummo , Alexandre Belloni , rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org Subject: [PATCH 45/51] rtc: tegra stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:53 +0200 Message-Id: <1497951359-13334-46-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. Signed-off-by: Benjamin Gaignard CC: Thierry Reding CC: Jonathan Hunter CC: Alessandro Zummo CC: Alexandre Belloni CC: rtc-linux@googlegroups.com CC: linux-kernel@vger.kernel.org CC: linux-tegra@vger.kernel.org --- drivers/rtc/rtc-tegra.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-tegra.c b/drivers/rtc/rtc-tegra.c index d30d57b..a429884 100644 --- a/drivers/rtc/rtc-tegra.c +++ b/drivers/rtc/rtc-tegra.c @@ -110,7 +110,7 @@ static int tegra_rtc_wait_while_busy(struct device *dev) static int tegra_rtc_read_time(struct device *dev, struct rtc_time *tm) { struct tegra_rtc_info *info = dev_get_drvdata(dev); - unsigned long sec, msec; + unsigned long long sec, msec; unsigned long sl_irq_flags; /* RTC hardware copies seconds to shadow seconds when a read @@ -122,9 +122,9 @@ static int tegra_rtc_read_time(struct device *dev, struct rtc_time *tm) spin_unlock_irqrestore(&info->tegra_rtc_lock, sl_irq_flags); - rtc_time_to_tm(sec, tm); + rtc_time64_to_tm(sec, tm); - dev_vdbg(dev, "time read as %lu. %d/%d/%d %d:%02u:%02u\n", + dev_vdbg(dev, "time read as %llu. %d/%d/%d %d:%02u:%02u\n", sec, tm->tm_mon + 1, tm->tm_mday, @@ -140,7 +140,7 @@ static int tegra_rtc_read_time(struct device *dev, struct rtc_time *tm) static int tegra_rtc_set_time(struct device *dev, struct rtc_time *tm) { struct tegra_rtc_info *info = dev_get_drvdata(dev); - unsigned long sec; + unsigned long long sec; int ret; /* convert tm to seconds. */ @@ -148,9 +148,9 @@ static int tegra_rtc_set_time(struct device *dev, struct rtc_time *tm) if (ret) return ret; - rtc_tm_to_time(tm, &sec); + sec = rtc_tm_to_time64(tm); - dev_vdbg(dev, "time set to %lu. %d/%d/%d %d:%02u:%02u\n", + dev_vdbg(dev, "time set to %llu. %d/%d/%d %d:%02u:%02u\n", sec, tm->tm_mon+1, tm->tm_mday, @@ -174,7 +174,7 @@ static int tegra_rtc_set_time(struct device *dev, struct rtc_time *tm) static int tegra_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) { struct tegra_rtc_info *info = dev_get_drvdata(dev); - unsigned long sec; + unsigned long long sec; unsigned tmp; sec = readl(info->rtc_base + TEGRA_RTC_REG_SECONDS_ALARM0); @@ -185,7 +185,7 @@ static int tegra_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) } else { /* alarm is enabled. */ alarm->enabled = 1; - rtc_time_to_tm(sec, &alarm->time); + rtc_time64_to_tm(sec, &alarm->time); } tmp = readl(info->rtc_base + TEGRA_RTC_REG_INTR_STATUS); @@ -220,10 +220,10 @@ static int tegra_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled) static int tegra_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) { struct tegra_rtc_info *info = dev_get_drvdata(dev); - unsigned long sec; + unsigned long long sec; if (alarm->enabled) - rtc_tm_to_time(&alarm->time, &sec); + sec = rtc_tm_to_time64(&alarm->time); else sec = 0; @@ -236,7 +236,7 @@ static int tegra_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) if (sec) { tegra_rtc_alarm_irq_enable(dev, 1); - dev_vdbg(dev, "alarm set as %lu. %d/%d/%d %d:%02u:%02u\n", + dev_vdbg(dev, "alarm set as %llu. %d/%d/%d %d:%02u:%02u\n", sec, alarm->time.tm_mon+1, alarm->time.tm_mday, From patchwork Tue Jun 20 09:35:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 105958 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1275363qgd; Tue, 20 Jun 2017 02:39:43 -0700 (PDT) X-Received: by 10.101.87.206 with SMTP id q14mr30084570pgr.153.1497951583456; Tue, 20 Jun 2017 02:39:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497951583; cv=none; d=google.com; s=arc-20160816; b=ytKEzTpyte8gAo8grq0ZKu8Cu4h99lRedsenNue4nacX2EcnWbfWQSO1AO2WfFf41a OutF1B05hOFZetKTNedfaqxZS5FJMUvscfm/v6xnJCOVSFBLIhug8o7b6i/TgfUurueS mQC6D+uBAjlZrqf4QNfcRveZ9/vei0gz6MIxt9JLAA2oYDy0/G73gxeDZ8hFAiS37KZt uftrlBXDbZllVuN0oDLF0r9WEzcUmRxQ9KYsbPyvTqJR5v1eJrFV/e3trqIV6iFPZP7G nLLxmg7CgNC1/40g/0fG8VRGzqlXfvu2Ra/8I7sXeKAtFW1tc/np3aXY1iXd+PZKwCYr 1LdA== 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=KhJkBp8Z62qqRJPyG30HY6r3XIKJcu9Yocq3Z0PQZrK9fEkNxi6oaM10grEuzDfv51 MNHdmLsGEHwT5gcguGCwI/O4b164XwG1fJpRZTGAUIJ+Gnb7pAOrM5coQXaHsLcbWfLS V4fIxqvhVePKXeBEVxCE1JFtFMhBJc8A3PHhXImSIo2zua4tbss81gKOgOFYKcC95ntS ul5D4X1WImo0RS0PCXJLSLItZSVNIifn0Em7J3Ct3k8RjdCDr9szkJV53VaplLOJxz1v ClwnE4i8RR6C17BrMgkXbPu95tzxMCVmT5piXMuLg3QGL3VmRg9Jbq5QqsdU7owD9Bj/ n/Rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=Kf6r+7wK; 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 d6si4535637plj.558.2017.06.20.02.39.43; Tue, 20 Jun 2017 02:39:43 -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=Kf6r+7wK; 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 S1753148AbdFTJio (ORCPT + 25 others); Tue, 20 Jun 2017 05:38:44 -0400 Received: from mail-wm0-f54.google.com ([74.125.82.54]:38108 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753046AbdFTJig (ORCPT ); Tue, 20 Jun 2017 05:38:36 -0400 Received: by mail-wm0-f54.google.com with SMTP id u195so14588192wmd.1 for ; Tue, 20 Jun 2017 02:38:35 -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=Kf6r+7wKLrxP1W0iiqFHhYX+HcHyx2JTxC8LR2eZY6oT46p7/5nH/4LDc+ZlqwBAzl hmw646I6Vncj9jaF0gYrJMsHTpd4FbZaW7K4uVTb0UJgffP2rC8bVpintAiul75nCTeR Tseyjj0jVaXfkYugJcbVueuF1ku/gHYDb440k= 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=TbjMtw2ma1kRzalvnb/OS5RRLu5T7zRH2nwibwqwmWhygimkNuv3RYFyT8ynzlKtZi Cz3anV3ldNRT7zzGv66pPgCSJson4qG26Ujg4C24RYl70EFNnHWV2DCbEZTx0A6mvcJw VWiJ5tcK13mdYQ7CYrmHatfxGqaDyO0b/yftkXLy74k3X86B0BxOdnML48QMBV2WtVjp XRDEVlSM/R+2tkI2P03ElwrBM/83L8jelGHipYXHNcLqATd4PyzmA/KQ8g0Ugf/ak5y3 ZFZpVX5Fftk676eLdE0RbAFe1wNqx1Po8BNGVkCCQT53cwTFpb8L8OHGJSjed+trDOZ5 YS2w== X-Gm-Message-State: AKS2vOzY20HlFSxPg0ekQlBxRaWWmFMKCAwTle5IIUiTt5reBqkqgZKD 1ZANdh9d+vOZwW/A X-Received: by 10.28.178.198 with SMTP id b189mr735726wmf.106.1497951514884; Tue, 20 Jun 2017 02:38:34 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.38.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:38: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 46/51] rtc: test: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:54 +0200 Message-Id: <1497951359-13334-47-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. 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)) { From patchwork Tue Jun 20 09:35:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 105955 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1275123qgd; Tue, 20 Jun 2017 02:38:57 -0700 (PDT) X-Received: by 10.99.96.204 with SMTP id u195mr14647963pgb.125.1497951537705; Tue, 20 Jun 2017 02:38:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497951537; cv=none; d=google.com; s=arc-20160816; b=IY/3uwIo1TVet9idIXWSfFC/9i2MM7VM9kP8EWVh/4aw7rJ/FS1RB1AAkN8rL9PEQ6 /hacAlhI0fxycUt4HUAP5CAYdquUvzjmkq1u92OT0/3hP7UPfe9owss0mCLYJ5Q6LNxB cYt3+78bLryTWwvwouHHd/k6ADV2U0B5dP2Niy+7ZTd7yHme2FZpw8tSfYjkj5gLO3KL UDfk4qAQzQvM2MkICfn50jBllGw1KC4Gb9X9HWO1/iktcwVLnGZ1ts313feJRU3fXwi/ WleH/eMbqQeRvHwwto+ZPQhdKYQTh6wO2rgOT3QzV4uaSVZxFrUFbq9v1lllkdNofKDi rC1w== 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=mZVfXw+bISpOHkaT9tQ/HKREYLInxA8TdPg+P0ikR50=; b=XUG4f1cbXH3mvk35kD7cYRmUODH7DJ0XW6d90FPJQEbV9+UaSx4zNEMgcNxlmjE1kg 9Rbp5E04ea20SZeK4VaccaC3FAWA2lW2cOvwNiJgR4IaWhnn1u7BC6xkcvNXkDBr9ZLB abgWK9zfZ0UDDXc8sMyb27dviWbIC5pHgfhsTd0bjmHa/MF5rSSjVN1cOA8nXuaGuzew uKeuL5W7TQhiJmD9Fr7X7wmwgAa8p+P0xQc9/G6a9c8zu4em++Z62l5vFA27fh1DWTKd VdIiKrzLknFIh1W+aADyQQ/UHaqx6MUN85nQBI8baP8/ZZ3l3T6i2x2PStTr+i5CYHCr ESBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=bQiBQZtH; 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 h12si11629511pln.256.2017.06.20.02.38.57; Tue, 20 Jun 2017 02:38:57 -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=bQiBQZtH; 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 S1753132AbdFTJim (ORCPT + 25 others); Tue, 20 Jun 2017 05:38:42 -0400 Received: from mail-wr0-f175.google.com ([209.85.128.175]:34866 "EHLO mail-wr0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753105AbdFTJii (ORCPT ); Tue, 20 Jun 2017 05:38:38 -0400 Received: by mail-wr0-f175.google.com with SMTP id y25so49140070wrd.2 for ; Tue, 20 Jun 2017 02:38:37 -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=mZVfXw+bISpOHkaT9tQ/HKREYLInxA8TdPg+P0ikR50=; b=bQiBQZtHXWnQZ9euMtY5TnpXXeK5AYo7NLfHQZ5IkFFroZbn53EoDbHxyOYosiRlCW Lz6p1qe2DGiFvWOgNyMPhmJTumXAdje5AnESK5rmjQ1CEA81fJTqn8kFgupVu9ZhzLNv bDbfEBuWUf/o9gIWsy6uU3HBRIXSNF6SfAcDU= 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=mZVfXw+bISpOHkaT9tQ/HKREYLInxA8TdPg+P0ikR50=; b=oMsmjoQhxtKoPnJS4P7t0PCjDkjCeu9WkwQZfs4KHSlyukotdfsgiH3G+E0t0nBmyE Ywzh3mnqKhVIX3al9urFPFpTz3j1WB5pvomPTlomo1IAp+RmmzX6PbCtDyK/A1XU7In9 UBymy2giQWsjDY0RlU9Gmt2f+PtZ4uDtkygd6hKO4/AXBQsVf3tADeSCc219pZdlUvrh nsQH5FBdHnnbqOVhfgVEDU+PWgVZjC2t6gv/NbRvcQN8styjLfg6F4WHrnRhst0lDBos xRRhU7eSSiVd102/2pW1u8PXzdJFPTIWpUkdePx7H9/tclGpCezq8CZPJ3qP59oXiAJq zufw== X-Gm-Message-State: AKS2vOyI03C7EJxyyuhR/vfHEq/Ft6LbjTuQLL0vrkUHn24WkS3mXczP qFXpG3+gNCABBm8z X-Received: by 10.223.151.213 with SMTP id t21mr6032253wrb.20.1497951516550; Tue, 20 Jun 2017 02:38:36 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.38.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:38: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 47/51] rtc: tps6586: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:55 +0200 Message-Id: <1497951359-13334-48-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. Signed-off-by: Benjamin Gaignard CC: Alessandro Zummo CC: Alexandre Belloni CC: rtc-linux@googlegroups.com CC: linux-kernel@vger.kernel.org --- drivers/rtc/rtc-tps6586x.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-tps6586x.c b/drivers/rtc/rtc-tps6586x.c index a3418a8..2383636 100644 --- a/drivers/rtc/rtc-tps6586x.c +++ b/drivers/rtc/rtc-tps6586x.c @@ -71,7 +71,7 @@ static int tps6586x_rtc_read_time(struct device *dev, struct rtc_time *tm) struct tps6586x_rtc *rtc = dev_get_drvdata(dev); struct device *tps_dev = to_tps6586x_dev(dev); unsigned long long ticks = 0; - unsigned long seconds; + unsigned long long seconds; u8 buff[6]; int ret; int i; @@ -89,7 +89,7 @@ static int tps6586x_rtc_read_time(struct device *dev, struct rtc_time *tm) seconds = ticks >> 10; seconds += rtc->epoch_start; - rtc_time_to_tm(seconds, tm); + rtc_time64_to_tm(seconds, tm); return rtc_valid_tm(tm); } @@ -98,18 +98,18 @@ static int tps6586x_rtc_set_time(struct device *dev, struct rtc_time *tm) struct tps6586x_rtc *rtc = dev_get_drvdata(dev); struct device *tps_dev = to_tps6586x_dev(dev); unsigned long long ticks; - unsigned long seconds; + unsigned long long seconds; u8 buff[5]; int ret; - rtc_tm_to_time(tm, &seconds); + seconds = rtc_tm_to_time64(tm); if (seconds < rtc->epoch_start) { dev_err(dev, "requested time unsupported\n"); return -EINVAL; } seconds -= rtc->epoch_start; - ticks = (unsigned long long)seconds << 10; + ticks = seconds << 10; buff[0] = (ticks >> 32) & 0xff; buff[1] = (ticks >> 24) & 0xff; buff[2] = (ticks >> 16) & 0xff; @@ -157,16 +157,16 @@ static int tps6586x_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) { struct tps6586x_rtc *rtc = dev_get_drvdata(dev); struct device *tps_dev = to_tps6586x_dev(dev); - unsigned long seconds; - unsigned long ticks; - unsigned long rtc_current_time; + unsigned long long seconds; + unsigned long long ticks; + unsigned long long rtc_current_time; unsigned long long rticks = 0; u8 buff[3]; u8 rbuff[6]; int ret; int i; - rtc_tm_to_time(&alrm->time, &seconds); + seconds = rtc_tm_to_time64(&alrm->time); if (alrm->enabled && (seconds < rtc->epoch_start)) { dev_err(dev, "can't set alarm to requested time\n"); @@ -196,7 +196,7 @@ static int tps6586x_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) if ((seconds - rtc_current_time) > ALM1_VALID_RANGE_IN_SEC) seconds = rtc_current_time - 1; - ticks = (unsigned long long)seconds << 10; + ticks = seconds << 10; buff[0] = (ticks >> 16) & 0xff; buff[1] = (ticks >> 8) & 0xff; buff[2] = ticks & 0xff; @@ -212,8 +212,8 @@ static int tps6586x_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) { struct tps6586x_rtc *rtc = dev_get_drvdata(dev); struct device *tps_dev = to_tps6586x_dev(dev); - unsigned long ticks; - unsigned long seconds; + unsigned long long ticks; + unsigned long long seconds; u8 buff[3]; int ret; @@ -227,7 +227,7 @@ static int tps6586x_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) seconds = ticks >> 10; seconds += rtc->epoch_start; - rtc_time_to_tm(seconds, &alrm->time); + rtc_time64_to_tm(seconds, &alrm->time); return 0; } From patchwork Tue Jun 20 09:35:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 105962 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1275860qgd; Tue, 20 Jun 2017 02:41:09 -0700 (PDT) X-Received: by 10.99.124.16 with SMTP id x16mr31091407pgc.280.1497951669264; Tue, 20 Jun 2017 02:41:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497951669; cv=none; d=google.com; s=arc-20160816; b=H+qx09aDZVUgvrm92+oxdlWSnMH+wTl37GHTdYHRIHZ8gUjXC+ap5PmT42ucX+mvNU GAiyYD0pQKaGY53wB4CW37//BvRdNJGl1no6r+wSWb4aF2v0FV1lZ7ZQfVaf/9AdEj8w eHNI0MuKhWGFX94Tv2Y+9FqwCV1WSNRQO1u7JwQ1gM5d+E/2fyLXK27Ddy1IOZtRhQLy rxNHdv4lSBUXKwvyzj8ePRAAF/1pF/JogOpssCxF6jX5cM8iqHDc3uaJeqVo1Atuuarr 0ferhOSPbPIHnlYWaQx+PkGfFAwOvtcpJIIUgP278uywNqnmAOypyVHhqe7ZkSHLAdbg gvsA== 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=sO23rGWEA1ycy/BJDtsohTww8VKhk6/zELNRLNBVuBg=; b=N9C04hnlHZ8egviUSPbB4W6M2a9OpHvyXmQC4lRr45RBOlt2BZk4CFc50KyJeV1cZa 55xXnqBXB/mQ+uydJNPWzg3oweQPQailvv6WuDtqjRHcpTe9xF0UIxDfJa7iUNVReNBy 5Lcc80GoTtSA6mPxWD+H+wUOGsXIgpR5AtHAvcGMsyOAe51Bf5x7GCAS1LIROFIR5PGN HLh7FGCxKnRsFzMA/xvNypXWuImUCskaupWKOLIsXH0nCdZIEcZFBM+dUzCD1iOPzFcT y4ZpDKgMjFMAOG/Qb03B4NRo7pbz4ETysGg1r9ipghay9Mrr8nqQmtv5vP/nDO4lqV+x 699g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=WHPwA8q3; 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 e3si759071pgn.367.2017.06.20.02.41.08; Tue, 20 Jun 2017 02:41:09 -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=WHPwA8q3; 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 S1753176AbdFTJlG (ORCPT + 25 others); Tue, 20 Jun 2017 05:41:06 -0400 Received: from mail-wm0-f42.google.com ([74.125.82.42]:38143 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752077AbdFTJij (ORCPT ); Tue, 20 Jun 2017 05:38:39 -0400 Received: by mail-wm0-f42.google.com with SMTP id u195so14589555wmd.1 for ; Tue, 20 Jun 2017 02:38:39 -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=sO23rGWEA1ycy/BJDtsohTww8VKhk6/zELNRLNBVuBg=; b=WHPwA8q3u+uX2c6aSXx/g0Y3WvH7En8KgR34Qz5XokQys5Le5UbqRluFvaqfuFWJCP FjcTpATGSdBr9flHcaJ3MqCX6nzaX/ccfGkR6lQvtTudNyU6LWaJlV3hERsM4sI2HwG1 hYm94nqWuHsu5TX29ECWndLxdkmm6vSALCZ0k= 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=sO23rGWEA1ycy/BJDtsohTww8VKhk6/zELNRLNBVuBg=; b=tqrfxrx+b0Syqpi2TwlZWfyV2y1PJAAdrguJ2Z3cMLBr6WVHgxZHfl3uxTp+LEJV2V 7++aQ6KvXH5V1m+ocFfGQ4pfmZCmXmGA+6EpvO2wiFxHuX9s/e55GiifqvVNCbDQ5OxX hxOhCvsKBJmDHDq2L8TZ8Sdf5qrSeJ1ZNW1AtiSXRr6znyeSiyOkHF5a2d7gx0Fbe5bW y3KuK6stAVg9ML0PoGnmFZT/BZwjH9SVKdQ/Ir+LVhRLC25DUKGOEfoocCs+tFeCFx47 MZfYGzaOSyt7XrUmuD0EW1UFj03D322veSJUy44czlhUEu0+nkKyBeUTFls6QtVcw7uz iI6A== X-Gm-Message-State: AKS2vOx9M3hO/PJP0PxqhdGLrzwfGc2O4Rw9N2s3KWqFd45KgZlpakP4 3hfPM9GP1on5B27VhpHByA== X-Received: by 10.28.170.15 with SMTP id t15mr2099411wme.16.1497951518257; Tue, 20 Jun 2017 02:38:38 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.38.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:38:37 -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 48/51] rtc: vr41xx: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:56 +0200 Message-Id: <1497951359-13334-49-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. Signed-off-by: Benjamin Gaignard CC: Alessandro Zummo CC: Alexandre Belloni CC: rtc-linux@googlegroups.com CC: linux-kernel@vger.kernel.org --- drivers/rtc/rtc-vr41xx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-vr41xx.c b/drivers/rtc/rtc-vr41xx.c index e1b86bb..db51ed6 100644 --- a/drivers/rtc/rtc-vr41xx.c +++ b/drivers/rtc/rtc-vr41xx.c @@ -138,12 +138,12 @@ static void vr41xx_rtc_release(struct device *dev) static int vr41xx_rtc_read_time(struct device *dev, struct rtc_time *time) { - unsigned long epoch_sec, elapsed_sec; + unsigned long long epoch_sec, elapsed_sec; epoch_sec = mktime(epoch, 1, 1, 0, 0, 0); elapsed_sec = read_elapsed_second(); - rtc_time_to_tm(epoch_sec + elapsed_sec, time); + rtc_time64_to_tm(epoch_sec + elapsed_sec, time); return 0; } @@ -175,7 +175,7 @@ static int vr41xx_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *wkalrm) spin_unlock_irq(&rtc_lock); - rtc_time_to_tm((high << 17) | (mid << 1) | (low >> 15), time); + rtc_time64_to_tm((high << 17) | (mid << 1) | (low >> 15), time); return 0; } From patchwork Tue Jun 20 09:35:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 105960 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1275671qgd; Tue, 20 Jun 2017 02:40:35 -0700 (PDT) X-Received: by 10.99.43.5 with SMTP id r5mr30167386pgr.135.1497951634957; Tue, 20 Jun 2017 02:40:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497951634; cv=none; d=google.com; s=arc-20160816; b=VJiSSWOqAKyN/b25YH3wA9tXcM7z5BOFEVPlDpNdqdXJjQ3gZrMDlNHXdi8Fl5C0iK FW2vm6HGtbqrlnXWLT0ARsD53BAIIspSv8yntVA2tv5HZ+Kol1SfBErHNoVKOqlC8SFd XqBtxEReZyCb3j6yxv6eCFoPLQjcp3bQVYkANtZMRYHEUSelgqFplwf8Ot+e2k6V3A2L E1I0MhSkh3+DRr2PIeTv7eC2E4x7BXz2LFbnmBteXV9qawHZhk18LtWClxQfIN6ztClZ q5ogvG7VcA1kW00HB9iZe2EJ1v9xnb9zDG1izNmXqlz54Gh8UF1JSTXaT1llEQC1uHZK M2LQ== 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=ADEuBqQGCjqkPkRH5eMD7WRJK1k/+jVp5dnpZhHeNVI=; b=zZOX3Efq/pDkeavDuf0X8zlN96pJgW1tMtzvrfsml2+kyWoQ9sUHNimOkQPCvvQV22 +5uMXwfEl7/h5vDs6aPz0ZZso1hUi70QMwdetp4RunenwC1/gciUSnAhWAcUyv4zixdF 8fG9JoPfBuzYq/u+YTvZTD4hXotHTKcHw5OR16rayd8iHbpD1AIiFV0+RMT8wM6hURaQ CXPk7AzpHbTszmU4KyDEV70CuGFZo0V/zFhBhHDeBjXaWdFEaOPJ4iVdvJYBXpMOu8fb soZe14iVVyKEUeyk8bDLKqhRt8jpRZpiQ+SFQmVW/gQbVhmTrYs1jVVnFsV8LHnaqBpe QG7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=HH7CVvMT; 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 h1si10909193pld.476.2017.06.20.02.40.34; Tue, 20 Jun 2017 02:40: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=HH7CVvMT; 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 S1752631AbdFTJkU (ORCPT + 25 others); Tue, 20 Jun 2017 05:40:20 -0400 Received: from mail-wm0-f48.google.com ([74.125.82.48]:35792 "EHLO mail-wm0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753116AbdFTJil (ORCPT ); Tue, 20 Jun 2017 05:38:41 -0400 Received: by mail-wm0-f48.google.com with SMTP id x70so16049885wme.0 for ; Tue, 20 Jun 2017 02:38:40 -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=ADEuBqQGCjqkPkRH5eMD7WRJK1k/+jVp5dnpZhHeNVI=; b=HH7CVvMT08PZw7AJAgfUR47JcAxl+p/LvQ7q1pP6JwZclGgmGxzRV24XaSnpbSnsnq w5VkoQweIqeimeQpbC7NyKKMwHJoW6fXbvadLP/QzWGV3ZvruFL6AIKEek9eM2Icn//A k/sKtFRjoziq9xBQJPz3BtcZ2yebxSmZhSE40= 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=ADEuBqQGCjqkPkRH5eMD7WRJK1k/+jVp5dnpZhHeNVI=; b=UW2fVrnF89d5+5uaUfjDOb9dmpe0l1PMelkIhR2apXIKzs2uxjK1DjHavJBOVwp0m1 j8sGFg5wrnqerM9Ceo+SB9XQPSlezbDt2Qx+vf2ygJR84JnV3bpd/3M4r0qtSxxd4Met QplkIVyoE4oapPB52Zo/SmQpC7ab8ynpywy1DwLf9GdH+bwPLArDL/BYvILOVXkIi7dd dSeoUSDDELmivG8PUyFru715e4nZZI0T16yRuQJSq9KuPPvDJSz0Bd4HyMGRg6tnpftp 5Sql7hd3+RMySiZFyTrZTrIAXESJlvNTIDB+FVr3xRPdGBAPRxTJ9+/LcaCmkyORNNAc 6grw== X-Gm-Message-State: AKS2vOwe2/gueu5ugetQf4b3JFg6HYWg57UCJNysjogh4/T6wW5QcDb3 LX1abBOpqTYpksk9 X-Received: by 10.28.229.6 with SMTP id c6mr1945043wmh.49.1497951519964; Tue, 20 Jun 2017 02:38:39 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.38.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:38:39 -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, patches@opensource.wolfsonmicro.com Subject: [PATCH 49/51] rtc: wm831x: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:57 +0200 Message-Id: <1497951359-13334-50-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. 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 CC: patches@opensource.wolfsonmicro.com --- drivers/rtc/rtc-wm831x.c | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-wm831x.c b/drivers/rtc/rtc-wm831x.c index 75aea4c..e42b07c 100644 --- a/drivers/rtc/rtc-wm831x.c +++ b/drivers/rtc/rtc-wm831x.c @@ -153,9 +153,9 @@ static int wm831x_rtc_readtime(struct device *dev, struct rtc_time *tm) continue; if (memcmp(time1, time2, sizeof(time1)) == 0) { - u32 time = (time1[0] << 16) | time1[1]; + u64 time = (time1[0] << 16) | time1[1]; - rtc_time_to_tm(time, tm); + rtc_time64_to_tm(time, tm); return rtc_valid_tm(tm); } @@ -169,12 +169,12 @@ static int wm831x_rtc_readtime(struct device *dev, struct rtc_time *tm) /* * Set current time and date in RTC */ -static int wm831x_rtc_set_mmss(struct device *dev, unsigned long time) +static int wm831x_rtc_set_mmss64(struct device *dev, time64_t time) { struct wm831x_rtc *wm831x_rtc = dev_get_drvdata(dev); struct wm831x *wm831x = wm831x_rtc->wm831x; struct rtc_time new_tm; - unsigned long new_time; + unsigned long long new_time; int ret; int count = 0; @@ -215,11 +215,7 @@ static int wm831x_rtc_set_mmss(struct device *dev, unsigned long time) if (ret < 0) return ret; - ret = rtc_tm_to_time(&new_tm, &new_time); - if (ret < 0) { - dev_err(dev, "Failed to convert time: %d\n", ret); - return ret; - } + new_time = rtc_tm_to_time64(&new_tm); /* Allow a second of change in case of tick */ if (new_time - time > 1) { @@ -238,7 +234,7 @@ static int wm831x_rtc_readalarm(struct device *dev, struct rtc_wkalrm *alrm) struct wm831x_rtc *wm831x_rtc = dev_get_drvdata(dev); int ret; u16 data[2]; - u32 time; + u64 time; ret = wm831x_bulk_read(wm831x_rtc->wm831x, WM831X_RTC_ALARM_1, 2, data); @@ -249,7 +245,7 @@ static int wm831x_rtc_readalarm(struct device *dev, struct rtc_wkalrm *alrm) time = (data[0] << 16) | data[1]; - rtc_time_to_tm(time, &alrm->time); + rtc_time64_to_tm(time, &alrm->time); ret = wm831x_reg_read(wm831x_rtc->wm831x, WM831X_RTC_CONTROL); if (ret < 0) { @@ -286,13 +282,9 @@ static int wm831x_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm) struct wm831x_rtc *wm831x_rtc = dev_get_drvdata(dev); struct wm831x *wm831x = wm831x_rtc->wm831x; int ret; - unsigned long time; + unsigned long long time; - ret = rtc_tm_to_time(&alrm->time, &time); - if (ret < 0) { - dev_err(dev, "Failed to convert time: %d\n", ret); - return ret; - } + time = rtc_tm_to_time64(&alrm->time); ret = wm831x_rtc_stop_alarm(wm831x_rtc); if (ret < 0) { @@ -346,7 +338,7 @@ static irqreturn_t wm831x_alm_irq(int irq, void *data) static const struct rtc_class_ops wm831x_rtc_ops = { .read_time = wm831x_rtc_readtime, - .set_mmss = wm831x_rtc_set_mmss, + .set_mmss64 = wm831x_rtc_set_mmss64, .read_alarm = wm831x_rtc_readalarm, .set_alarm = wm831x_rtc_setalarm, .alarm_irq_enable = wm831x_rtc_alarm_irq_enable, From patchwork Tue Jun 20 09:35:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 105959 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1275483qgd; Tue, 20 Jun 2017 02:40:02 -0700 (PDT) X-Received: by 10.98.166.196 with SMTP id r65mr29411819pfl.120.1497951602319; Tue, 20 Jun 2017 02:40:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497951602; cv=none; d=google.com; s=arc-20160816; b=c4Dqnmro4ESTftkLzxpcS//8f12QB2LCa5qzGmDi0ctgb2wV+4fGGUiKE/m8FxGZmT udK727chYhDNnA3fQFUUu/mzvPABTKC9EG+vIJaoJ/3+7UtQxlhTyMrfZUbm746p67tJ s4nuH+z4Ea6UwVpdrb1R0c4/r/ZwoW5XE3O6D9OuhO5g2b9R7BRLLtpEp7tPNtezoq4L lVLigWrSgh50cNC0Zd12MjwLZUY2YEo5VBkf4R0jvTHX2JLM8qx1hTJKbJgtcWrzohSo bYtbqYQzA1d8y3AXNXVGZAmf8HTCImeuEiqx+l2/7cQt072IDVoZ1lOsN/+l6p/qOIkR 3Q7A== 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=LUZO9XI+LaMBeUtsTmxC8aFc5qdwKJ3jq2ahjF4fYwo=; b=RfJTUUPyHFKr+Ji4GP90zSTFKeVqqmHm+EWEOjOhh4IdVzE9Ockblel9asaQCyyso2 Rvo8i6/4VRIj26tGMPMVbLR14O78Z4Xe7ViHEGE26HSDL1yHbuMpIp44loYq/G6cDWD2 AaPxLtTuXIlkKt+xMSCVYjkyVKD+ADodHNiZog/f08n/DKMTJnRksYTdRtNiV4iogMTP +gpDzNT53BVPluIVoExKmW6eZQeSi/jbbPXXegit5bBMHnWw+enrGEouu85DB7nPVfcP a8dOZ/Y29pssCAmmFPQhPseQ2dS/xH9decSwP9YQT1fD48HCrHT3Wkuwz512ZBDFP8FS gAgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=SB8gDV8g; 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 d6si4535637plj.558.2017.06.20.02.40.01; Tue, 20 Jun 2017 02:40:02 -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=SB8gDV8g; 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 S1751689AbdFTJj6 (ORCPT + 25 others); Tue, 20 Jun 2017 05:39:58 -0400 Received: from mail-wm0-f53.google.com ([74.125.82.53]:38176 "EHLO mail-wm0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753133AbdFTJim (ORCPT ); Tue, 20 Jun 2017 05:38:42 -0400 Received: by mail-wm0-f53.google.com with SMTP id u195so14590887wmd.1 for ; Tue, 20 Jun 2017 02:38:42 -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=LUZO9XI+LaMBeUtsTmxC8aFc5qdwKJ3jq2ahjF4fYwo=; b=SB8gDV8gGpwTauhvtf2ce/f+UYqEIuK2LP4H8muwB6IgI3VzCBIykbxteD8ViwbofW 28QE2auGesgb7xsdizXFfhUmO7L/DzDbJmnNqz9DOHbedOudPobtVwZBVc9BXVWlZYIP 0+1Ix9+D9C6NIXj5lmkh4DNKev/5sEUia7vCE= 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=LUZO9XI+LaMBeUtsTmxC8aFc5qdwKJ3jq2ahjF4fYwo=; b=FapCQlV8BidhVxTWhdrT4p8Fh3VcCgednDnlhk4gOkaNL27TcNa1FDsAQEjIsnmN/M 7CGcaSDwkKgEr+8usdS4kF7Dq2M6YeWz9oWbAio83iESVzL8WpN5d5uwgFOkAMz8FvZU bJdYb8wOfdhaHsI9VWZKw5PJJpF+gXuknmfd9Tj34m6byKdkYMcI3fL9967CdZwMr45N 15+MtiwjOn2fknptrfdbY6p/PpzsCkvmZZEeecyss8bp4e5HFOcyHOmL7QpeMHb60J5T 9thFSn1fROAvePqRhc3LmBPImC6wBOKopfj+CuLAA4x23ouqoCj1RlybTK9P3Jbp9zOY mdTQ== X-Gm-Message-State: AKS2vOxfHuU88tc3I5g9tzSt9R3OanstlaQTo0h507uFoBfoGoOwqfDH OMHp4y+915iLs5ir X-Received: by 10.28.65.68 with SMTP id o65mr1989550wma.68.1497951521629; Tue, 20 Jun 2017 02:38:41 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.38.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:38:41 -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 50/51] rtc: xgene stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:58 +0200 Message-Id: <1497951359-13334-51-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. 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-xgene.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-xgene.c b/drivers/rtc/rtc-xgene.c index 65b432a..c62b5b6 100644 --- a/drivers/rtc/rtc-xgene.c +++ b/drivers/rtc/rtc-xgene.c @@ -58,11 +58,11 @@ static int xgene_rtc_read_time(struct device *dev, struct rtc_time *tm) { struct xgene_rtc_dev *pdata = dev_get_drvdata(dev); - rtc_time_to_tm(readl(pdata->csr_base + RTC_CCVR), tm); + rtc_time64_to_tm(readl(pdata->csr_base + RTC_CCVR), tm); return rtc_valid_tm(tm); } -static int xgene_rtc_set_mmss(struct device *dev, unsigned long secs) +static int xgene_rtc_set_mmss64(struct device *dev, time64_t secs) { struct xgene_rtc_dev *pdata = dev_get_drvdata(dev); @@ -80,7 +80,7 @@ static int xgene_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) { struct xgene_rtc_dev *pdata = dev_get_drvdata(dev); - rtc_time_to_tm(pdata->alarm_time, &alrm->time); + rtc_time64_to_tm(pdata->alarm_time, &alrm->time); alrm->enabled = readl(pdata->csr_base + RTC_CCR) & RTC_CCR_IE; return 0; @@ -108,10 +108,10 @@ static int xgene_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) { struct xgene_rtc_dev *pdata = dev_get_drvdata(dev); unsigned long rtc_time; - unsigned long alarm_time; + unsigned long long alarm_time; rtc_time = readl(pdata->csr_base + RTC_CCVR); - rtc_tm_to_time(&alrm->time, &alarm_time); + alarm_time = rtc_tm_to_time64(&alrm->time); pdata->alarm_time = alarm_time; writel((u32) pdata->alarm_time, pdata->csr_base + RTC_CMR); @@ -123,7 +123,7 @@ static int xgene_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) static const struct rtc_class_ops xgene_rtc_ops = { .read_time = xgene_rtc_read_time, - .set_mmss = xgene_rtc_set_mmss, + .set_mmss64 = xgene_rtc_set_mmss64, .read_alarm = xgene_rtc_read_alarm, .set_alarm = xgene_rtc_set_alarm, .alarm_irq_enable = xgene_rtc_alarm_irq_enable, From patchwork Tue Jun 20 09:35:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 105957 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1275182qgd; Tue, 20 Jun 2017 02:39:08 -0700 (PDT) X-Received: by 10.98.25.19 with SMTP id 19mr29772024pfz.116.1497951547906; Tue, 20 Jun 2017 02:39:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497951547; cv=none; d=google.com; s=arc-20160816; b=0nwr+mIsulvt1wk6OAqf7uM9FF+mxSzVVq5Z5iTriQq9jsAMiQpp1x4I5hgNcg1hMX oxKQFW/sNLA8eYuMpmIv5kYwgVrzmWwFoGAv2JGQCBWP2LppFaLa4uGnMH/WXBiIOBGu 49uOTv8jlzk7RTGneT2UX+wGWMBxQ81Ids6i8vuXFqMBdlGoYc2fkiYEEJl/n0Jt1A2o je8xtUQPs7wbkOsJ0tbMEE6pqcFs46LQDrDjWZ1H//dtXPsxe1EKW4GmqKk2E0pU2qxf rqbrW8s8VBtbfrwXVc8mw7g0+AjOXj9QTKQBHE1avwcQscrpd0Ep2quZx3FyrCNR1nzo z9nw== 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=8XXioQipp3igOlPonRcLWMszRPWDIIQ21sTTscbKVQA=; b=ZavPJ3YSaBj6+7bxufYprXsgpeLEKyWrx6+RWGMFXbauekbS2MAkNcKIMMUmLyxAJ+ L4jcM6GYKKgwocAwT0z8MfzKD6gDNSIkvWVUHSVEI1/2yVD2viq0+XKaHRdlS6NWI6vt 67eFLF0Awo3sDUk4ll/ia9L3BooXvJDMobmK2jUd5nEScWVEaqhQI5qGQxS4TXRYbQ7r l/vax7PC8PpkDCph2WuOhi/cnX/XXHCpGkKI4pJ4rhuV4vrMrdKerQHK1ZL9NXr2+6pp N0whBfu/ZL88t307U+dtzzKE3UHPCL8Jf6yyuh5RkKsUIBygqGdyqYjnvjYIRzWRLN3i AVJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=T7N6+9Sl; 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 i133si10453146pgc.544.2017.06.20.02.39.07; Tue, 20 Jun 2017 02:39:07 -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=T7N6+9Sl; 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 S1753192AbdFTJi5 (ORCPT + 25 others); Tue, 20 Jun 2017 05:38:57 -0400 Received: from mail-wr0-f176.google.com ([209.85.128.176]:34436 "EHLO mail-wr0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753170AbdFTJiy (ORCPT ); Tue, 20 Jun 2017 05:38:54 -0400 Received: by mail-wr0-f176.google.com with SMTP id 77so88387313wrb.1 for ; Tue, 20 Jun 2017 02:38:44 -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=8XXioQipp3igOlPonRcLWMszRPWDIIQ21sTTscbKVQA=; b=T7N6+9Sl19gDHz/33+XHIcAFTE+iJZdNsZCQwsZBg3p04S6q1LLdfSIrokfFSN3L8U cc+5IIi7bLZpo9jETl58Cpi11pwWTcUHHntxI+4eyY1HQuESUYGkZS98nAQFkqWXhWTu 5hfaOoIWAeorfq5JuycD1o9miIRf8RbCTsO20= 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=8XXioQipp3igOlPonRcLWMszRPWDIIQ21sTTscbKVQA=; b=k085dVpIWHDe0s8mEUaabQ1whYubPIGoQiHSqxb3u4TFE/lWVainnkW6q38BGOenDM ZNiWI18lOWUqoId6qx287mpXUdM6y8Y6LnjB25hx92k206igVUZCZRMW3aS/MHX1PE6k foncT7+N54ci5PVFoZ0nKbLhnUPPYSZkpYOWnuU++K4Z8nY2rF6IJ7lmjoBixEFEroHQ P5yu74yPRltXBfEdzUc/75wjgKivoogu0lJNZjFMes/navMSB6HwGkYbsECs+h734Cbb 5hIHZwUC2ZKq8N6zdEm36bl1SOzE2uEhhmM5LW0LwDaTsqghkRSyPkUoLmjynWW/Mm4J y/Zw== X-Gm-Message-State: AKS2vOxedkN1wJtuwfGPRrxQtCJxUwKQKSgPf8IKHFxY708PYWnS8v/A DaSPbfpIg9zxNGuk X-Received: by 10.223.161.219 with SMTP id v27mr3197605wrv.135.1497951523630; Tue, 20 Jun 2017 02:38:43 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.38.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:38:43 -0700 (PDT) From: Benjamin Gaignard To: benjamin.gaignard@linaro.org Cc: linaro-kernel@lists.linaro.org, "Rafael J. Wysocki" , Pavel Machek , Len Brown , Alessandro Zummo , Alexandre Belloni , rtc-linux@googlegroups.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 51/51] power: suspend test: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:59 +0200 Message-Id: <1497951359-13334-52-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. Signed-off-by: Benjamin Gaignard CC: "Rafael J. Wysocki" CC: Pavel Machek CC: Len Brown CC: Alessandro Zummo CC: Alexandre Belloni CC: rtc-linux@googlegroups.com CC: linux-pm@vger.kernel.org CC: linux-kernel@vger.kernel.org --- kernel/power/suspend_test.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 1.9.1 diff --git a/kernel/power/suspend_test.c b/kernel/power/suspend_test.c index 5db2170..334a893 100644 --- a/kernel/power/suspend_test.c +++ b/kernel/power/suspend_test.c @@ -71,7 +71,7 @@ static void __init test_wakealarm(struct rtc_device *rtc, suspend_state_t state) static char info_test[] __initdata = KERN_INFO "PM: test RTC wakeup from '%s' suspend\n"; - unsigned long now; + unsigned long long now; struct rtc_wkalrm alm; int status; @@ -82,10 +82,10 @@ static void __init test_wakealarm(struct rtc_device *rtc, suspend_state_t state) printk(err_readtime, dev_name(&rtc->dev), status); return; } - rtc_tm_to_time(&alm.time, &now); + now = rtc_tm_to_time64(&alm.time); memset(&alm, 0, sizeof alm); - rtc_time_to_tm(now + TEST_SUSPEND_SECONDS, &alm.time); + rtc_time64_to_tm(now + TEST_SUSPEND_SECONDS, &alm.time); alm.enabled = true; status = rtc_set_alarm(rtc, &alm);