From patchwork Tue Jan 13 15:44:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xunlei Pang X-Patchwork-Id: 43057 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 58DB520DE8 for ; Tue, 13 Jan 2015 15:47:00 +0000 (UTC) Received: by mail-lb0-f197.google.com with SMTP id w7sf2124051lbi.0 for ; Tue, 13 Jan 2015 07:46:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=t6fw6+xy+D5J7B843M+BN+cvb+Tyiw0cIK1TsZpNaRM=; b=UNKmiK7K0WbmKHO5QxfDHvDYeQG4i96MNOEauj+dewsTMNhSyEEz8jD+1kn+DS+hVd CTMXbc2nktBwAzFJqufnGy7hYlEJxroVMRdssTdgpFmxBVUfc/gTlhYmltCKE8ITC5DG rW9R+6HJkIqOcEBI15zB/YAkLSLgJSY/RcrGcqE0/Xct3JcXubYvrZXilypBb1m4V1PU HyVrBZ4rj9dni1JQYI8fS28zJ0vUC8xTFliEGYJyLxBsyPg40rui/qdYLos0ojnVj51Q TVIvxBC5YOInWviJuaY/CMVHxrRIZk4lhZqEQv5kN7EQ79nFIEt3yqUmJGvNDxoorOGV H24A== X-Gm-Message-State: ALoCoQnastYFfzN0kZHXWyPpB52gf9QTgcSI6mRiES+8E9xp7dOdV8q9evbsKDIPsBZomC3edZ81 X-Received: by 10.112.141.232 with SMTP id rr8mr4580737lbb.0.1421164019371; Tue, 13 Jan 2015 07:46:59 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.22.40 with SMTP id a8ls9519laf.66.gmail; Tue, 13 Jan 2015 07:46:59 -0800 (PST) X-Received: by 10.152.45.4 with SMTP id i4mr43203105lam.74.1421164019203; Tue, 13 Jan 2015 07:46:59 -0800 (PST) Received: from mail-lb0-x231.google.com (mail-lb0-x231.google.com. [2a00:1450:4010:c04::231]) by mx.google.com with ESMTPS id y8si24551322lbw.107.2015.01.13.07.46.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Jan 2015 07:46:59 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::231 as permitted sender) client-ip=2a00:1450:4010:c04::231; Received: by mail-lb0-f177.google.com with SMTP id b6so3221787lbj.8 for ; Tue, 13 Jan 2015 07:46:59 -0800 (PST) X-Received: by 10.112.14.6 with SMTP id l6mr43423875lbc.91.1421164019123; Tue, 13 Jan 2015 07:46:59 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.9.200 with SMTP id c8csp1421036lbb; Tue, 13 Jan 2015 07:46:58 -0800 (PST) X-Received: by 10.70.128.232 with SMTP id nr8mr51717813pdb.110.1421164017056; Tue, 13 Jan 2015 07:46:57 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id rf8si12905928pab.79.2015.01.13.07.46.55; Tue, 13 Jan 2015 07:46:57 -0800 (PST) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752951AbbAMPqn (ORCPT + 27 others); Tue, 13 Jan 2015 10:46:43 -0500 Received: from m15-111.126.com ([220.181.15.111]:37354 "EHLO m15-111.126.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751993AbbAMPqh (ORCPT ); Tue, 13 Jan 2015 10:46:37 -0500 Received: from vptest-PC.zte.com.cn (unknown [182.149.91.53]) by smtp1 (Coremail) with SMTP id C8mowEAZEUVxPbVUBIRpDg--.692S6; Tue, 13 Jan 2015 23:44:58 +0800 (CST) From: Xunlei Pang To: linux-kernel@vger.kernel.org, John Stultz , Arnd Bergmann Cc: rtc-linux@googlegroups.com, Thomas Gleixner , Alessandro Zummo , Xunlei Pang Subject: [RFC PATCH v2 3/9] rtc/test: Update driver to address y2038/y2106 issues Date: Tue, 13 Jan 2015 23:44:51 +0800 Message-Id: <1421163897-8020-4-git-send-email-xlpang@126.com> X-Mailer: git-send-email 2.0.4 In-Reply-To: <1421163897-8020-1-git-send-email-xlpang@126.com> References: <1421163897-8020-1-git-send-email-xlpang@126.com> X-CM-TRANSID: C8mowEAZEUVxPbVUBIRpDg--.692S6 X-Coremail-Antispam: 1Uf129KBjvJXoW7tr45Cw1ruw45ur1kKFWfZrb_yoW8XFWfpa 13Aas0kF4rta4fW3WkJF1kCFWYgws7Z3y8KF1xKwnY93WrJa4DtF1xGFyUtr1DJFZ5Ww13 u3WYkFy5W3WUCaDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07juwZcUUUUU= X-Originating-IP: [182.149.91.53] X-CM-SenderInfo: p0ost0bj6rjloofrz/1tbiJxCAv01sACyxzwAAs7 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Original-Sender: xlpang@126.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::231 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=neutral (body hash did not verify) header.i=@; dmarc=fail (p=NONE dis=NONE) header.from=126.com Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Xunlei Pang This driver has a number of y2038/y2106 issues. This patch resolves them by: - Repalce get_seconds() with get_seconds64() - Replace rtc_time_to_tm() with rtc_time64_to_tm() - Change test_rtc_set_mmss() to use rtc_class_ops's set_mmss64() After this patch, this driver should not have any remaining y2038/y2106 issues. Signed-off-by: Xunlei Pang --- drivers/rtc/rtc-test.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/rtc/rtc-test.c b/drivers/rtc/rtc-test.c index 8f86fa9..056138b 100644 --- a/drivers/rtc/rtc-test.c +++ b/drivers/rtc/rtc-test.c @@ -30,13 +30,13 @@ static int test_rtc_set_alarm(struct device *dev, static int test_rtc_read_time(struct device *dev, struct rtc_time *tm) { - rtc_time_to_tm(get_seconds(), tm); + rtc_time64_to_tm(get_seconds64(), tm); return 0; } -static int test_rtc_set_mmss(struct device *dev, unsigned long secs) +static int test_rtc_set_mmss(struct device *dev, time64_t secs) { - dev_info(dev, "%s, secs = %lu\n", __func__, secs); + dev_info(dev, "%s, secs = %lld\n", __func__, (long long)secs); return 0; } @@ -60,7 +60,7 @@ static const struct rtc_class_ops test_rtc_ops = { .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_mmss, .alarm_irq_enable = test_rtc_alarm_irq_enable, };