From patchwork Wed Jan 27 09:34:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 60608 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp2472095lbb; Wed, 27 Jan 2016 01:31:24 -0800 (PST) X-Received: by 10.66.90.166 with SMTP id bx6mr41454273pab.75.1453887084172; Wed, 27 Jan 2016 01:31:24 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id sm4si8283423pac.245.2016.01.27.01.31.23; Wed, 27 Jan 2016 01:31:24 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754462AbcA0JbW (ORCPT + 30 others); Wed, 27 Jan 2016 04:31:22 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:10815 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753931AbcA0JbS (ORCPT ); Wed, 27 Jan 2016 04:31:18 -0500 Received: from 172.24.1.51 (EHLO SZXEML424-HUB.china.huawei.com) ([172.24.1.51]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id DAO70075; Wed, 27 Jan 2016 17:31:10 +0800 (CST) Received: from localhost.localdomain (10.175.100.166) by SZXEML424-HUB.china.huawei.com (10.82.67.153) with Microsoft SMTP Server id 14.3.235.1; Wed, 27 Jan 2016 17:30:58 +0800 From: Kefeng Wang To: "David S . Miller" CC: Derek Chickles , Raghu Vatsavayi , Satanand Burla , Felix Manlunas , , , , Kefeng Wang Subject: [PATCH] net: cavium: liquidio: use helpers ns_to_timespec64() Date: Wed, 27 Jan 2016 17:34:37 +0800 Message-ID: <1453887277-11531-1-git-send-email-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.6.0.GIT MIME-Version: 1.0 X-Originating-IP: [10.175.100.166] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020202.56A88E60.00D3, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: fffcb220b2a00b859526f7a9ef882018 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Convert the driver to use ns_to_timespec64() to keep consistency with timespec64_to_ns() instead of open coding the same logic. Signed-off-by: Kefeng Wang --- drivers/net/ethernet/cavium/liquidio/lio_main.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) -- 2.6.0.GIT diff --git a/drivers/net/ethernet/cavium/liquidio/lio_main.c b/drivers/net/ethernet/cavium/liquidio/lio_main.c index b895044..8727655 100644 --- a/drivers/net/ethernet/cavium/liquidio/lio_main.c +++ b/drivers/net/ethernet/cavium/liquidio/lio_main.c @@ -1526,7 +1526,6 @@ static int liquidio_ptp_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts) { u64 ns; - u32 remainder; unsigned long flags; struct lio *lio = container_of(ptp, struct lio, ptp_info); struct octeon_device *oct = (struct octeon_device *)lio->oct_dev; @@ -1536,8 +1535,7 @@ static int liquidio_ptp_gettime(struct ptp_clock_info *ptp, ns += lio->ptp_adjust; spin_unlock_irqrestore(&lio->ptp_lock, flags); - ts->tv_sec = div_u64_rem(ns, 1000000000ULL, &remainder); - ts->tv_nsec = remainder; + *ts = ns_to_timespec64(ns); return 0; }