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;