From patchwork Thu Mar 19 05:45:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 46012 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C891B2153C for ; Thu, 19 Mar 2015 05:47:10 +0000 (UTC) Received: by labgq15 with SMTP id gq15sf10719330lab.0 for ; Wed, 18 Mar 2015 22:47:09 -0700 (PDT) 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=wROTwTegGy8VhraBI7XfT/bywPVSccBYvFY8HcZvT9c=; b=XN+IUm26m9YN0ixd3bBv0StM4VeMBB9F9ySebzlmhlQZnk4dc5VSAXIQDsNUBMeBUs U3tRDC9aW6dQguY19IDUWyMNL6XeOFhDsM8V85M1teVOVA+Ua/87PslCtFB/KGCoVFw5 pvhVSg+xBT5xunDhBPs9NG2eKOPdBna/8YYq57AngsHu6m+p/dqzwkUYnOh2SIyCe/jS u+m1fPGdsEVX+TMB0zmYxHcIEz/WPnV5nlZIyj94PG+lV1l6yn1KsblyhzhzPQlllM+m VdpO00bjvS+ZIdUKbSza7forXElYBh/wkE8uGaaMg0+QAwcSC6npnboPZhBbGEd7TJes 27JQ== X-Gm-Message-State: ALoCoQlTILV4zMSfXsMXgTevo5oZ1SLdg34sE706NxOoJVBMydG8C9ZRGISW2VVEkhe39zMXxXFe X-Received: by 10.112.77.101 with SMTP id r5mr12044357lbw.4.1426744029495; Wed, 18 Mar 2015 22:47:09 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.181.137 with SMTP id dw9ls222779lac.85.gmail; Wed, 18 Mar 2015 22:47:08 -0700 (PDT) X-Received: by 10.112.161.229 with SMTP id xv5mr41936776lbb.6.1426744028931; Wed, 18 Mar 2015 22:47:08 -0700 (PDT) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id ac10si240278lbc.6.2015.03.18.22.47.08 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Mar 2015 22:47:08 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by lbblx11 with SMTP id lx11so23141426lbb.3 for ; Wed, 18 Mar 2015 22:47:08 -0700 (PDT) X-Received: by 10.152.26.201 with SMTP id n9mr66514117lag.29.1426744028510; Wed, 18 Mar 2015 22:47:08 -0700 (PDT) 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.35.133 with SMTP id h5csp171456lbj; Wed, 18 Mar 2015 22:47:07 -0700 (PDT) X-Received: by 10.70.90.233 with SMTP id bz9mr90676985pdb.47.1426744026644; Wed, 18 Mar 2015 22:47:06 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id em4si552501pac.131.2015.03.18.22.47.04; Wed, 18 Mar 2015 22:47:06 -0700 (PDT) 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 S1753360AbbCSFqw (ORCPT + 27 others); Thu, 19 Mar 2015 01:46:52 -0400 Received: from mail-pa0-f42.google.com ([209.85.220.42]:36552 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753042AbbCSFqq (ORCPT ); Thu, 19 Mar 2015 01:46:46 -0400 Received: by padcy3 with SMTP id cy3so65080186pad.3 for ; Wed, 18 Mar 2015 22:46:45 -0700 (PDT) X-Received: by 10.66.141.11 with SMTP id rk11mr87993077pab.29.1426744005655; Wed, 18 Mar 2015 22:46:45 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([114.30.40.58]) by mx.google.com with ESMTPSA id j4sm655258pdk.76.2015.03.18.22.46.41 (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Mar 2015 22:46:44 -0700 (PDT) From: Baolin Wang To: richardcochran@gmail.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, john.stultz@linaro.com, tglx@linutronix.de, arnd@linaro.org, baolin.wang@linaro.org Subject: [PATCH 4/4] ptp/ixp46x:Replace timespec with ktime_t in ptp_ixp46x.c Date: Thu, 19 Mar 2015 13:45:09 +0800 Message-Id: <1426743909-24335-5-git-send-email-baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1426743909-24335-1-git-send-email-baolin.wang@linaro.org> References: <1426743909-24335-1-git-send-email-baolin.wang@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: baolin.wang@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org 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: , This patch changes the 32-bit time type (timespec) to the 64-bit one (ktime_t), since 32-bit time types will break in the year 2038. This patch implements the getktime/setktime interfaces with "ktime_t" type, and removes the gettime/settime interfaces with "timespec" type in ptp_ixp46x.c file. Signed-off-by: Baolin Wang --- drivers/ptp/ptp_ixp46x.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/drivers/ptp/ptp_ixp46x.c b/drivers/ptp/ptp_ixp46x.c index 604d340..102b673 100644 --- a/drivers/ptp/ptp_ixp46x.c +++ b/drivers/ptp/ptp_ixp46x.c @@ -175,39 +175,30 @@ static int ptp_ixp_adjtime(struct ptp_clock_info *ptp, s64 delta) return 0; } -static int ptp_ixp_gettime(struct ptp_clock_info *ptp, struct timespec *ts) +static int ptp_ixp_getktime(struct ptp_clock_info *ptp, ktime_t *kt) { - u64 ns; - u32 remainder; unsigned long flags; struct ixp_clock *ixp_clock = container_of(ptp, struct ixp_clock, caps); struct ixp46x_ts_regs *regs = ixp_clock->regs; spin_lock_irqsave(®ister_lock, flags); - ns = ixp_systime_read(regs); + *kt = ns_to_ktime(ixp_systime_read(regs)); spin_unlock_irqrestore(®ister_lock, flags); - ts->tv_sec = div_u64_rem(ns, 1000000000, &remainder); - ts->tv_nsec = remainder; return 0; } -static int ptp_ixp_settime(struct ptp_clock_info *ptp, - const struct timespec *ts) +static int ptp_ixp_setktime(struct ptp_clock_info *ptp, ktime_t kt) { - u64 ns; unsigned long flags; struct ixp_clock *ixp_clock = container_of(ptp, struct ixp_clock, caps); struct ixp46x_ts_regs *regs = ixp_clock->regs; - ns = ts->tv_sec * 1000000000ULL; - ns += ts->tv_nsec; - spin_lock_irqsave(®ister_lock, flags); - ixp_systime_write(regs, ns); + ixp_systime_write(regs, ktime_to_ns(kt)); spin_unlock_irqrestore(®ister_lock, flags); @@ -248,8 +239,8 @@ static struct ptp_clock_info ptp_ixp_caps = { .pps = 0, .adjfreq = ptp_ixp_adjfreq, .adjtime = ptp_ixp_adjtime, - .gettime = ptp_ixp_gettime, - .settime = ptp_ixp_settime, + .getktime = ptp_ixp_getktime, + .setktime = ptp_ixp_setktime, .enable = ptp_ixp_enable, };